Logbook:Jetson Setup - UW-Advanced-Robotics-Lab/lab-wiki GitHub Wiki
[Last generated: Wed 4 Oct 2023 15:34:19 EDT]
>
📓 TAG: jetson_35.1, the public release DOES NOT HAVE RT KERNEL, SAD!!
- So you have to compile from source:
-
Compile custom kernel:
-
In your browser, go to https://developer.nvidia.com/embedded/jetson-linux-archive.
-
Locate and download the Jetson Linux source files for your release.
-
Extract the
.tbz2
file:$ tar -xjf public_sources.tbz2
-
Extract the kernel source file:
$ cd Linux_for_Tegra/source/public $ export TEGRA=$HOME/{somewhere}/Linux_for_Tegra/source/public $ tar –xjf kernel_src.tbz2
This extracts the kernel source to the
kernel/
subdirectory. -
Apply RT Kernel:
$ cd $TEGRA/kernel $ ./kernel-5.10/scripts/rt-patch.sh apply-patches ### OUTPUT: #> The PREEMPT RT patches have been successfully applied!
-
🚫(ON NON-Jetson PC) Cross Compile:
$ export CROSS_COMPILE_AARCH64_PATH=<toolchain-path> $ export CROSS_COMPILE_AARCH64=<toolchain-path>/bin/aarch64-buildroot-linux-gnu-
-
Kernel out:
$ cd {somewhere}/kernel_out $ export kernel_out={somewhere}/kernel_out
-
Build:
$ cd $TEGRA && ./nvbuild.sh -o $kernel_out
-
-
Apply built to the root:
-
Replace
/boot/Image
with a copy of this file:# a copy backup: $ sudo mv /boot/kernel/Image /boot/kernel/Image.bak.non-rt # override: $ sudo cp $kernel_out/arch/arm64/boot/Image /boot/kernel/Image
-
Reboot:
$ sudo reboot 0
-
-
Compile PCAN with this custom rt-kernel:
# download driver: $ wget https://www.peak-system.com/fileadmin/media/linux/files/peak-linux-driver-8.15.2.tar.gz # unzip: $ tar -xzf peak-linux-driver-8.15.2.tar.gz # define sth: $ export kernel_out=/home/uwarl-orin/JX_Linux/kernel_out # build driver with netdev and specified kernel: # doesnt work: $ make -C driver NET=NETDEV_SUPPORT KERNEL_LOCATION=$kernel_out $ make NET=NETDEV_SUPPORT KERNEL_LOCATION=$kernel_out # install: $ make install KERNEL_LOCATION=$kernel_out # GUCCI
⚠️ NETDEV support is needed for WAM⚠️ Kernel location should be the compiled kernel output with RT-kernel, the/usr/src
does not contain rt-kernel with custom build -
To set up an NVMe drive manually for booting
-
For this method, confirm that the device can boot successfully from eMMC. If it cannot, correct the problem by flashing to eMMC first.
-
Connect the NVMe drive to the host computer.
-
Check the NVMe drive’s device name (e.g. /dev/nvme0n1):
$ lsblk -d -p | grep nvme | cut -d\ -f 1
Note that there must be two spaces after the ‑d.
-
Create a new GPT
$ sudo parted /dev/nvme0n1 mklabel gpt
-
Create Partition:
$ sudo parted /dev/nvme0n1 mkpart APP 0GB 500GB
-
Format APP as an ext4 partition and mount it.
$ sudo mkfs.ext4 /dev/nvme0n1p1 $ sudo mount /dev/nvme0n1p1 /mnt
-
-
Flash to NVMe on Jetson from Host PC:
$ cd $TEGRA $ sudo BOOTDEV=nvme0n1p1 ./flash.sh jetson-agx-orin-devkit nvme0n1p1 ### #$ sudo mkdir tmp_system #$ sudo mount bootloader/system.img.raw ./tmp_system #$ sudo rsync -axHAWX --numeric-ids --info=progress2 --exclude=/proc ./tmp_system/ /mnt
-
Boot Computer and enter BIO with [ESC] at boot screen
- configure boot order to the
nvme
overemmc
- configure boot order to the
-
[WHACKY ALERT] $kernel_out is actually part of the kernel headers , so I just copy over to the header and renamed the original header to contain rt
$TEGRA/rootfs/usr/src/linux-headers-5.10.104-rt63-tegra-ubuntu20.04_aarch64/kernel-5.10
-
XFCE XRDP: https://www.hiroom2.com/ubuntu-2004-xrdp-xfce-en/
- install zsh first
sudo apt install zsh
- https://github.com/ohmyzsh/ohmyzsh
- https://linuxize.com/post/getting-started-with-tmux/
- Pretty/Easy-to-use Custom Mod: https://www.hamvocke.com/blog/a-guide-to-customizing-your-tmux-conf/ (except ctrl-b mod)
- Wiki - Jetson ZOO: guide to everything that has to be installed manually, add-on packages on NVIDIA Jetson
Jetson AGX Orin delivers a 3-6X performance gain over Jetson AGX Xavier. 1.5-2X boost for the CPU, 4X GPU cores --> 3-10X Boost comparing to Xavier
-
Docs/Jetson/DeveloperGuide
- Bootloader and NVMe
- Jetson Linux Real-Time Kernel Package
- Ubuntu 20.04 , 12 core, 32MB DDR5 Memory
⚠️ You do not need this step anymore, with latest SDK, you can install directly onto NVMe, instead of this wacky setup
- Partition NVMe into swap / boot / filesystems
- setup for direct booting: https://jetsonhacks.com/2020/05/29/jetson-xavier-nx-run-from-ssd/
⚠️ To upgrade OS, you need to copy from ssd/boot to emmc/boot:sudo mount /dev/mmcblk0p1 /mnt cp -r /boot/* /mnt/boot/
- Because, the system boot from emmc and is directed to nvme by service, hence, local modification of boot on nvme would not affect the OS at all. Hence a reverse sync by copying over is required.
- https://developer.ridgerun.com/wiki/index.php/NVIDIA_Jetson_Orin/JetPack_5.0.2/Compiling_Code/Kernel
- To install Jetson Ubuntu, we need to use SDK Manager on a Desktop with Ubuntu 18.04 (20.04 does not support SDK installation, SAD)
- a nicely script made by jetsonhacks: https://github.com/jetsonhacks/installROS
sudo apt install libopencv-dev=3.2.0+dfsg-4ubuntu0.1
rosdep install --from-paths src --ignore-src --rosdistro=melodic -y
sudo apt-get install ros-melodic-trac-ik
- install numpy, scikit-image, scikit-learn: https://forums.developer.nvidia.com/t/how-to-install-numpy-scikit-image-scikit-learn-on-jetson-tx2/83819
- install opencv: https://qengineering.eu/install-opencv-4.5-on-jetson-nano.html
- please install the python packages and opencv in the way mentioned in previous section
- https://www.stereolabs.com/docs/installation/jetson/
- build zed_ros_wrapper: https://www.stereolabs.com/docs/ros/
⚠️ actual IP may depend on the configuration, but here is our config:
#export ROS_MASTER_URI=http://192.168.0.178:11311
export ROS_MASTER_URI=http://192.168.0.200:11311/
export ROS_IP=192.168.0.150
#export ROS_HOSTNAME=192.168.0.150