JetPack 6 Key Feature: New Linux Distributions

From RidgeRun Developer Wiki



Previous: JetPack 6 Key Features/Upgradable Compute Stack Index Next: JetPack 6 Key Features/Nsight Developer Tools






In this section, you will find detailed information about the various Linux-based distributions now available for use on Jetson devices, expanding beyond the default Jetson Linux included with JetPack 6. Additionally, you will discover comprehensive guides on installing and configuring these distributions, specifically focusing on Canonical Ubuntu. The instructions include prerequisites, step-by-step installation procedures, and methods for installing necessary software and drivers to fully utilize the capabilities of Jetson hardware.


By default JetPack 6 includes Jetson Linux out of the box. However, now some Jetson ecosystem partners offers more Linux based distributions to use on Jetson. Some of these new distributions are as follows:

  • Canonical Ubuntu 22.04 (Ubuntu 20.04 is not available).
  • Red Hat Enterprise Linux 9.3.
  • Windriver commercial embedded Linux OS.
  • RedHawk: Concurrent Real-Time offers a Real-Time Linux OS designed for mission-critical, hard real-time applications.
  • Yocto based distributions: Ecosystem partners such as Balena, Foundaries.io, and TimeSys offer a range of Yocto-based distributions and services utilizing meta-tegra.
Ubuntu logo
Source: RedHat Resources
RedHat Logo
Source: Canonical Resources

Canonical Ubuntu

This section presents a comprehensive guide on how to use an Ubuntu image on a Jetson Orin. It includes detailed steps for downloading the appropriate Ubuntu image, preparing the Jetson Orin hardware, and flashing the image onto the device.

Prerequisites

  • A host computer (x86 architecture) running Ubuntu.
  • A monitor with Display port and an USB keyboard.
  • An USB-C to A cable connecting the host to the device.
  • A 2 pin jumper cap connector (only necessary for Nano/NX).
  • A boot media to program your image on:
    • SD card.
    • USB.
    • NVMe disk.

Installation instructions

1. Download the Ubuntu image from this link.

2. Download the boot firmware from this link.

3. Extract the boot firmware and install the necessary packages:

tar xf Jetson_Linux_R36.3.0_aarch64.tbz2 && cd Linux_for_Tegra/
sudo ./tools/l4t_flash_prerequisites.sh
sudo apt install -y python3 cpp device-tree-compiler mkbootimg

4. Put the device into recovery mode and connect it to the host computer.

5. Program the boot firmware (QSPI upgrade). Run this command in the Linux_for_Tegra directory, the device will reboot automatically upon success.

Jetson AGX Orin.

sudo ./flash.sh p3737-0000-p3701-0000-qspi internal

Jetson Orin Nano/NX.

sudo ./flash.sh p3768-0000-p3767-0000-a0-qspi internal

6. Program the Ubuntu image on the external boot media.

6.1. Insert your boot media on the host and check its device name (using “lsblk” or “dmesg”).

6.2. Copy the image over the boot media (assuming here it is detected as /dev/sda):

xzcat ubuntu-22.04-preinstalled-server-arm64+tegra-igx.img.xz | sudo dd of=/dev/sda bs=16M status=progress
sudo sync

6.3. Remove the boot media from the host, insert it on the device.


As an alternative for the step 6, you can program the Ubuntu image using Nvidia’s L4T restore script. This method is the easiest way to program an internal disk, such as eMMC or pre-installed NVMe disk.

As a prerequisite for this method, you need to put the device into recovery mode. You can then use the backup-restore tool from Nvidia to install a raw disk image on any installed media. The tool loads an initrd flash image via the USB-C cable and boots it, enabling an IPv6 network connection over USB. It relies on nfs-kernel-server service to host the raw image, allowing a NFS mount on the development kit, connected to the host machine (which runs the script). The script will use SSH to connect to the initrd image, mount the NFS volume, and perform the raw image copy using dd. Therefore, the boot media must be connected to the development kit.

