|
| 1 | +Ubuntu 20.04 for NVIDIA |
| 2 | +####################### |
| 3 | + |
| 4 | +NVIDIA Jetpack 4.x is based on Ubuntu 18.04, and it's inconvenient when we want to use Ubuntu 20.04. |
| 5 | +For example, the LTS of ROS 1 noetic and ROS 2 foxy only support Ubuntu 20.04. |
| 6 | +There are many NVIDIA and ROS users struggling with the problem. |
| 7 | +Before NVIDIA Jetpack 5, which is Ubuntu 20.04, is released, |
| 8 | +docker container is a good solution to the issue. |
| 9 | + |
| 10 | +However, there are too many tricky settings to run container on NVIDIA platform, especially when you want to use CUDA. |
| 11 | +To simplify the usage, ADLINK provides the following guide to install containers. |
| 12 | + |
| 13 | +Flash the image |
| 14 | +--------------- |
| 15 | + |
| 16 | +Download Jetpack 4.6 from ADLINK official website and flash the ROScube. |
| 17 | +Follow the tutorial based on your ROScube platform: |
| 18 | + |
| 19 | +* ROScube-X: https://adlink-ros.github.io/roscube-doc/roscube-x/flash_image/flash_mfi.html |
| 20 | +* ROScube-Pico (board level): https://adlink-ros.github.io/roscube-doc/roscube-pico/flash_image/board_level_flash.html |
| 21 | +* ROScube-Pico (system level): https://adlink-ros.github.io/roscube-doc/roscube-pico/flash_image/system_level_flash.html |
| 22 | + |
| 23 | +Extend the storage |
| 24 | +------------------ |
| 25 | + |
| 26 | +The default storage of NVIDIA SOM is not enough (especially for ROScube-Pico), |
| 27 | +it's highly recommended to extend your storage with SD card / NVMe. |
| 28 | + |
| 29 | +Please refer to `Mount rootfs on External Storage <https://adlink-ros.github.io/roscube-doc/roscube-pico/nvidia/advanced/mount_on_external_storage/index.html>`_ to extend your storage. |
| 30 | + |
| 31 | +Install CUDA library |
| 32 | +-------------------- |
| 33 | + |
| 34 | +Although we use the container, we still need to install the CUDA library on the native host. |
| 35 | +Then share the CUDA library with the container. |
| 36 | + |
| 37 | +.. code-block:: bash |
| 38 | +
|
| 39 | + sudo apt update |
| 40 | + sudo apt install nvidia-cuda nvidia-l4t-cuda |
| 41 | +
|
| 42 | +Install Neuron Startup Menu |
| 43 | +--------------------------- |
| 44 | + |
| 45 | +ADLINK provides the docker image with ROS/ROS2 environment inside. |
| 46 | +You can use the image by installing Neuron Startup Menu. |
| 47 | + |
| 48 | +.. code-block:: bash |
| 49 | +
|
| 50 | + sh -c "MENU_CONFIG=ros_menu_20.04_container.yaml USE_CONTAINER=True $(curl -fsSL https://raw.githubusercontent.com/Adlink-ROS/ros_menu/main/scripts/setup.sh)" |
| 51 | +
|
| 52 | +Set the docker privilege |
| 53 | + |
| 54 | +.. code-block:: bash |
| 55 | +
|
| 56 | + sudo apt install docker.io |
| 57 | + sudo groupadd docker |
| 58 | + sudo gpasswd -a $USER docker |
| 59 | + sudo reboot |
| 60 | +
|
| 61 | +When you open a new terminal, it'll show which kind of envrionment you want to run. |
| 62 | +For more information, refer to `Neuron Startup Menu <https://adlink-ros.github.io/roscube-doc/neuronsdk/neuron_startup_menu/installation.html>`_. |
| 63 | + |
| 64 | +Install necessary packages for the container |
| 65 | +-------------------------------------------- |
| 66 | + |
| 67 | +Since NVIDIA CUDA from Jetpack 4.6 has some limitation to run in Ubuntu 20.04 container, |
| 68 | +we still need to do the following settings. |
| 69 | + |
| 70 | +.. code-block:: bash |
| 71 | +
|
| 72 | + # CUDA 10.2 only supports gcc8 and g++8 |
| 73 | + sudo apt update |
| 74 | + sudo apt install gcc-8 g++-8 |
| 75 | + sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-8 8 |
| 76 | + sudo update-alternatives --install /usr/bin/g++ g++ /usr/bin/g++-8 8 |
| 77 | + # Install libcudnn8-dev |
| 78 | + sudo apt install libcudnn8-dev |
| 79 | +
|
| 80 | +Run YOLO Object Detection example |
| 81 | +--------------------------------- |
| 82 | + |
| 83 | +Now it works! You can try the `YOLO Object Detection example <https://adlink-ros.github.io/roscube-doc/roscube-pico/nvidia/packages/jetpack_sdk/jetpack_sdk_yolo.html>`_ now. |
0 commit comments