Error using Rviz and Gazebo in Docker container

364 Views Asked by At

I'm having some problems to use GUI Applications in my docker container. I am using a docker image based on the nvidia/cuda:10.2-runtime-ubuntu18.04 .

Everything apparently works correctly inside mi docker container, but when I try to run gazebo, I receive the following error:

libGL error: No matching fbConfigs or visuals found libGL error: failed to load driver: swrast X Error of failed request: GLXBadContext Major opcode of failed request: 151 (GLX) Minor opcode of failed request: 6 (X_GLXIsDirect) Serial number of failed request: 38 Current serial number in output stream: 37 libGL error: No matching fbConfigs or visuals found libGL error: failed to load driver: swrast X Error of failed request: GLXBadContext Major opcode of failed request: 151 (GLX) Minor opcode of failed request: 6 (X_GLXIsDirect) Serial number of failed request: 38 Current serial number in output stream: 37

Something similar happens when running rviz.

Any idea?

This is my code for running the container.

sudo docker run -it \
--env="DISPLAY"  \
--env="QT_X11_NO_MITSHM=1"  \
--volume="/tmp/.X11-unix:/tmp/.X11-unix:rw" \
--volume="/home/$USER:/home/$USER" \
--volume="/etc/group:/etc/group:ro" \
--volume="/etc/passwd:/etc/passwd:ro" \
--volume="/etc/shadow:/etc/shadow:ro" \
--volume="/etc/sudoers.d:/etc/sudoers.d:ro" \
--volume="$HOME/host_docker:/home/user/host_docker" \
-v /tmp/.X11-unix:/tmp/.X11-unix:rw \
-e LOCAL_USER_ID=`id -u $USER` \
-e LOCAL_GROUP_ID=`id -g $USER` \
-e LOCAL_GROUP_NAME=`id -gn $USER` \
-e DISPLAY=$DISPLAY \
--privileged \
--volume /run/dbus/system_bus_socket:/run/dbus/system_bus_socket:ro \
-v /home/oscar_ramos/dodge_drone_challenge:/root/challenge/ --rm --runtime=nvidia -e NVIDIA_VISIBLE_DEVICES=all  -p 10253:10253 -p 10254:10254 --name ddc-challenge challenge:version1 /bin/bash
xhost -local:root```


0

There are 0 best solutions below