This repository provides scripts to build Docker images combining ROS (Robot Operating System) and NVIDIA CUDA for GPU acceleration based on Ubuntu images. You can use pre-built images from DockerHub or build your own combinations.
Some images are available pre-built on DockerHub:
docker pull annazabnus/ros-cuda:{<X.Y>}{-<ros_distro>}
Example:
docker pull annazabnus/ros-cuda:12.6-jazzy
Below is a complete list of pre-built ROS and CUDA versions. Only the listed ROS distributions are supported at the moment.
noetic
: 11.4, 11.8, 12.0, 12.2, 12.4, 12.6, 12.8humble
: 11.8, 12.0, 12.2, 12.4, 12.6, 12.8jazzy
: 12.6, 12.8
- Docker: Version 20.10+
- NVIDIA GPU Drivers: Compatible with the chosen CUDA version
- NVIDIA Container Toolkit: For GPU support in Docker
Run the provided script to build an image for your desired ROS and CUDA versions:
python3 build.py --ros <ros_distro> --cuda <cuda_version>
<ros_distro>
: ROS distribution (e.g.,noetic
,humble
,jazzy
). Leave empty or usenone
for no ROS.<cuda_version>
: CUDA version inX.Y
format (e.g.,12.4
). Usenone
to skip CUDA.
Examples:
-
Build ROS Noetic with CUDA 12.4:
./build_image.sh --ros noetic --cuda 12.4
-
Build ROS Humble while detecting the local CUDA version:
./build_image.sh --ros humble
-
Build ROS Jazzy without CUDA:
./build_image.sh --ros jazzy --cuda none
- OS: Linux (Ubuntu 20.04+ recommended)
- Docker: Version 20.10+
- Docker Buildx: Required for caching and multi-stage builds
- Python 3.8+: For helper scripts
- yq: YAML processor for bash scripts
Each image includes the following major libraries and tools:
- ROS:
ros-<distro>-desktop-full
- CUDA Toolkit: Installed via
cuda-toolkit-<version>
- Additional Tools:
python3-colcon-common-extensions
(for ROS 2)python3-catkin-tools
(for ROS 1)build-essential
,cmake
, and other development utilities
For CUDA builds, base images are dynamically pulled from the official NVIDIA DockerHub repository. The selection process:
- Ignores
runtime
andcudnn
images. - Automatically selects the latest compatible tag based on the requested CUDA version and Ubuntu release.
Feel free to submit issues or pull requests for new features, supported versions, or bug fixes.
This project is licensed under the Apache 2.0 License.