Ubuntu 20.04 for NVIDIA¶
NVIDIA Jetpack 4.x is based on Ubuntu 18.04, and it’s inconvenient when we want to use Ubuntu 20.04. For example, the LTS of ROS 1 noetic and ROS 2 foxy only support Ubuntu 20.04. There are many NVIDIA and ROS users struggling with the problem. Before NVIDIA Jetpack 5, which is Ubuntu 20.04, is released, docker container is a good solution to the issue.
However, there are too many tricky settings to run container on NVIDIA platform, especially when you want to use CUDA. To simplify the usage, ADLINK provides the following guide to install containers.
Flash the image¶
Download Jetpack 4.6 from ADLINK official website and flash the ROScube. Follow the tutorial based on your ROScube platform:
ROScube-X: https://adlink-ros.github.io/roscube-doc/roscube-x/flash_image/flash_mfi.html
ROScube-Pico (board level): https://adlink-ros.github.io/roscube-doc/roscube-pico/flash_image/board_level_flash.html
ROScube-Pico (system level): https://adlink-ros.github.io/roscube-doc/roscube-pico/flash_image/system_level_flash.html
Extend the storage¶
The default storage of NVIDIA SOM is not enough (especially for ROScube-Pico), it’s highly recommended to extend your storage with SD card / NVMe.
Please refer to Mount rootfs on External Storage to extend your storage.
Install CUDA library¶
Although we use the container, we still need to install the CUDA library on the native host. Then share the CUDA library with the container.
sudo apt update
sudo apt install nvidia-cuda nvidia-l4t-cuda
Install necessary packages in the container¶
Since NVIDIA CUDA from Jetpack 4.6 has some limitation to run in Ubuntu 20.04 container, we still need to do the following settings in your container.
# CUDA 10.2 only supports gcc8 and g++8
sudo apt update
sudo apt install gcc-8 g++-8
sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-8 8
sudo update-alternatives --install /usr/bin/g++ g++ /usr/bin/g++-8 8
# Install libcudnn8-dev
sudo apt install libcudnn8-dev
Run YOLO Object Detection example¶
Now it works! You can try the YOLO Object Detection example now.