NVIDIA Jetson Hacks

From RidgeRun Developer Connection
Jump to: navigation, search

General hacks

Glass to glass latency: NVIDIA Jetson Glass to Glass Latency

Force recovery by software:

You will need a running image and be able to connect to the board:

sudo reboot --force forced-recovery

Create default user in the file system (Skip GUI setup in JetPack >= 4.2)

  • Methods to bypass first boot account setting via GUI (>= 4.2):
#Possible required package
sudo apt install qemu-user-static

#Create a user and password in the file system
sudo ./l4t_create_default_user.sh -u nvidia -p nvidia

#Flash board again
sudo ./flash.sh jetson-tx2 mmcblk0p1

The l4t_create_default_user.sh can be found at: https://devtalk.nvidia.com/default/topic/1054926/jetson-nano/jetson-nano-all-usb-ports-suddenly-stopped-working/post/5356153/#5356153

Or in here if you don't find the post: https://forums.developer.nvidia.com/t/jetson-nano-all-usb-ports-suddenly-stopped-working/75784/37

  • Other related topics

https://devtalk.nvidia.com/default/topic/1061248/jetson-nano/facing-problem-while-flashing-the-emmc-on-the-jetson-nano-production-ready-module-not-the-dev-kit-/post/5374722/#5374722

https://devtalk.nvidia.com/default/topic/1061538/jetson-nano/how-to-skip-gui-system-setup-configuration/post/5375419/#5375419 (Another method, it hasn't been tested yet).

Lost connection issue while flashing OS using SDK Manager (Full JetPack installation)

Use this workaround:

  • Unselect "Jetson OS" option in SDK manager, leave "Jetson SDK Components" selected.
  • Flash OS using:
sudo ./flash.sh jetson-xavier mmcblk0p1
  • When board boots up, finish installation via ubuntu GUI (user/password creation)
  • Install SDK Components (CUDA, TensorRT, cuDNN, OpenCV, Visionworks, etc) using SDK manager, this requires entering board IP address and user/password created. This is because SDK components are installed via ssh.

Enabling the imx477 Camera Driver (JetPack >= 4.6)

Since JetPack 4.6, the imx477 Camera Driver comes bundled into the kernel. Running the following command from the device opens a CLI to help enable the driver:

sudo /opt/nvidia/jetson-io/jetson-io.py

In the first CLI menu, please select 'Configure Jetson Nano CSI Connector', as shown in the following image:

Jetson io nano.png

In the next menu, please select 'Configure for compatible hardware':

Jetson io nano 2.png

Then, please select 'Camera IMX477 Dual':

Jetson io nano 3.png

Then, please select 'Save pin changes':

Jetson io nano 4.png

Then, please select 'Save and reboot to reconfigure pins':

Jetson io 5.png

Finally, please press any key to reboot the device:

Jetson io 6.png

TX1/TX2

Xavier

GStreamer

Build from source

#!/bin/bash

cd $HOME/

