0

when I run glxgears, I get following error.

libGL error: No matching fbConfigs or visuals found
libGL error: failed to load driver: swrast
Error: couldn't get an RGB, Double-buffered visual

My system is ubuntu 16.04 as docker image - nvidia/cuda:8.0-runtime-ubuntu16.04.

The image contains VirtualGL and TurboVNC and its is started with the following parameters:

docker run --runtime=nvidia --privileged -d -v /tmp/.X11-unix/X0:/tmp/.X11-unix/X0 -e USE_DISPLAY="7" my_image

There is no problem if I change the base image to nvidia/cuda:10.2-runtime-ubuntu18.04. But an application for which this container is, needs CUDA 8.

I found some advice to remove library: sudo rm /usr/lib/x86_64-linux-gnu/mesa/libGL.so.1. But it does not work.

Ubuntu 16.04, CUDA 8:

user@host:/opt/noVNC$ sudo ldconfig -p | grep -i libGL.so
    libGL.so.1 (libc6,x86-64) => /usr/lib/x86_64-linux-gnu/mesa/libGL.so.1
    libGL.so (libc6,x86-64) => /usr/lib/x86_64-linux-gnu/libGL.so
    libGL.so (libc6,x86-64) => /usr/lib/x86_64-linux-gnu/mesa/libGL.so
user@host:/usr/lib/x86_64-linux-gnu$ ll libGL*
    lrwxrwxrwx 1 root root      13 Jun 14  2018 libGL.so -> mesa/libGL.so
    lrwxrwxrwx 1 root root      32 May 25 14:14 libGLESv1_CM_nvidia.so.1 -> libGLESv1_CM_nvidia.so.440.33.01
    -rw-r--r-- 1 root root   63696 Nov 12  2019 libGLESv1_CM_nvidia.so.440.33.01
    lrwxrwxrwx 1 root root      29 May 25 14:14 libGLESv2_nvidia.so.2 -> libGLESv2_nvidia.so.440.33.01
    -rw-r--r-- 1 root root  111416 Nov 12  2019 libGLESv2_nvidia.so.440.33.01
    -rw-r--r-- 1 root root  911218 Oct 23  2015 libGLU.a
    lrwxrwxrwx 1 root root      15 Oct 23  2015 libGLU.so -> libGLU.so.1.3.1
    lrwxrwxrwx 1 root root      15 Oct 23  2015 libGLU.so.1 -> libGLU.so.1.3.1
    -rw-r--r-- 1 root root  453352 Oct 23  2015 libGLU.so.1.3.1
    lrwxrwxrwx 1 root root      26 May 25 14:14 libGLX_indirect.so.0 -> libGLX_nvidia.so.440.33.01
    lrwxrwxrwx 1 root root      26 May 25 14:14 libGLX_nvidia.so.0 -> libGLX_nvidia.so.440.33.01
    -rw-r--r-- 1 root root 1114496 Nov 12  2019 libGLX_nvidia.so.440.33.01
user@host:/usr/lib/x86_64-linux-gnu$ ll mesa
    -rw-r--r-- 1 root root     31 Jun 14  2018 ld.so.conf
    lrwxrwxrwx 1 root root     14 Jun 14  2018 libGL.so -> libGL.so.1.2.0
    lrwxrwxrwx 1 root root     14 Jun 14  2018 libGL.so.1 -> libGL.so.1.2.0
    -rw-r--r-- 1 root root 471680 Jun 14  2018 libGL.so.1.2.0

Ubuntu 18.04, CUDA 10:

user@host:/opt/noVNC$ sudo ldconfig -p | grep -i libGL.so
    libGL.so.1 (libc6,x86-64) => /usr/lib/x86_64-linux-gnu/libGL.so.1
user@host:/usr/lib/x86_64-linux-gnu$ ll libGL*
    lrwxrwxrwx 1 root root      14 May 10  2019 libGL.so.1 -> libGL.so.1.0.0
    -rw-r--r-- 1 root root  567624 May 10  2019 libGL.so.1.0.0
    lrwxrwxrwx 1 root root      32 May 20 16:43 libGLESv1_CM_nvidia.so.1 -> libGLESv1_CM_nvidia.so.440.33.01
    -rw-r--r-- 1 root root   63696 Nov 12  2019 libGLESv1_CM_nvidia.so.440.33.01
    lrwxrwxrwx 1 root root      29 May 20 16:43 libGLESv2_nvidia.so.2 -> libGLESv2_nvidia.so.440.33.01
    -rw-r--r-- 1 root root  111416 Nov 12  2019 libGLESv2_nvidia.so.440.33.01
    lrwxrwxrwx 1 root root      15 May 21  2016 libGLU.so.1 -> libGLU.so.1.3.1
    -rw-r--r-- 1 root root  453352 May 21  2016 libGLU.so.1.3.1
    lrwxrwxrwx 1 root root      15 May 10  2019 libGLX.so.0 -> libGLX.so.0.0.0
    -rw-r--r-- 1 root root   68144 May 10  2019 libGLX.so.0.0.0
    lrwxrwxrwx 1 root root      16 Feb 19 05:09 libGLX_indirect.so.0 -> libGLX_mesa.so.0
    lrwxrwxrwx 1 root root      20 Feb 19 05:09 libGLX_mesa.so.0 -> libGLX_mesa.so.0.0.0
    -rw-r--r-- 1 root root  488344 Feb 19 05:09 libGLX_mesa.so.0.0.0
    lrwxrwxrwx 1 root root      26 May 20 16:43 libGLX_nvidia.so.0 -> libGLX_nvidia.so.440.33.01
    -rw-r--r-- 1 root root 1114496 Nov 12  2019 libGLX_nvidia.so.440.33.01
    lrwxrwxrwx 1 root root      22 May 10  2019 libGLdispatch.so.0 -> libGLdispatch.so.0.0.0
    -rw-r--r-- 1 root root  612792 May 10  2019 libGLdispatch.so.0.0.0
user@host:/usr/lib/x86_64-linux-gnu$ ll mesa
    ls: cannot access 'mesa': No such file or directory

The host has CUDA 10.2 but I do not know if it is required and can cause a problem.

I have no idea how to solve this problem.

Thank you for any advice.

1

The solution is to replace nvidia/cuda:8.0-runtime-ubuntu16.04 image with nvidia/opengl:1.0-glvnd-runtime-ubuntu16.04 and install CUDA 8 manually.

CUDA 8 installation: https://gitlab.com/nvidia/container-images/cuda/-/blob/ubuntu16.04/8.0/runtime/Dockerfile

Do not forget to add display to nvidia capabilities var:

ENV NVIDIA_DRIVER_CAPABILITIES compute,utility,display

https://hub.docker.com/r/nvidia/opengl

0

The two errors also appear when Running ROS with GUI in Docker using Windows Subsystem for Linux 2 (WSL2).

The error libGL error: No matching fbConfigs or visuals found can be fixed with:

export LIBGL_ALWAYS_INDIRECT=1

The error libGL error: failed to load driver: swrast can be fixed with:

sudo apt-get install -y mesa-utils libgl1-mesa-glx


Probably irrelevant side-note:

For "the ROS with GUI on Docker guide" to run, you also have to install dbus.

sudo apt-get update
sudo apt-get install -y dbus

I do not think this is relevant here, since you will see the two errors in question only after having installed dbus, but I do not know the background of the question, perhaps it helps. Installing dbus would get rid of the error D-Bus library appears to be incorrectly set up; failed to read machine uuid: Failed to open “/var/lib/dbus/machine-id”.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.