jessfraz/dockerfiles

libGL error: No matching fbConfigs or visuals found libGL error: failed to load driver: swrast

AnthonyWC opened this issue · 10 comments

Not sure if it's because I got a Nvidia card but get this error:

antho@alto  ~/docker/cathode  docker run -it -v /tmp/.X11-unix:/tmp/.X11-unix -e DISPLAY=unix$DISPLAY --name cathode2 jess/cathode
libGL error: No matching fbConfigs or visuals found
libGL error: failed to load driver: swrast
Unrecognized OpenGL version
Unrecognized OpenGL version
^C^Z%

~/docker/cathode  docker ps                                                                     
CONTAINER ID        IMAGE               COMMAND                  CREATED             STATUS              PORTS               NAMES
970db301b82e        jess/cathode        "/src/cool-retro-term"   12 seconds ago      Up 11 seconds                           cathode2

antho@alto  ~/docker/cathode  docker info                                                                   
Containers: 15
 Running: 1
 Paused: 0
 Stopped: 14
Images: 228
Server Version: 17.03.0-ce
Storage Driver: overlay
 Backing Filesystem: extfs
 Supports d_type: true
Logging Driver: json-file
Cgroup Driver: cgroupfs
Plugins: 
 Volume: local
 Network: bridge host macvlan null overlay
Swarm: inactive
Runtimes: runc
Default Runtime: runc
Init Binary: docker-init
containerd version: 977c511eda0925a723debdc94d09459af49d082a
runc version: a01dafd48bc1c7cc12bdb01206f9fea7dd6feb70
init version: 949e6fa
Security Options:
 apparmor
 seccomp
  Profile: default
Kernel Version: 4.4.17-040417-generic
Operating System: Ubuntu 16.04.2 LTS
OSType: linux
Architecture: x86_64
CPUs: 8
Total Memory: 31.38 GiB
Name: alto
ID: D7BA:ESHA:LMJQ:LKOL:YYVA:K6QT:NM4R:D4NW:YA7R:NRJW:EM3S:W2WA
Docker Root Dir: /var/lib/docker
Debug Mode (client): false
Debug Mode (server): false
Username: anthonywc
Registry: https://index.docker.io/v1/
WARNING: No swap limit support
Experimental: false
Insecure Registries:
 127.0.0.0/8
Live Restore Enabled: false

antho@alto  ~/docker/cathode  lsb_release -a                                                                
No LSB modules are available.
Distributor ID: Ubuntu
Description:    Ubuntu 16.04.2 LTS
Release:        16.04
Codename:       xenial

Have a look at http://gernotklingler.com/blog/howto-get-hardware-accelerated-opengl-support-docker/. Using this I was able to get glxgears working; shouldn't be too much of a jump to apply to the same ideas to cathode. Unfortunately, though, it creates a host-specific container

Thanks @roytruelove! With your reference I was able to solve by installing nvidia drivers in the container, by running <nvidia-installer.sh> -a -N --ui=none --no-kernel-module

As you mentioned, the drawback is that your container is now host-specific (or at least GPU-specific).

RGD2 commented

I can confirm that just

docker run -it -v /tmp/.X11-unix:/tmp/.X11-unix:rw -e DISPLAY=unix$DISPLAY --device /dev/dri --privileged ubuntu 

Then

apt update && apt install --no-recommends -y nvidia-340 mesa-utils && glxgears

Worked for me, solving the issue for at least glxgears -- and it should work in general too.

Although note I'm running mint 18 (based on xenial) as the host as well, and the ubuntu version in docker was xenial too.

Key seems to be the changes to the docker options, plus having the same driver installed within the container. (well, host-specific binaries are the price we pay for greater performance).

It seems it should be possible to solve this one with a really judicious mount of some sort -- maybe with a symlink -- just to expose the right openGL driver library on the host, although it somewhat breaks the point of docker.

I think I have a fix. I am working on having Pymol in a container, on a Ubuntu 16.04 VM with an Nvidia GRID K1 attached to it. It is a legacy GPU, so I can only use the nvidia-340 driver.

I have tried many solutions that didn't get me far, until I have simply mounted the driver's library folder into the container and it seems like worked fine. This how I executed my container:

docker run -it --rm -v /tmp/.X11-unix:/tmp/.X11-unix:rw --privileged -e DISPLAY=unix$DISPLAY -v $HOME/:/home/training/ -v /usr/lib/nvidia-340:/usr/lib/nvidia-340 -v /usr/lib32/nvidia-340:/usr/lib32/nvidia-340 --device /dev/dri --name pymol ebitraining/pymol:alpha

As an extra, In my Dockerfile I had this environment variables set. But I am not sure if it does helps:

LABEL com.nvidia.volumes.needed="nvidia_driver"
ENV PATH /usr/lib/nvidia-340/bin:${PATH}
ENV LD_LIBRARY_PATH /usr/lib/nvidia-340:/usr/lib32/nvidia-340:${LD_LIBRARY_PATH}

this should be fixed but let me know if otherwise

Apologies, is there an official fix for this? The makeshift solution I am using is very limited to my current setup. Ta

Hi,

I'm trying to run an application that uses OpenGL and Cuda 9.0 from a container built with Singularity on a remote machine. The application compiles and works perfectly fine on my local workstation. However, when I log in to the remote machine via SSH with the xserver enabled, I get this error when the said application tries to open images from their GUI:

libGL error: No matching fbConfigs or visuals found
libGL error: failed to load driver: swrast
QGLContext::makeCurrent(): Cannot make invalid context current.
Segmentation fault

I've taken care to install the exact same version of the nvidia drivers on the remote and local machines (390.67). Also, OpenGL seems to be working fine (glxgears runs without issues, so does glxinfo).

What could possibly be the problem...?

Thank you for any pointers!

This is gonna drive me nuts. Same problem trying to launch rviz and gazebo in subsystem linux for windows 10. I have installed all packages listed here, tried many solutions. The segfault has no lead, it is just a segmentation fault all the way long.

This is gonna drive me nuts. Same problem trying to launch rviz and gazebo in subsystem linux for windows 10. I have installed all packages listed here, tried many solutions. The segfault has no lead, it is just a segmentation fault all the way long.

Running ROS on WSL is a very different game. As the issue is not related to docker, I feel you should ask this in a separate thread/forum. However, I'll share a few links that might be able to help you

  1. microsoft/WSL#2855
  2. microsoft/WSL#1450
  3. http://answers.gazebosim.org/question/16888/gazebo-on-wsl-bash-for-windows/
  4. https://virtualizationreview.com/articles/2018/01/30/hands-on-with-wsl-graphical-apps.aspx