Skip to content

Instantly share code, notes, and snippets.

@singhsegv
Last active August 20, 2025 20:42
Show Gist options
  • Save singhsegv/d933d1451a284a32f56940ca77d958ee to your computer and use it in GitHub Desktop.
Save singhsegv/d933d1451a284a32f56940ca77d958ee to your computer and use it in GitHub Desktop.
Docker and related commands to enable nvidia GPU support for containers
## Commands
```
xhost +local:
ros2 launch gazebo_ros gazebo.launch.py
// From the current directory
docker run -it --network=host --ipc=host -v $PWD/lala:/lala:rw -v /tmp/.X11-unix:/tmp/.X11-unix:rw --env=DISPLAY --gpus=all --runtime=nvidia --env="QT_X11_NO_MITSHM=1" --env="NVIDIA_VISIBLE_DEVICES=all" --env="NVIDIA_DRIVER_CAPABILITIES=all" --device=/dev/dri:/dev/dri ros_foxy_personal
docker run -it --network=host --ipc=host -v /tmp/.X11-unix:/tmp/.X11-unix:rw --env=DISPLAY --gpus=all --runtime=nvidia --env="QT_X11_NO_MITSHM=1" --env="NVIDIA_VISIBLE_DEVICES=all" --env="NVIDIA_DRIVER_CAPABILITIES=all" --device=/dev/dri:/dev/dri rajdeep1008/tello_ros_humble:latest
TODO: Add python args thingy from ros documentation
```
## Resources
- https://medium.com/@tanishqchaudhary101010/running-gui-applications-in-docker-containers-with-nvidia-gpu-support-a-guide-using-ros-46a04046c067
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment