Created
June 9, 2021 23:37
-
-
Save sgarciav/8636b50e37def33ae379c3ea3d5d30f7 to your computer and use it in GitHub Desktop.
docker-compose file to run Rviz inside a Docker container
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
version: "3.4" | |
services: | |
ros-rviz: | |
build: | |
context: . | |
dockerfile: Dockerfile | |
image: rviz_container:melodic | |
container_name: rviz_test | |
network_mode: "host" | |
stdin_open: true # docker run -i | |
tty: true # docker run -t | |
privileged: true | |
runtime: nvidia | |
environment: | |
- DISPLAY=$DISPLAY | |
- QT_X11_NO_MITSHM=1 | |
- XAUTHORITY=/tmp/.docker.xauth | |
- NVIDIA_VISIBLE_DEVICES=all | |
- NVIDIA_DRIVER_CAPABILITIES=all | |
volumes: | |
- /tmp/.X11-unix:/tmp/.X11-unix:rw | |
- /tmp/.docker.xauth:/tmp/.docker.xauth:rw |
Make sure you have apt-get installed the nvidia-docker2
package.
Also, what's the output when you execute nvidia-smi
?
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I get this error:
unknown or invalid runtime name: nvidia