if [ $# -eq 0 ]; then
    echo "***No argument supplied***"
    echo "Usage:"
    echo "./jetson-build-gstreamer.sh <VERSION>"
    echo "Example:"
    echo "./jetson-build-gstreamer.sh 1.16.0"
    exit
fi

#Install dependencies
sudo apt-get -y install build-essential dpkg-dev flex bison autotools-dev automake \
autopoint libtool gtk-doc-tools libgstreamer1.0-dev \
libxv-dev libasound2-dev libtheora-dev libogg-dev libvorbis-dev \
libbz2-dev libv4l-dev libvpx-dev libjack-jackd2-dev libsoup2.4-dev libpulse-dev \
faad libfaad-dev libgl1-mesa-dev libgles2-mesa-dev \
libx264-dev libmad0-dev liborc-0.4-dev liborc-0.4-0 liborc-0.4-0-dbg liborc-0.4-doc

#The version you want to install is given as a command-line argument
VERSION=$1

echo "Starting GStreamer Installation..."

#Set an absolute path for building directory
mkdir $HOME/gst_$VERSION
cd $HOME/gst_$VERSION

#Get the sources of the basic stuff (core, base, good, bad, ugly)
wget https://gstreamer.freedesktop.org/src/gstreamer/gstreamer-$VERSION.tar.xz --no-check-certificate
wget https://gstreamer.freedesktop.org/src/gst-plugins-base/gst-plugins-base-$VERSION.tar.xz --no-check-certificate
wget https://gstreamer.freedesktop.org/src/gst-plugins-good/gst-plugins-good-$VERSION.tar.xz --no-check-certificate
wget https://gstreamer.freedesktop.org/src/gst-plugins-bad/gst-plugins-bad-$VERSION.tar.xz --no-check-certificate
wget https://gstreamer.freedesktop.org/src/gst-plugins-ugly/gst-plugins-ugly-$VERSION.tar.xz --no-check-certificate

#Untar all
for a in `ls -1 *.tar.*`; do tar -xf $a; done

export PKG_CONFIG_PATH=$HOME/gst_$VERSION/out/lib/pkgconfig
export PKG_CONFIG_PATH=$PKG_CONFIG_PATH:/usr/lib/aarch64-linux-gnu/pkgconfig 
export LD_LIBRARY_PATH=$HOME/gst_$VERSION/out/lib

mkdir -p $HOME/gst_$VERSION/out

#Gstreamer Core
cd gstreamer-$VERSION
./configure --prefix=$HOME/gst_$VERSION/out;
make;
make install;
cd ..

#Gstreamer Base
cd gst-plugins-base-$VERSION
./configure --prefix=$HOME/gst_$VERSION/out;
make;
make install;
cd ..

#Gstreamer Good
cd gst-plugins-good-$VERSION
./configure --prefix=$HOME/gst_$VERSION/out;
make;
make install;
cd ..

#Gstreamer Bad
cd gst-plugins-bad-$VERSION
./configure --prefix=$HOME/gst_$VERSION/out;
make;
make install;
cd ..

#Gstreamer Ugly
cd gst-plugins-ugly-$VERSION
./configure --prefix=$HOME/gst_$VERSION/out;
make;
make install;
cd ..

export LD_LIBRARY_PATH=$HOME/gst_$VERSION/out/lib

#Copy NVIDIA GStreamer libraries
cd /usr/lib/aarch64-linux-gnu/gstreamer-1.0/
cp libgstnv* libgstomx.so $HOME/gst_$VERSION/out/lib/gstreamer-1.0/

gst-inspect-1.0 --version

cd $HOME/

NVIDIA script (JetPack >= 4.2 )

Since JetPack 4.2 there is a script called gst-install: https://developer.nvidia.com/embedded/dlc/l4t-accelerated-gstreamer-guide-32-1.

Usage

Build

VERSION=1.14.4
INSTALL_PATH=/home/nvidia/gst-$VERSION
mkdir $INSTALL_PATH
sudo gst-install --prefix=$INSTALL_PATH --version=$VERSION

Notes:

  • Script will download sources in /tmp/ and put the libraries in INSTALL_PATH. That's why you have to export LD_LIBRARY_PATH and PATH.
  • Components downloaded and installed: core, base, good, bad, ugly, libav.
  • NVIDIA plugins seem to present problems with the newer Gstreamer version (1.16.0)

Install

export LD_LIBRARY_PATH=$INSTALL_PATH/lib/aarch64-linux-gnu
export PATH=$INSTALL_PATH/bin:$PATH

JetPack Releases

Release Platforms L4T
4.2.2 Nano, Xavier, TX2, TX1 32.2
4.2.1 Nano, Xavier, TX2, TX1 32.2
4.2 Nano, Xavier, TX2 32.1
4.1.1 Nano, Xavier 31.1
3.3 TX2, TX1 28.2.1 (TX2)/ 28.2(TX1)

Source: https://developer.nvidia.com/embedded/jetpack-archive

See also

RTOS support:

https://devtalk.nvidia.com/default/topic/1055817/jetson-agx-xavier/supported-recommended-rtos-for-jetson-xavier/post/5352693/#5352693

https://developer.nvidia.com/embedded/downloads#?search=spe

https://devtalk.nvidia.com/default/topic/1008974/jetson-tx2/is-there-any-real-time-os-for-jetson-/1

L4T Documentation:

https://docs.nvidia.com/jetson/archives/l4t-archived/l4t-322/index.html


RidgeRun Resources

Quick Start Client Engagement Process RidgeRun Blog Homepage
Technical and Sales Support RidgeRun Online Store RidgeRun Videos Contact Us

OOjs UI icon message-progressive.svg Contact Us

Visit our Main Website for the RidgeRun Products and Online Store. RidgeRun Engineering informations are available in RidgeRun Professional Services, RidgeRun Subscription Model and Client Engagement Process wiki pages. Please email to support@ridgerun.com for technical questions and contactus@ridgerun.com for other queries. Contact details for sponsoring the RidgeRun GStreamer projects are available in Sponsor Projects page. Ridgerun-logo.svg
RR Contact Us.png