This repo provides a minimal working example of an NVIDIA GPU enabled ROS Noetic container.
Ensure the following are installed on your host. Instructions may vary depending on your host OS.
- Docker.
- NVIDIA drivers.
- NVIDIA Container Toolkit
So far this only been tested on Linux machines.
-
Build the image. By default the example targets the name
hf/nvidia-ros-noetic
.docker build -t hf/nvidia-ros-noetic .
-
Edit
.env
environment variable definitions as needed. For example, if the built image has the nameuser/example-image
, change:IMAGE=hf/nvidia-ros-noetic
to:
IMAGE=user/example-image
By default, this repo's
data
folder is mounted in thebag
andrviz
containers under/host
.bag
will look for a rosbag file namedtest.bag
in there to play. -
Start the containers, either via the example
compose-up
file:./compose-up
or manually, targeting
docker-compose.yaml
:docker-compose --env-file .env up
Additional configuration for GUIs may be needed depending on your configuration. The ROS tutorial here may be a good place to start.
Because I'm "lazy and reckless", I have simply adjusted the permissions for the X server host in
compose-up
prior to launching, reverting when done. Generally, this isn't a good idea.