本文章适用于Jetson Orin NX 8GB版本的linux系统进行烧录。目前官方提供的Jetson Linux 36.x最高支持22.04版本的Ubuntu,由于后续需要用到ROS2,因此笔者对Jetson Linux 36.4的烧录过程进行记录。
Jetson Orin NX介绍
Jetson是Nvidia出品的用于边缘嵌入式计算的模块,目前已经有nano、orin、xavier系列的板子。其中,Jetson Orin NX采用Ampere GPU,CPU为Arm® Cortex®-A78AE,和一块LPDDR5内存,具体参数如下:
项目 | Jetson Orin NX(8GB) | Jetson Orin NX(16GB) |
AI性能 | Up to 70 (Sparse) INT8 TOPs and 35 (Dense) INT8 TOPs | up to 100 (Sparse) INT8 TOPs and 50 (Dense) INT8 TOPs |
GPU (Ampere GPU) | 1024 NVIDIA ® CUDA ® cores; 32 Tensor cores; 最大操作频率:765MHz | 1024 NVIDIA ® CUDA ® cores; 32 Tensor cores; 最大操作频率:918MHz |
深度计算加速器 (Deep Learning Accelerator) | 1x NVDLA; 最大操作频率: 610 MHz; 20TOPS each (Sparse INT8) | 2x NVDLA; 最大操作频率: 614 MHz; 20TOPS each (Sparse INT8) |
功率 | 10W | 15W | 20W可设置 | 10W | 15W | 25W可设置 |
笔者目前手头有一台Jetson Orin NX(8GB),主要分为两部分,官方的Jetson模组和创乐博的底板。Jetson Orin NX没有eMMC,但板子上可以安装M2 SSD硬盘,商家赠送了铝合金外壳,搭建好的板子如下:
Jetson Linux系统烧录
操作步骤主要参考官方安装手册,以下全程需要在Ubuntu20.04或者Ubuntu22.04上进行操作。
第一步:在Nvidia官网下载根文件系统和板级文件
第二步:创建一个文件夹,如“JetsonOrinNX”,并将刚才下载的两个包放到文件夹里面。打开终端,进入“JetsonOrinNX”文件夹目录,分别执行以下命令(中间过程需要保持网络畅通):
$ tar xf Jetson_Linux_R36.4.0_aarch64.tbz2
$ sudo tar xpf Tegra_Linux_Sample-Root-Filesystem_R36.4.0_aarch64.tbz2 -C Linux_for_Tegra/rootfs/
$ cd Linux_for_Tegra/
$ sudo ./tools/l4t_flash_prerequisites.sh
$ sudo ./apply_binaries.sh
第三步:设置Jetson Orin NX进入“Force Recovery Mode”模式,具体操作如下图,在关机状态下,将板子的REC引脚和GND引脚相连,并将OTG接口连接Ubuntu电脑,接着开机即进入“Force Recovery Mode”模式。
第四步:刷写操作系统。对于Jetson Orin NX(8GB)+M2 SSD硬盘的板子,可以直接以下代码:
$ sudo ./tools/kernel_flash/l4t_initrd_flash.sh --external-device nvme0n1p1 \
-c tools/kernel_flash/flash_l4t_t234_nvme.xml -p "-c bootloader/generic/cfg/flash_t234_qspi.xml" \
--showlogs --network usb0 jetson-orin-nano-devkit internal
附:其他格式的板子参考的代码(先从表中的Module中找到对应板子型号,之后看对应的Configuration对应的代码)
- Jetson Orin Nano Developer Kit (NVMe):
$ sudo ./tools/kernel_flash/l4t_initrd_flash.sh --external-device nvme0n1p1 \
-c tools/kernel_flash/flash_l4t_t234_nvme.xml -p "-c bootloader/generic/cfg/flash_t234_qspi.xml" \
--showlogs --network usb0 jetson-orin-nano-devkit internal
- Jetson Orin Nano Developer Kit (USB):
$ sudo ./tools/kernel_flash/l4t_initrd_flash.sh --external-device sda1 \
-c tools/kernel_flash/flash_l4t_t234_nvme.xml -p "-c bootloader/generic/cfg/flash_t234_qspi.xml" \
--showlogs --network usb0 jetson-orin-nano-devkit internal
- Jetson Orin Nano Developer Kit (SD card):
$ sudo ./tools/kernel_flash/l4t_initrd_flash.sh --external-device mmcblk0p1 \
-c tools/kernel_flash/flash_l4t_t234_nvme.xml -p "-c bootloader/generic/cfg/flash_t234_qspi.xml" \
--showlogs --network usb0 jetson-orin-nano-devkit internal
- Jetson AGX Orin Developer Kit (eMMC):
$ sudo ./flash.sh jetson-agx-orin-devkit internal
- Jetson AGX Orin Developer Kit (NVMe):
$ sudo ./tools/kernel_flash/l4t_initrd_flash.sh --external-device nvme0n1p1 \
-c tools/kernel_flash/flash_l4t_t234_nvme.xml \
--showlogs --network usb0 jetson-agx-orin-devkit external
- Jetson AGX Orin Developer Kit (USB):
$ sudo ./tools/kernel_flash/l4t_initrd_flash.sh --external-device sda1 \
-c tools/kernel_flash/flash_l4t_t234_nvme.xml \
--showlogs --network usb0 jetson-agx-orin-devkit external
- Jetson AGX Orin Developer Kit (SD card):
$ sudo ./tools/kernel_flash/l4t_initrd_flash.sh --external-device mmcblk0p1 \
-c tools/kernel_flash/flash_l4t_t234_nvme.xml \
--showlogs --network usb0 jetson-agx-orin-devkit external
Module | Module Type | Carrier Board | Configuration | Configuration Notes |
---|---|---|---|---|
Jetson Orin NX 16GB-DRAM (P3767-0000) | Production | Jetson Orin Nano reference carrier board (P3768-0000) | jetson-orin-nano-devkit | Flashes QSPI-NOR and USB/NVMe drive (only supported via l4t_initrd_flash.sh) |
Jetson Orin NX 8GB-DRAM (P3767-0001) | Production | Jetson Orin Nano reference carrier board (P3768-0000) | jetson-orin-nano-devkit | Flashes QSPI-NOR and USB/NVMe drive (only supported via l4t_initrd_flash.sh) |
Jetson Orin Nano 8GB-DRAM (P3767-0003) | Production | Jetson Orin Nano reference carrier board (P3768-0000) | jetson-orin-nano-devkit | Flashes QSPI-NOR and USB/NVMe drive (only supported via l4t_initrd_flash.sh) |
Jetson Orin Nano 4GB-DRAM (P3767-0004) | Production | Jetson Orin Nano reference carrier board (P3768-0000) | jetson-orin-nano-devkit | Flashes QSPI-NOR and USB/NVMe drive (only supported via l4t_initrd_flash.sh) |
Jetson Orin Nano 8GB-DRAM (P3767-0005) | Development | Jetson Orin Nano reference carrier board (P3768-0000) | jetson-orin-nano-devkit | Flashes QSPI-NOR and microSD Card/USB/NVMe drive (only supported via l4t_initrd_flash.sh) |
Jetson AGX Orin Dev-Kit Module (P3701-0000) | Development | Jetson AGX Orin reference carrier board (P3737-0000) | jetson-agx-orin-devkit | Flashes QSPI-NOR and eMMC |
Jetson AGX Orin 32GB-DRAM (P3701-0004) | Production | Jetson AGX Orin reference carrier board (P3737-0000) | jetson-agx-orin-devkit | Flashes QSPI-NOR and eMMC |
Jetson AGX Orin 64GB-DRAM (P3701-0005) | Production | Jetson AGX Orin reference carrier board (P3737-0000) | jetson-agx-orin-devkit | Flashes QSPI-NOR and eMMC |
Jetson AGX Orin Industrial (P3701-0008) | Production | Jetson AGX Orin reference carrier board (P3737-0000) | jetson-agx-orin-devkit-industrial | Flashes QSPI-NOR and eMMC |
安装JTOP软件
先更新一下软件源:
$ sudo apt update
$ sudo apt upgrade
安装pip3,因为最终需要用 pip3 安装,所以这一步是不可缺少的。
$ sudo apt install python3-pip
安装jtop:
$ sudo -H pip3 install -U jetson-stats
重启系统,运行 jtop :
$ jtop
安装Jetpack工具包
直接使用命令安装的方式安装:
$ sudo apt update
$ sudo apt install nvidia-jetpack -y
安装ROS2
1、设置语言,检查是否支持UTF-8
$ locale
$ sudo apt update && sudo apt install locales
$ sudo locale-gen en_US en_US.UTF-8
$ sudo update-locale LC_ALL=en_US.UTF-8 LANG=en_US.UTF-8
$ export LANG=en_US.UTF-8
2、加入ROS2 apt repository源:
$ sudo apt install software-properties-common
$ sudo add-apt-repository universe
$ sudo apt update && sudo apt install curl -y
$ sudo curl -sSL https://raw.githubusercontent.com/ros/rosdistro/master/ros.key -o /usr/share/keyrings/ros-archive-keyring.gpg
$ echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/ros-archive-keyring.gpg] http://packages.ros.org/ros2/ubuntu $(. /etc/os-release && echo $UBUNTU_CODENAME) main" | sudo tee /etc/apt/sources.list.d/ros2.list > /dev/null
3、安装ros2桌面完整版
$ sudo apt update
$ sudo apt upgrade
$ sudo apt install ros-humble-desktop-full
4、添加source文件
$ echo "source /opt/ros/humble/setup.bash" >> ~/.bashrc
$ source .bashrc
5、测试
$ ros2 run demo_nodes_cpp talker
6、安装rosdep
$ sudo rosdep init
$ rosdep update