From the Linux_for_Tegra directory, enter the following command:

sudo ./tools/backup_restore/l4t_backup_restore.sh -r --raw-image jammy-preinstalled-server-arm64+tegra-igx.img -e <device> <board-type>

Board type:

  • Jetson AGX Orin: jetson-agx-orin-devkit.
  • Jetson Orin Nano/NX: jetson-orin-nano-devkit.

Device:

  • SD card: mmcblk0 (for devices without eMMC, like Nano or NX) or mmcblk1 (for Jetson AGX).
  • USB media: sda.
  • NVMe disk: nvme0n1.

Install NVIDIA proprietary software

The Ubuntu image brings anything necessary to boot Linux on a Jetson development kit. However, to unlock the features of the Orin’s SOC (Wireless, bluetooth, GPU, …) you can install additional NVIDIA proprietary drivers and libraries using a Launchpad PPA:

sudo add-apt-repository ppa:ubuntu-tegra/updates

# Install Tegra firmwares and necessary Nvidia libraries
sudo apt install -y nvidia-tegra-drivers-36

# Add user to group render allows running GPU related commands as non root
sudo usermod -a -G render ubuntu
sudo reboot

Install CUDA and TensorRT

NVIDIA provides a few SDKs like CUDA Toolkit and TensorRT that allow building AI applications on Jetson devices. Those ones are maintained outside of Ubuntu but can be installed with the following commands:

# CUDA
sudo apt-key adv --fetch-keys "https://repo.download.nvidia.com/jetson/jetson-ota-public.asc"
sudo add-apt-repository -y "deb https://repo.download.nvidia.com/jetson/t234 r36.3 main"
sudo add-apt-repository -y "deb https://repo.download.nvidia.com/jetson/common r36.3 main"
sudo apt install -y cuda

# Tensor RT
sudo apt install -y libnvinfer-bin libnvinfer-samples

# cuda-samples dependencies
sudo apt install -y cmake
echo '/usr/local/cuda-12.2/compat' | sudo tee -a
/etc/ld.so.conf.d/000_cuda.conf
sudo ldconfig

echo "export PATH=/usr/local/cuda-12.2/bin\${PATH:+:\${PATH}}" >> ~/.profile
echo "export LD_LIBRARY_PATH=/usr/local/cuda-12.2/lib64\${LD_LIBRARY_PATH:+:\${LD_LIBRARY_PATH}}" >> ~/.profile

Red Hat Enterprise Linux

This section is guide to flash a NVIDIA Jetson Orin with Red Hat Enterprise Linux. It includes prerequisites, steps to flash the device, and how to use JetPack 6 packages. All the information is based on Install Red Hat Device Edge on NVIDIA Jetson Orin and IGX Orin

Prerequisites

  • A host computer (x86 architecture) running Ubuntu.
  • A monitor with Display port and an USB keyboard.
  • A boot media to program your image on:
    • SD card.
    • USB.
    • NVMe disk.

Get ISO image and Boot the Jetson

Here are described the steps to get the iso image and how to make a storage device bootable.

  1. Download RHEL from RedHat . If you don't have an account create one using any of methods available on the link. Save the credentials to register the device in further steps.
  2. Use a image writing tool like Balena Etcher to prepare a storage media device with the iso image downloaded.
  3. Once the image writing tool finished with the Jetson turned off connect the media device.
  4. Turn on the Jetson and press ESC button on the keyboard as soon as you see the NVIDIA logo on the screen connected to access to UEFI menu.
  5. Once on UEFI go to Boot Manager on the top menu and select the media device to boot the Jetson. Save the changes and exit from the UEFI.
  6. The GRUB menu appears select Install Red Hat Enterprise Linux.

RHEL Installation Process

Once you have selected Install Red Hat Enterprise Linux you will be redirect to Installation Process Menu. In this process we recommend connect the Jetson to Internet via the Ethernet Port.

  1. Select the language and keyboard configuration.
  2. Select the memory partition to install RHEL.
  3. Create a user and root.

