The NVIDIA JetPack - Introduction
This guide is intended for developers who want to flash and set up the Nvidia Jetson Xavier boards (i.e., AXG, NX).
- x86 PC/laptop for downloading Jetpack and flashing the OS
- USB-C to USB-A (or USB-C to USB-C) cable to connect the PC to the ConnecTech carrier
- Power supply cable
- Bench/System/ATE programmable DC power supply, capable of supplying 20V/2A
- (optional) Ethernet cable to connect the Xavier to access it with SSH
To use the Xavier directly without SSHing into it: - HDMI cable to connect to an external display - USB mouse and keyboard
On the developer's host PC:
- Ubuntu 18.04-20.04 (depending on the version of the JetPack)
- Nvidia JetPack installed through SDK Manager (instructions below)
- Xavier Connecttech BSP for the
board_typeboard (e.g. AGX, NX) and JetPack
jetpack_ver(e.g 4.4.2, 5.0.2). (Not required if you already have the image ready to flash)
Carrier hardware configuration
Make sure that the switches on the carrier are set like in the picture below, so that the unit can boot manually when pressing the power (PWR) button. DO NOT power on the unit until instructed.
- Connect the carrier to the power supply through the provided cable, and set the power supply to 16V/2A.
- Keep the power supply OFF.
- Connect the HDMI cable, and the mouse/keyboard to the carrier.
- Use the USB-C cable to connect the PC to the OTG USB port on the carrier.
Flash a new image from scratch
If you need to install an new JetPack image from scratch please follow the following steps.
Jetpack setup on the host
- Download the Nvidia SDK manager from the official website by clicking Download Nvidia SDK Manager
- Run SDKManager and login with developer.nvidia.com credentials, and follow these steps:
- Set the following options:
- Target Hardware: Jetson Xavier
- Target operating system: Linux Jetpack
- Target Hardware: Jetson Xavier
- Check that everything is selected and continue
- The SDKManager will ask the user password to download all the components and it will install them into a local folder on the host (~12Gb of free space required); remember: this is the password of the local Ubuntu host, not the Jetson Xavier.
- After the installation, the SDK Manager will be ready to flash the OS image on the Xavier; Do not preceed further! Press SKIP to abort the operation and quit from the SDK Manager
- Download the ConnectTech board support package from the official website: under Downloads click on the BSP you need, it will be downloaded as
- At this point the
sdkManagershould have created a folder tree in
~/nvidiacontaining all the files needed for the flash. Copy the
.tgzpackage downloaded from ConnectTech website into
- Extract the BSP:
tar -xzf CTI-<*>.tgz
Before flashing the image, we need first to put the board in recovery mode.
Booting the Xavier in Recovery mode
With the Nvidia Jetson Xavier AGX:
- Press the Force Recovery (FR) button on the carrier and keep it pressed
- Turn on the power supply (16V)
- Wait for several seconds, keeping the FR button pressed
- Press the power (PWR) button for at least one second. Wait for several seconds
- Release the FR button.
Now the board is programming mode.
With a Nvidia Jetson Xavier NX, instead, keep the button RST/RECOVERY pressed for several seconds and then, when released, the board will be in recovery mode.
In order to check that the board went in recovery mode, run on a terminal in the host
The board is in recovery mode if it appears something like this
Flash the image
At this point we are ready to flash, in the host:
- Change into the CTI-L4T directory:
- Run the install script (as root or sudo) to automatically install the BSP files to the correct locations:
Here you can find the tutorial about the procedure by ConnectTech.
Verify the installation
After the reboot process, you should be greeted with the OS configuration wizard. After configuring the system, the Xavier should boot normally and be ready to use.
Complete the OEM installation
After booting into the OS, follow the OEM installation with the following options:
- Accept the license agreement
- Select English language
- Select the English (US) keyboard layout
- Select the preferred time zone
- Set the user name to
icubwith the hostname
ergocub-head, depending on the robot the board will be mounted on
- Allow login without password
- Let the installation process finish
After rebooting into the graphical OS, run the following commands in a terminal to update the system:
sudo apt install -f
sudo apt update && sudo apt upgrade
Install the Cuda libraries (OPTIONAL)
Usually the Jetpack flashing procedure takes care of installing the Cuda toolkit and libraries. If running the command
nvcc --version returns
Command not found, then you need to install them manually though
For example Jetpack 4.5.1, which uses Cuda 10.2 do:
sudo apt install cuda-libraries-dev-10-1 cuda-nvcc-10-2
Then, within the
Install the latest CMake version (MANDATORY only for Ubuntu 18.04)
The latest Robotology superbuild version requires CMake >= 3.12, but Ubuntu 18.04 only provides CMake 3.10, so it needs to be upgraded.
To download the latest version, first remove CMake with:
sudo apt purge --auto-remove cmake
Get a copy of the signing key:
wget -O - https://apt.kitware.com/keys/kitware-archive-latest.asc 2>/dev/null | gpg --dearmor - | sudo tee /etc/apt/trusted.gpg.d/kitware.gpg >/dev/null
Add the repository:
sudo apt-add-repository "deb https://apt.kitware.com/ubuntu/ $(lsb_release -cs) main"
Update the repo index and install CMake:
sudo apt update
sudo apt install cmake
librealsense with Cuda support (OPTIONAL)
librealsense is a cross-platform library provided by Intel that can be used to take advantage of the features of the Intel Realsense cameras.
After installing the cuda libraries, we can make the Realsense camera use also the gpu resources for better performances, enabling the cuda support.
In a terminal, clone the official repo with:
git clone https://github.com/IntelRealSense/librealsense.git
Install the librealsense required development packages:
sudo apt install libssl-dev freeglut3-dev libusb-1.0-0-dev pkg-config libgtk-3-dev unzip -y
udev rules (the librealsense kernel patching procedure does not work with recent Jetpack versions):
sudo cp config/99-realsense-libusb.rules /etc/udev/rules.d/
sudo udevadm control --reload-rules && sudo udevadm trigger
Now you are ready to compile librealsense with Cuda support:
mkdir build && cd build
cmake ../ -DFORCE_LIBUVC=BOOL:ON -DCMAKE_BUILD_TYPE=Release -DBUILD_WITH_CUDA=BOOL:ON -DBUILD_EXAMPLE=BOOL:OFF
sudo make install
For more information, refer to the official documentation provided in the repository.
Install jtop (OPTIONAL)
jtop (a.k.a jetson-stats) is a package for monitoring and control your NVIDIA Jetson boards.
For installing it:
sudo -H pip install -U jetson-stats
Create a backup image
For this step you need to have completed the steps about the sdkManager.
Make sure that the Xavier was started in recovery mode and it is found with
On the host machine go to the
Linux_for_Tegra folder and run:
sudo ./flash.sh -r -k APP -G backup.img <board_identifier> mmcblk0p1
For example for flashing the NVIDIA Jetson Xavier NX,
Flashing a backup image
sudo mv bootloader/system.img* . #this save old image
sudo mv backup.img.raw bootloader/system.img #rename new image
sudo ./flash.sh -r jetson-xavier-nx-devkit-emmc mmcblk0p1