├── images ├── u20-foxy-noDocker-Desktop.png ├── u20-humble-Docker-Desktop.png ├── u20-foxy-noDocker-noDesktop.png ├── u20-humble-Docker-noDesktop.png └── u20-GUI-temporary-disable-terminal.png ├── README.md └── docs ├── u20-foxy-noDocker-Desktop.md ├── u20-humble-Docker-Desktop.md ├── u20-foxy-noDocker-noDesktop.md └── u20-humble-Docker-noDesktop.md /images/u20-foxy-noDocker-Desktop.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CollaborativeRoboticsLab/JetsonNano-ROS2/HEAD/images/u20-foxy-noDocker-Desktop.png -------------------------------------------------------------------------------- /images/u20-humble-Docker-Desktop.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CollaborativeRoboticsLab/JetsonNano-ROS2/HEAD/images/u20-humble-Docker-Desktop.png -------------------------------------------------------------------------------- /images/u20-foxy-noDocker-noDesktop.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CollaborativeRoboticsLab/JetsonNano-ROS2/HEAD/images/u20-foxy-noDocker-noDesktop.png -------------------------------------------------------------------------------- /images/u20-humble-Docker-noDesktop.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CollaborativeRoboticsLab/JetsonNano-ROS2/HEAD/images/u20-humble-Docker-noDesktop.png -------------------------------------------------------------------------------- /images/u20-GUI-temporary-disable-terminal.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CollaborativeRoboticsLab/JetsonNano-ROS2/HEAD/images/u20-GUI-temporary-disable-terminal.png -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # JetsonNano-ROS2 2 | A comprehensive guide on setting up JetsonNano with ROS2 3 | 4 | ## Setup 5 | 6 | - Jetson Nano can be generally powered from a micro usb power supply (5V 2A 10W max). This can manage a keyboard, a mouse and a small camera. 7 | - If planned use case for Jetson Nano is to run Neural Networks along with Depth cameras, it is better to power the device via the DC barrel jack (5V 4A 20W max). 8 | - System setup comparison section contains various combinations of Ubuntu and ROS2 that was tested with and without GUI, and with and without docker. 9 | - Main purpose was to identify the stable combination that allows for the latest ROS version to be used as well as get the maximum output from the Jetson Nano. 10 | 11 |
12 | 13 | ## Recommneded Installation 14 | 15 | - Follow the guidelines in [Install Docker engine](https://docs.docker.com/engine/install/ubuntu/) to update the preinstalled docker version. 16 | 17 |
18 | 19 | ## System setup comparison 20 | 21 | - GUI column represents whether a GUI is available or not. No GUI was achieved by removing all the GUI related components. Please refer relevant tutorials for the steps. 22 | 23 | - Idle RAM has been measured as it determines the Neural Netork model sizes that can be loaded into the device. 24 | 25 | - In the combinations that has Docker, the Idle RAM has been measured while the Base ROS Docker image is running. 26 | 27 | - Only the provided overclocking settings was used, but further customization can be done according to [here](https://qengineering.eu/overclocking-the-jetson-nano.html) 28 | 29 | - Docker ROS-Humble-ROS-Base can be installed with, 30 | 31 | ```bash 32 | docker pull dustynv/ros:humble-ros-base-l4t-r32.7.1 33 | ``` 34 | 35 |
36 | 37 | | Ubuntu | Jetpack | CUDA | ROS | GUI | Docker | CPU / GPU Frequency | Idle RAM (GB) | Tutorial | 38 | |--- |:---:|:---:|:---:|:---:|:---:|:---:|:---:|:---:| 39 | | [20.04](https://github.com/Qengineering/Jetson-Nano-Ubuntu-20-image?tab=readme-ov-file#bare-image) | 4.6.2 | 10.2 |[Humble](https://hub.docker.com/layers/dustynv/ros/humble-ros-base-l4t-r32.7.1/images/sha256-833447d4c81735c71cd61587b9cd61275cf7158f44bec074a135e6f3e662187a?context=explore) | Yes | Yes | 1900Mz / 998Mz | 1.3 / 3.9 | [Image](/images/u20-humble-Docker-Desktop.png) [Tutorial](/docs/u20-humble-Docker-Desktop.md) | 40 | | [20.04](https://github.com/Qengineering/Jetson-Nano-Ubuntu-20-image?tab=readme-ov-file#bare-image) | 4.6.2 | 10.2 |[Humble](https://hub.docker.com/layers/dustynv/ros/humble-ros-base-l4t-r32.7.1/images/sha256-833447d4c81735c71cd61587b9cd61275cf7158f44bec074a135e6f3e662187a?context=explore) | No | Yes | 1900Mz / 998Mz | 0.44 / 3.9 | [Image](/images/u20-humble-Docker-noDesktop.png) [Tutorial](/docs/u20-humble-Docker-noDesktop.md) | 41 | | [20.04](https://github.com/Qengineering/Jetson-Nano-Ubuntu-20-image?tab=readme-ov-file#bare-image) | 4.6.2 | 10.2 |Foxy | Yes | No | 1900Mz / 998Mz | 1.2 / 3.9 | [Image](/images/u20-foxy-noDocker-Desktop.png) [Tutorial](/docs/u20-foxy-noDocker-Desktop.md) | 42 | | [20.04](https://github.com/Qengineering/Jetson-Nano-Ubuntu-20-image?tab=readme-ov-file#bare-image) | 4.6.2 | 10.2 |Foxy | No | No | 1900Mz / 998Mz | 0.40 / 3.9 | [Image](/images/u20-foxy-noDocker-noDesktop.png) [Tutorial](/docs/u20-foxy-noDocker-noDesktop.md) | 43 | | [18.04](https://developer.nvidia.com/embedded/learn/get-started-jetson-nano-devkit#write)| 4.6.4 | 10.2 | [Humble](https://hub.docker.com/layers/dustynv/ros/humble-ros-base-l4t-r32.7.1/images/sha256-833447d4c81735c71cd61587b9cd61275cf7158f44bec074a135e6f3e662187a?context=explore) | Yes | Yes | 1479Mz / 920Mz | Really Slow | Not Successful | [Image](/images/u18-humble-Docker-Desktop.png) [Tutorial](/docs/u18-humble-Docker-Desktop.md) | 44 | | [18.04](https://developer.nvidia.com/embedded/learn/get-started-jetson-nano-devkit#write)| 4.6.4 | 10.2 | [Humble](https://hub.docker.com/layers/dustynv/ros/humble-ros-base-l4t-r32.7.1/images/sha256-833447d4c81735c71cd61587b9cd61275cf7158f44bec074a135e6f3e662187a?context=explore) | No | Yes | 1479Mz / 920Mz | Really slow | Not Successful | 45 | 46 | 47 | ## Future Work 48 | 49 | - [ ] Disable the GUI without removing it 50 | -------------------------------------------------------------------------------- /docs/u20-foxy-noDocker-Desktop.md: -------------------------------------------------------------------------------- 1 | ## Ubuntu Installation 2 | 3 | 1. Follow the instructions [here](https://github.com/Qengineering/Jetson-Nano-Ubuntu-20-image?tab=readme-ov-file#bare-image) to download the bare Ubuntu 20.04 image for Jetson Nano. 4 | 2. Boot the SD card using the downloaded image and [balenaEtcher](https://etcher.balena.io/). 5 | 3. Insert the SD card to Jetson Nano and bootup the device. If prompted, username is 'jetson' and password is 'jetson'. 6 | 4. Login to the system and run following commands to update the system. 7 | ```bash 8 | sudo apt update 9 | ``` 10 | and 11 | ```bash 12 | sudo apt upgrade 13 | ``` 14 | 5. Add CUDA path to .bashrc. First open .bashrc 15 | ```bash 16 | gedit .bashrc 17 | ``` 18 | and add the following lines to end of the file 19 | ```bash 20 | export PATH=${PATH}:/usr/local/cuda/bin 21 | export LD_LIBRARY_PATH=${LD_LIBRARY_PATH}:/usr/local/cuda/lib64 22 | ``` 23 | 24 | 25 |
26 | 27 | ## Testing the CUDA functionality 28 | 29 | 1. Open a new Terminal to refresh the path variables. Then run, 30 | 31 | ```bash 32 | /usr/local/cuda-10.2/bin/cuda-install-samples-10.2.sh . 33 | cd NVIDIA_CUDA-10.2_Samples/ 34 | ``` 35 | 36 | 2. Build the examples by running 37 | ```bash 38 | make 39 | ``` 40 | 41 | if an error pops up saying, 42 | 43 | ```bash 44 | error -- unsupported GNU version! gcc versions later than 8 are not supported! 45 | ``` 46 | run 47 | 48 | ```bash 49 | make HOST_COMPILER=/usr/bin/g++-7 50 | ``` 51 | 3. Run the following command to test 52 | ```bash 53 | ./bin/aarch64/linux/release/deviceQuery 54 | ``` 55 | and output should be similar to the following 56 | ```bash 57 | ./bin/aarch64/linux/release/deviceQuery Starting... 58 | 59 | CUDA Device Query (Runtime API) version (CUDART static linking) 60 | 61 | Detected 1 CUDA Capable device(s) 62 | 63 | Device 0: "NVIDIA Tegra X1" 64 | CUDA Driver Version / Runtime Version 10.2 / 10.2 65 | CUDA Capability Major/Minor version number: 5.3 66 | Total amount of global memory: 3964 MBytes (4156399616 bytes) 67 | ( 1) Multiprocessors, (128) CUDA Cores/MP: 128 CUDA Cores 68 | GPU Max Clock rate: 998 MHz (1.00 GHz) 69 | Memory Clock rate: 13 Mhz 70 | Memory Bus Width: 64-bit 71 | L2 Cache Size: 262144 bytes 72 | Maximum Texture Dimension Size (x,y,z) 1D=(65536), 2D=(65536, 65536), 3D=(4096, 4096, 4096) 73 | Maximum Layered 1D Texture Size, (num) layers 1D=(16384), 2048 layers 74 | Maximum Layered 2D Texture Size, (num) layers 2D=(16384, 16384), 2048 layers 75 | Total amount of constant memory: 65536 bytes 76 | Total amount of shared memory per block: 49152 bytes 77 | Total number of registers available per block: 32768 78 | Warp size: 32 79 | Maximum number of threads per multiprocessor: 2048 80 | Maximum number of threads per block: 1024 81 | Max dimension size of a thread block (x,y,z): (1024, 1024, 64) 82 | Max dimension size of a grid size (x,y,z): (2147483647, 65535, 65535) 83 | Maximum memory pitch: 2147483647 bytes 84 | Texture alignment: 512 bytes 85 | Concurrent copy and kernel execution: Yes with 1 copy engine(s) 86 | Run time limit on kernels: Yes 87 | Integrated GPU sharing Host Memory: Yes 88 | Support host page-locked memory mapping: Yes 89 | Alignment requirement for Surfaces: Yes 90 | Device has ECC support: Disabled 91 | Device supports Unified Addressing (UVA): Yes 92 | Device supports Compute Preemption: No 93 | Supports Cooperative Kernel Launch: No 94 | Supports MultiDevice Co-op Kernel Launch: No 95 | Device PCI Domain ID / Bus ID / location ID: 0 / 0 / 0 96 | Compute Mode: 97 | < Default (multiple host threads can use ::cudaSetDevice() with device simultaneously) > 98 | 99 | deviceQuery, CUDA Driver = CUDART, CUDA Driver Version = 10.2, CUDA Runtime Version = 10.2, NumDevs = 1 100 | Result = PASS 101 | ``` 102 | 103 |
104 | 105 | ## ROS Installation 106 | 107 | 1. Install ROS 2 Foxy ROS Base (Bare Bones Installation) following instructions [here](https://docs.ros.org/en/foxy/Installation/Ubuntu-Install-Debians.html) 108 | 109 | 2. Then in the terminal run, 110 | 111 | ```bash 112 | echo "source /opt/ros/foxy/setup.bash" >> ~/.bashrc 113 | ``` -------------------------------------------------------------------------------- /docs/u20-humble-Docker-Desktop.md: -------------------------------------------------------------------------------- 1 | ## Ubuntu Installation 2 | 3 | 1. Follow the instructions [here](https://github.com/Qengineering/Jetson-Nano-Ubuntu-20-image?tab=readme-ov-file#bare-image) to download the bare Ubuntu 20.04 image for Jetson Nano. 4 | 2. Boot the SD card using the downloaded image and [balenaEtcher](https://etcher.balena.io/). 5 | 3. Insert the SD card to Jetson Nano and bootup the device. If prompted, username is 'jetson' and password is 'jetson'. 6 | 4. Login to the system and run following commands to update the system. 7 | ```bash 8 | sudo apt update 9 | ``` 10 | and 11 | ```bash 12 | sudo apt upgrade 13 | ``` 14 | 5. Add CUDA path to .bashrc. First open .bashrc 15 | ```bash 16 | gedit .bashrc 17 | ``` 18 | and add the following lines to end of the file 19 | ```bash 20 | export PATH=${PATH}:/usr/local/cuda/bin 21 | export LD_LIBRARY_PATH=${LD_LIBRARY_PATH}:/usr/local/cuda/lib64 22 | ``` 23 | 24 |
25 | 26 | ## Testing the CUDA functionality 27 | 28 | 1. Open a new Terminal to refresh the path variables. Then run, 29 | 30 | ```bash 31 | /usr/local/cuda-10.2/bin/cuda-install-samples-10.2.sh . 32 | cd NVIDIA_CUDA-10.2_Samples/ 33 | ``` 34 | 35 | 2. Build the examples by running 36 | ```bash 37 | make 38 | ``` 39 | 40 | if an error pops up saying, 41 | 42 | ```bash 43 | error -- unsupported GNU version! gcc versions later than 8 are not supported! 44 | ``` 45 | run 46 | 47 | ```bash 48 | make HOST_COMPILER=/usr/bin/g++-7 49 | ``` 50 | 3. Run the following command to test 51 | ```bash 52 | ./bin/aarch64/linux/release/deviceQuery 53 | ``` 54 | and output should be similar to the following 55 | ```bash 56 | ./bin/aarch64/linux/release/deviceQuery Starting... 57 | 58 | CUDA Device Query (Runtime API) version (CUDART static linking) 59 | 60 | Detected 1 CUDA Capable device(s) 61 | 62 | Device 0: "NVIDIA Tegra X1" 63 | CUDA Driver Version / Runtime Version 10.2 / 10.2 64 | CUDA Capability Major/Minor version number: 5.3 65 | Total amount of global memory: 3964 MBytes (4156399616 bytes) 66 | ( 1) Multiprocessors, (128) CUDA Cores/MP: 128 CUDA Cores 67 | GPU Max Clock rate: 998 MHz (1.00 GHz) 68 | Memory Clock rate: 13 Mhz 69 | Memory Bus Width: 64-bit 70 | L2 Cache Size: 262144 bytes 71 | Maximum Texture Dimension Size (x,y,z) 1D=(65536), 2D=(65536, 65536), 3D=(4096, 4096, 4096) 72 | Maximum Layered 1D Texture Size, (num) layers 1D=(16384), 2048 layers 73 | Maximum Layered 2D Texture Size, (num) layers 2D=(16384, 16384), 2048 layers 74 | Total amount of constant memory: 65536 bytes 75 | Total amount of shared memory per block: 49152 bytes 76 | Total number of registers available per block: 32768 77 | Warp size: 32 78 | Maximum number of threads per multiprocessor: 2048 79 | Maximum number of threads per block: 1024 80 | Max dimension size of a thread block (x,y,z): (1024, 1024, 64) 81 | Max dimension size of a grid size (x,y,z): (2147483647, 65535, 65535) 82 | Maximum memory pitch: 2147483647 bytes 83 | Texture alignment: 512 bytes 84 | Concurrent copy and kernel execution: Yes with 1 copy engine(s) 85 | Run time limit on kernels: Yes 86 | Integrated GPU sharing Host Memory: Yes 87 | Support host page-locked memory mapping: Yes 88 | Alignment requirement for Surfaces: Yes 89 | Device has ECC support: Disabled 90 | Device supports Unified Addressing (UVA): Yes 91 | Device supports Compute Preemption: No 92 | Supports Cooperative Kernel Launch: No 93 | Supports MultiDevice Co-op Kernel Launch: No 94 | Device PCI Domain ID / Bus ID / location ID: 0 / 0 / 0 95 | Compute Mode: 96 | < Default (multiple host threads can use ::cudaSetDevice() with device simultaneously) > 97 | 98 | deviceQuery, CUDA Driver = CUDART, CUDA Driver Version = 10.2, CUDA Runtime Version = 10.2, NumDevs = 1 99 | Result = PASS 100 | ``` 101 | 102 |
103 | 104 | ## ROS Installation 105 | 106 | 1. Start the ROS2 Humble ros-base docker container using the following command. For more customized containers checkout [KalanaRatnayake/Jetson-ROS-Docker](https://github.com/KalanaRatnayake/Jetson-ROS-Docker). To build your own docker images, follow instructions at [dusty-nv/jetson-containers](https://github.com/dusty-nv/jetson-containers) 107 | 108 | ```bash 109 | docker pull dustynv/ros:humble-ros-base-l4t-r32.7.1 110 | docker run --rm -it --runtime nvidia --network host --gpus all -e DISPLAY dustynv/ros:humble-ros-base-l4t-r32.7.1 111 | ``` -------------------------------------------------------------------------------- /docs/u20-foxy-noDocker-noDesktop.md: -------------------------------------------------------------------------------- 1 | ## Ubuntu Installation 2 | 3 | 1. Follow the instructions [here](https://github.com/Qengineering/Jetson-Nano-Ubuntu-20-image?tab=readme-ov-file#bare-image) to download the bare Ubuntu 20.04 image for Jetson Nano. 4 | 2. Boot the SD card using the downloaded image and [balenaEtcher](https://etcher.balena.io/). 5 | 3. Insert the SD card to Jetson Nano and bootup the device. If prompted, username is 'jetson' and password is 'jetson'. 6 | 4. Login to the system and run following commands to update the system. 7 | ```bash 8 | sudo apt update 9 | ``` 10 | and 11 | ```bash 12 | sudo apt upgrade 13 | ``` 14 | 5. Add CUDA path to .bashrc. First open .bashrc 15 | ```bash 16 | gedit .bashrc 17 | ``` 18 | and add the following lines to end of the file 19 | ```bash 20 | export PATH=${PATH}:/usr/local/cuda/bin 21 | export LD_LIBRARY_PATH=${LD_LIBRARY_PATH}:/usr/local/cuda/lib64 22 | ``` 23 | 6. Temporary disabling the GUI via Ctrl+Alt+F7 [does not free up the RAM](/images/u20-GUI-temporary-disable-terminal.png). Temporory disabling the GUI environment via GRUB did not succeed as there is no grub in arm architecture and could not figure out how to modify the boot parameters. Leaving for future.... 24 | 25 | 7. Remove Desktop environment, Display manager, Libreoffice and other GUI based stuff based on [Issue 88](https://github.com/Qengineering/Jetson-Nano-Ubuntu-20-image/issues/88) 26 | 27 | ```bash 28 | sudo chown root:root / /lib 29 | sudo apt purge ubuntu-desktop -y && sudo apt autoremove -y && sudo apt autoclean 30 | sudo apt-get remove nautilus nautilus-* gnome-power-manager gnome-screensaver gnome-termina* gnome-pane* 31 | sudo apt-get remove gnome-applet* gnome-bluetooth gnome-desktop* gnome-sessio* gnome-user* gnome-shell-common 32 | sudo apt-get remove zeitgeist-core libzeitgeist* gnome-control-center gnome-screenshot && sudo apt-get autoremove 33 | sudo apt-get remove --purge libreoffice* 34 | sudo apt-get remove libreoffice-core 35 | sudo apt-get remove snapd lightdm cups chromium* 36 | ``` 37 | 38 | 39 |
40 | 41 | ## Testing the CUDA functionality 42 | 43 | 1. Open a new Terminal to refresh the path variables. Then run, 44 | 45 | ```bash 46 | /usr/local/cuda-10.2/bin/cuda-install-samples-10.2.sh . 47 | cd NVIDIA_CUDA-10.2_Samples/ 48 | ``` 49 | 50 | 2. Build the examples by running 51 | ```bash 52 | make 53 | ``` 54 | 55 | if an error pops up saying, 56 | 57 | ```bash 58 | error -- unsupported GNU version! gcc versions later than 8 are not supported! 59 | ``` 60 | run 61 | 62 | ```bash 63 | make HOST_COMPILER=/usr/bin/g++-7 64 | ``` 65 | 3. Run the following command to test 66 | ```bash 67 | ./bin/aarch64/linux/release/deviceQuery 68 | ``` 69 | and output should be similar to the following 70 | ```bash 71 | ./bin/aarch64/linux/release/deviceQuery Starting... 72 | 73 | CUDA Device Query (Runtime API) version (CUDART static linking) 74 | 75 | Detected 1 CUDA Capable device(s) 76 | 77 | Device 0: "NVIDIA Tegra X1" 78 | CUDA Driver Version / Runtime Version 10.2 / 10.2 79 | CUDA Capability Major/Minor version number: 5.3 80 | Total amount of global memory: 3964 MBytes (4156399616 bytes) 81 | ( 1) Multiprocessors, (128) CUDA Cores/MP: 128 CUDA Cores 82 | GPU Max Clock rate: 998 MHz (1.00 GHz) 83 | Memory Clock rate: 13 Mhz 84 | Memory Bus Width: 64-bit 85 | L2 Cache Size: 262144 bytes 86 | Maximum Texture Dimension Size (x,y,z) 1D=(65536), 2D=(65536, 65536), 3D=(4096, 4096, 4096) 87 | Maximum Layered 1D Texture Size, (num) layers 1D=(16384), 2048 layers 88 | Maximum Layered 2D Texture Size, (num) layers 2D=(16384, 16384), 2048 layers 89 | Total amount of constant memory: 65536 bytes 90 | Total amount of shared memory per block: 49152 bytes 91 | Total number of registers available per block: 32768 92 | Warp size: 32 93 | Maximum number of threads per multiprocessor: 2048 94 | Maximum number of threads per block: 1024 95 | Max dimension size of a thread block (x,y,z): (1024, 1024, 64) 96 | Max dimension size of a grid size (x,y,z): (2147483647, 65535, 65535) 97 | Maximum memory pitch: 2147483647 bytes 98 | Texture alignment: 512 bytes 99 | Concurrent copy and kernel execution: Yes with 1 copy engine(s) 100 | Run time limit on kernels: Yes 101 | Integrated GPU sharing Host Memory: Yes 102 | Support host page-locked memory mapping: Yes 103 | Alignment requirement for Surfaces: Yes 104 | Device has ECC support: Disabled 105 | Device supports Unified Addressing (UVA): Yes 106 | Device supports Compute Preemption: No 107 | Supports Cooperative Kernel Launch: No 108 | Supports MultiDevice Co-op Kernel Launch: No 109 | Device PCI Domain ID / Bus ID / location ID: 0 / 0 / 0 110 | Compute Mode: 111 | < Default (multiple host threads can use ::cudaSetDevice() with device simultaneously) > 112 | 113 | deviceQuery, CUDA Driver = CUDART, CUDA Driver Version = 10.2, CUDA Runtime Version = 10.2, NumDevs = 1 114 | Result = PASS 115 | ``` 116 | 117 |
118 | 119 | ## ROS Installation 120 | 121 | 1. Install ROS 2 Foxy ROS Base (Bare Bones Installation) following instructions [here](https://docs.ros.org/en/foxy/Installation/Ubuntu-Install-Debians.html) 122 | 123 | 2. Then in the terminal run, 124 | 125 | ```bash 126 | echo "source /opt/ros/foxy/setup.bash" >> ~/.bashrc 127 | ``` -------------------------------------------------------------------------------- /docs/u20-humble-Docker-noDesktop.md: -------------------------------------------------------------------------------- 1 | ## Ubuntu Installation 2 | 3 | 1. Follow the instructions [here](https://github.com/Qengineering/Jetson-Nano-Ubuntu-20-image?tab=readme-ov-file#bare-image) to download the bare Ubuntu 20.04 image for Jetson Nano. 4 | 2. Boot the SD card using the downloaded image and [balenaEtcher](https://etcher.balena.io/). 5 | 3. Insert the SD card to Jetson Nano and bootup the device. If prompted, username is 'jetson' and password is 'jetson'. 6 | 4. Login to the system and run following commands to update the system. 7 | ```bash 8 | sudo apt update 9 | ``` 10 | and 11 | ```bash 12 | sudo apt upgrade 13 | ``` 14 | 5. Add CUDA path to .bashrc. First open .bashrc 15 | ```bash 16 | gedit .bashrc 17 | ``` 18 | and add the following lines to end of the file 19 | ```bash 20 | export PATH=${PATH}:/usr/local/cuda/bin 21 | export LD_LIBRARY_PATH=${LD_LIBRARY_PATH}:/usr/local/cuda/lib64 22 | ``` 23 | 24 | 6. Temporary disabling the GUI via Ctrl+Alt+F7 [does not free up the RAM](/images/u20-GUI-temporary-disable-terminal.png). Temporory disabling the GUI environment via GRUB did not succeed as there is no grub in arm architecture and could not figure out how to modify the boot parameters. Leaving for future.... 25 | 26 | 7. Remove Desktop environment, Display manager, Libreoffice and other GUI based stuff based on [Issue 88](https://github.com/Qengineering/Jetson-Nano-Ubuntu-20-image/issues/88) 27 | 28 | ```bash 29 | sudo chown root:root / /lib 30 | sudo apt purge ubuntu-desktop -y && sudo apt autoremove -y && sudo apt autoclean 31 | sudo apt-get remove nautilus nautilus-* gnome-power-manager gnome-screensaver gnome-termina* gnome-pane* 32 | sudo apt-get remove gnome-applet* gnome-bluetooth gnome-desktop* gnome-sessio* gnome-user* gnome-shell-common 33 | sudo apt-get remove zeitgeist-core libzeitgeist* gnome-control-center gnome-screenshot && sudo apt-get autoremove 34 | sudo apt-get remove --purge libreoffice* 35 | sudo apt-get remove libreoffice-core 36 | sudo apt-get remove snapd lightdm cups chromium* 37 | ``` 38 | 39 | 40 |
41 | 42 | ## Testing the CUDA functionality 43 | 44 | 1. Open a new Terminal to refresh the path variables. Then run, 45 | 46 | ```bash 47 | /usr/local/cuda-10.2/bin/cuda-install-samples-10.2.sh . 48 | cd NVIDIA_CUDA-10.2_Samples/ 49 | ``` 50 | 51 | 2. Build the examples by running 52 | ```bash 53 | make 54 | ``` 55 | 56 | if an error pops up saying, 57 | 58 | ```bash 59 | error -- unsupported GNU version! gcc versions later than 8 are not supported! 60 | ``` 61 | run 62 | 63 | ```bash 64 | make HOST_COMPILER=/usr/bin/g++-7 65 | ``` 66 | 3. Run the following command to test 67 | ```bash 68 | ./bin/aarch64/linux/release/deviceQuery 69 | ``` 70 | and output should be similar to the following 71 | ```bash 72 | ./bin/aarch64/linux/release/deviceQuery Starting... 73 | 74 | CUDA Device Query (Runtime API) version (CUDART static linking) 75 | 76 | Detected 1 CUDA Capable device(s) 77 | 78 | Device 0: "NVIDIA Tegra X1" 79 | CUDA Driver Version / Runtime Version 10.2 / 10.2 80 | CUDA Capability Major/Minor version number: 5.3 81 | Total amount of global memory: 3964 MBytes (4156399616 bytes) 82 | ( 1) Multiprocessors, (128) CUDA Cores/MP: 128 CUDA Cores 83 | GPU Max Clock rate: 998 MHz (1.00 GHz) 84 | Memory Clock rate: 13 Mhz 85 | Memory Bus Width: 64-bit 86 | L2 Cache Size: 262144 bytes 87 | Maximum Texture Dimension Size (x,y,z) 1D=(65536), 2D=(65536, 65536), 3D=(4096, 4096, 4096) 88 | Maximum Layered 1D Texture Size, (num) layers 1D=(16384), 2048 layers 89 | Maximum Layered 2D Texture Size, (num) layers 2D=(16384, 16384), 2048 layers 90 | Total amount of constant memory: 65536 bytes 91 | Total amount of shared memory per block: 49152 bytes 92 | Total number of registers available per block: 32768 93 | Warp size: 32 94 | Maximum number of threads per multiprocessor: 2048 95 | Maximum number of threads per block: 1024 96 | Max dimension size of a thread block (x,y,z): (1024, 1024, 64) 97 | Max dimension size of a grid size (x,y,z): (2147483647, 65535, 65535) 98 | Maximum memory pitch: 2147483647 bytes 99 | Texture alignment: 512 bytes 100 | Concurrent copy and kernel execution: Yes with 1 copy engine(s) 101 | Run time limit on kernels: Yes 102 | Integrated GPU sharing Host Memory: Yes 103 | Support host page-locked memory mapping: Yes 104 | Alignment requirement for Surfaces: Yes 105 | Device has ECC support: Disabled 106 | Device supports Unified Addressing (UVA): Yes 107 | Device supports Compute Preemption: No 108 | Supports Cooperative Kernel Launch: No 109 | Supports MultiDevice Co-op Kernel Launch: No 110 | Device PCI Domain ID / Bus ID / location ID: 0 / 0 / 0 111 | Compute Mode: 112 | < Default (multiple host threads can use ::cudaSetDevice() with device simultaneously) > 113 | 114 | deviceQuery, CUDA Driver = CUDART, CUDA Driver Version = 10.2, CUDA Runtime Version = 10.2, NumDevs = 1 115 | Result = PASS 116 | ``` 117 | 118 |
119 | 120 | ## ROS Installation 121 | 122 | 1. Start the ROS2 Humble ros-base docker container using the following command. For more customized containers checkout [KalanaRatnayake/Jetson-ROS-Docker](https://github.com/KalanaRatnayake/Jetson-ROS-Docker). To build your own docker images, follow instructions at [dusty-nv/jetson-containers](https://github.com/dusty-nv/jetson-containers) 123 | 124 | ```bash 125 | docker pull dustynv/ros:humble-ros-base-l4t-r32.7.1 126 | docker run --rm -it --runtime nvidia --network host --gpus all -e DISPLAY dustynv/ros:humble-ros-base-l4t-r32.7.1 127 | ``` --------------------------------------------------------------------------------