Once you finish click on Reboot System.

Configure sudo

Log in with the user you created and follow the next steps.

  1. Open a terminal
  2. Become root using the password you set during the installation with the following command
    [nvidia@localhost ~]$ su
    Password: 
    [root@localhost nvidia]#
  3. Make your user a sudoer by running
    $ usermod -aG wheel $USER
  4. Reboot your system.

Register your device

This process is necessary to access to RedHat serves for packages installation.

  1. Open Settings
    RedHat settings menu
    RedHat Settings Menu
  2. Go to About on the left side menu.
  3. Click on Subscription to Register the device
    RedHat subscription dialog
    Suscription RedHat
  4. With the username and password you used to create an account in RedHat at the beginning of this tutorial register your device.

NVIDIA Configuration

In order to use JetPack on RHEL you must follow the next steps.

  1. Add NVIDIA Repositories
    $ curl -s -L https://nvidia.github.io/libnvidia-container/stable/rpm/nvidia-container-toolkit.repo | sudo tee /etc/yum.repos.d/nvidia-container-toolkit.repo
    $ curl -s -L https://repo.download.nvidia.com/jetson/rhel-9.4/r36.3.1/nvidia-l4t.repo | sudo tee /etc/yum.repos.d/nvidia-l4t.repo
  2. Configure video groups
    $ sudo usermod -a -G video $USER
    $ sudo usermod -a -G video gdm
  3. Install NVIDIA kernel and utilities
    $ sudo dnf -y install nvidia-jetpack-kmod nvidia-jetpack-all nvidia-container-toolkit
  4. Restart your system to load the kernel modules
    $ sudo systemctl reboot
  5. Generate CDI specification file and crio config
    $ sudo nvidia-ctk cdi generate --output=/etc/cdi/nvidia

Maximize Jetson Resources

To improve the results using JetPack enable the following configurations to maximize the resources on the board.

  1. Set the max power mode
    $ sudo nvpmodel -m 0
  2. Enable jetson clocks
    $ sudo jetson_clocks

Use L4T JetPack Container

To use JetPack packages in RHEL is necessary to use them from L4T NVIDIA Containers that includes all the accelerated libraries in JetPack SDK such as: CUDA, cuDNN, TensorRT, etc. Pull the container with

$ podman pull nvcr.io/nvidia/l4t-jetpack:r36.3.0

Test the container with CUDA

To test the container we will run some CUDA sample by following the next steps.

  1. Install git and clone the repository with CUDA samples.
    $ sudo dnf install -y git
    $ cd ${HOME}
    $ git clone -b v12.2 https://github.com/NVIDIA/cuda-samples.git
  2. Run w command to check the display TTY and setup the DISPLAY variable environment.
    $ export DISPLAY=:0
    $ xhost +local:
  3. Run the container
    $ podman run --rm -it \
     -e DISPLAY --net=host \
     --device nvidia.com/gpu=all \
     --group-add keep-groups \
     --security-opt label=disable \
     -v ${HOME}/cuda-samples:/cuda-samples \
     nvcr.io/nvidia/l4t-jetpack:r36.3.0
  4. Build the samples inside the container
    apt update
    apt install -y libglfw3 libglfw3-dev libdrm-dev pkg-config cmake
    
    cd /cuda-samples
    make clean
    make -j$(nproc)

    This process could take a while.

  5. Run the following CUDA examples.
    Output of CUDA particles demo
    Particles sample CUDA
    $ ./bin/aarch64/linux/release/nbody -fullscreen
    Sparks in a black sky
    nbody CUDA sample


Samples List for JetPack
Refer to RedHat Developer: Validate the Jetson GPU support to find more sample related to JetPack packages such as: CuDNN, TensoRT, Deepstream, etc.



Previous: JetPack 6 Key Features/Upgradable Compute Stack Index Next: JetPack 6 Key Features/Nsight Developer Tools