JetPack-5.0 Installation to M.2 SSD for DSBoard-XV2 | Forecr - Forecr.io

JetPack-5.0 Installation to M.2 SSD for DSBoard-XV2

Jetson AGX Xavier

25 October 2022
WHAT YOU WILL LEARN?

1- Including the Kernel Files in Jetson OS Image

2- Installing the Jetson OS

3- Installing the Jetson SDK Components

ENVIRONMENT

Hardware 1: DSBoard-XV2

Hardware 2: PC

OS 2: Ubuntu 20.04

In this tutorial, we will install JetPack-5.0.2 to M.2 SSD for DSBoard-XV2. First, we will include our Image, DTB & NVGPU kernel file in Jetson OS image. Then, we will install the Jetson OS into the DSBoard-XV2. Finally, we will install the Jetson SDK components into it.

Including the Kernel Files in Jetson OS Image

Open the NVIDIA SDK Manager. Select “JetPack 5.0.2” for Target Operating System and “Jetson AGX Xavier modules” for Target Hardware (The “Host Machine” components are not required). Then, continue to Step 2.


Choose only “Jetson OS”, accept the terms & conditions and continue to Step 3.


The SDK Manager will ask the username’s password. Fill it and continue.


A few seconds later…


After the Jetson OS has created, the SDK Manager asks the Jetson module’s flashing style. Just skip it and exit from the SDK Manager.


Open the target HW image folder. (~/nvidia/nvidia_sdk/JetPack_5.0.2_Linux_JETSON_AGX_XAVIER_TARGETS/Linux_for_Tegra/)

For AGX Xavier:

    Download the BSP files from this GitHub link and extract it:


For AGX Xavier Industrial:

    Download the BSP files from this GitHub link and extract it:


Hint: The following steps are done for AGX Xavier, but they are the same with Industrial one (only the DTB file & flashing scripts are different).


Copy the “Image” file from the extracted folder to the “kernel” folder.


Then, copy the DTB file into the “kernel/dtb” folder.


Return to the “JetPack_5.0.2_Linux_JETSON_AGX_XAVIER_TARGETS” folder and copy the "nvgpu.ko" file.


Open a Terminal in the “Linux_for_Tegra” folder.

 

Create the system binaries with this command below:


sudo ./apply_binaries.sh


Update the NVGPU kernel file on the sample root file-system with this command below:


sudo mv ../nvgpu.ko rootfs/usr/lib/modules/5.10.104-tegra/kernel/drivers/gpu/nvgpu/nvgpu.ko


Hint: If you want to configure your username-password & hostname with default settings, you can create user without the Ubuntu installation wizard. To do this, type this command below:


sudo tools/l4t_create_default_user.sh -u {USERNAME} -p {PASSWORD} -a -n {HOSTNAME} --accept-license

For example (username:"nvidia", password:"nvidia", device-name:"nvidia-desktop"):


sudo tools/l4t_create_default_user.sh -u nvidia -p nvidia -a -n nvidia-desktop --accept-license


To flash directly to SSD, we need to modify ./nvidia/nvidia_sdk/JetPack_5.0.2_Linux_JETSON_AGX_XAVIER_TARGETS/Linux_for_Tegra/tools/kernel_flash/flash_l4t_nvme.xml file.


According to SSD size as bytes calculate num sectors and SSD size as GigaBytes with formulas given below:

num sectors = SSD size as bytes / sector size

SSD size as GB = SSD size as bytes / 1024^3


In our example we used 250GB SSD. SSD size as bytes is 250,059,350,016 and sector size is 512(We do not recommend to change sector size). So we calculated our num sectors and SSD size as GB and modified our flash_l4t_nvme.xml file. 


Then, create the system image with this command below:

Attention: If you're using an AGX Xavier Industrial module, please type "jetson-agx-xavier-industrial" instead of "jetson-xavier"


sudo ./tools/kernel_flash/l4t_initrd_flash.sh --no-flash --external-device nvme0n1 -c ./tools/kernel_flash/flash_l4t_nvme.xml -S “SSD size as GB”GiB --showlogs --erase-all jetson-xavier nvme0n1p1

For 250GB SSD we used this command as below:


sudo ./tools/kernel_flash/l4t_initrd_flash.sh --no-flash --external-device nvme0n1 -c ./tools/kernel_flash/flash_l4t_nvme.xml -S 232GiB --showlogs --erase-all jetson-xavier nvme0n1p1


A few seconds later …

Jetson OS Installation

Connect the recovery USB (between installer PC & DSBOARD-XV2's recovery USB) and power connection of your DSBOARD-XV2.

While the DSBOARD-XV2's power connector plugged in,

• wait for boot led lights up

• press reset & recovery buttons together

• release reset button

• release the recovery button after 3 seconds later. This will set it to Recovery mode.


Then, type “lsusb” and check the device connected in Recovery mode. 

("0955:7019 NVidia Corp." for AGX Xavier & "0955:7919 NVidia Corp." for AGX Xavier Industrial)


For AGX Xavier, flash the Jetson OS with this script:


sudo ./tools/kernel_flash/l4t_initrd_flash.sh --flash-only --external-device nvme0n1 -c ./tools/kernel_flash/flash_l4t_nvme.xml -S 232GiB --showlogs --erase-all jetson-xavier nvme0n1p1


For AGX Xavier Industrial, flash the Jetson OS with this script:


sudo ./tools/kernel_flash/l4t_initrd_flash.sh --flash-only --external-device nvme0n1 -c ./tools/kernel_flash/flash_l4t_nvme.xml -S 232GiB --showlogs --erase-all jetson-agx-xavier-industrial nvme0n1p1


A few seconds later …


At the end of the script, the device will reboot. Complete your Ubuntu installation wizard (if you have not created a user with tools/l4t_create_default_user.sh script file) from the DSBOARD-XV2 (language, keyboard type, location, username & password etc.).

To avoid kernel update with "apt upgrade" or "apt-get upgrade" commands, please follow this guide on the Jetson module.

Jetson SDK Components Installation

[Optional] Delete LibreOffice & ThunderBird packages (if you don’t need) and remove the unnecessary packages to increase the free space. To do this, type these commands to the DSBOARD-XV2 side:


sudo apt remove -y libreoffice* thunderbird*
sudo apt autoremove -y
sudo apt clean


Connect the DSBOARD-XV2 to the Ethernet. Then, open the NVIDIA SDK Manager. Select “JetPack 5.0.2” for Target Operating System and “Jetson AGX Xavier modules” for Target Hardware (The “Host Machine” components are not required). Then, continue to Step 2.


Choose only “Jetson SDK Components”, accept the terms & conditions and continue to Step 3.


The SDK Manager will ask the username’s password. Fill it and continue.


Type the IP address, username and password of DSBOARD-XV2 and install the SDK Components.


At the end of the installation, the DSBOARD-XV2 becomes ready. 



Thank you for reading our blog post.