Hi community,
I tried to run Gazebo Harmonic simulator from the docker image osrf/ros:jazzy-desktop-full. I run the docker image using --gpus all
arg. The GUI application Rviz2 can be started without any issue. However, starting the Gazebo simulator returns these error message on the terminal and a black screen on the application window:
glx: failed to create dri3 screen
failed to load driver: nouveau
I’m using the open Nvidia driver, and I would like to not to switch if possible. Asking LLMs doesn’t help me much. Can someone explain me the issue and maybe know how to fix this?
Thanks.
I’ve just installed the proprietary Nvidia driver with sudo pacman -S linux-cachyos-nvidia
, and the Gazebo simulator returns the same error messages.
The issue doesn’t depend on the closed or open Nvidia driver.
OK, I understand and found out my issue above.
The error message above shows that the docker container doesn’t know about the existing Nvidia driver on the host. Adding these two args after --gpus all makes the docker container know about the installed driver on the host:
-e NVIDIA_VISIBLE_DEVICES=${NVIDIA_VISIBLE_DEVICES:-all} \
-e NVIDIA_DRIVER_CAPABILITIES=${NVIDIA_DRIVER_CAPABILITIES:-all} \
However, this change shows the known crash issues running Qt applications (Rviz2 and Gazebo Harmonic) on systems using Wayland, particularly with the interaction between Ogre and Qt.
My fix deal with this X11, Wayland, Qt, Nvidia chaos is to apply these docker run arguments:
docker run --rm --it \
--gpus all \
--runtime nvidia \
-e DISPLAY=$DISPLAY \
-e QT_X11_NO_MITSHM=1 \
-e QT_QPA_PLATFORM=xcb \
-e "WAYLAND_DISPLAY=$WAYLAND_DISPLAY" \
-e "XDG_RUNTIME_DIR=$XDG_RUNTIME_DIR" \
-e NVIDIA_VISIBLE_DEVICES=${NVIDIA_VISIBLE_DEVICES:-all} \
-e NVIDIA_DRIVER_CAPABILITIES=${NVIDIA_DRIVER_CAPABILITIES:-all} \
-v /tmp/.X11-unix:/tmp/.X11-unix \
-v "$XDG_RUNTIME_DIR:$XDG_RUNTIME_DIR" \
-v "/dev/dri:/dev/dri" \
More details see GitHub - ywiyogo/Docker-Scripts: Scripts for using Docker container.