I’m running a GUI application in a container in privileged mode on a MAX OS X host.
I’be been successfully able to start the GUI in the container using this link: http://kartoza.com/en/blog/how-to-run-a-linux-gui-application-on-osx-using-docker/
Now within my GUI application, I’m trying to pop up another window and I get the following:
Using Volk machine: avx_64_mmx_orc
libGL error: failed to load driver: swrast
How do I go about solving this?
asked Oct 17, 2016 at 17:59
Had the same issue trying to forward GUI from Ubuntu Server to my Mac.
On Ubuntu, installing the swrast driver for OpenGL rendering solved the issue —
sudo apt-get install -y mesa-utils libgl1-mesa-glx
Bryan K
4384 silver badges15 bronze badges
answered Apr 17, 2020 at 21:22
Avi AvidanAvi Avidan
7767 silver badges17 bronze badges
0
I’m not sure about Mac OSX as host but I’ve had the same error message. Here are the two steps that worked for me on Ubuntu 16.04 LTS:
- install the same driver version in the container as you have it on the host
- see: https://github.com/jessfraz/dockerfiles/issues/253#issuecomment-313995830
- re-run the docker container with the parameters
-v /tmp/.X11-unix:/tmp/.X11-unix:rw --privilegedin order to make it able to use DRI
The essential part aside from the driver was actually the --privileged parameter.
That fixed the problem on my Ubuntu. Hope it helps.
answered Jul 13, 2017 at 13:24
Hendrik WieseHendrik Wiese
1,9543 gold badges19 silver badges48 bronze badges
1
One of my colleagues had the same issue on Redhat 8 and solved it by installing mesa-dri-drivers.x86_64.
answered Mar 23, 2022 at 15:21
I experienced the same issue after an upgrade from Ubuntu Hirsute to Kinetic Kudo but all the above methods didnt work despite the drivers being accurate.
The issue was resolved by renaming the folder /usr/local/lib/x86_64-linux-gnu to /usr/local/lib/x86_64-linux-gnu.bak since it was containing the driver files libdrm_intel.so, libdrm_nouveau.so and other graphic driver files.
answered Sep 4, 2022 at 22:30
If anyone is here because they cant get flutter to work, its probably because of the snap install.
Install it manually from the tarball or clone it from github
here’s the documentation to install it manually
or look at my post here
answered Nov 22, 2022 at 16:15
If I click the desktop app of «Steam», nothing happens.
Running steam in terminal produces the following:
STEAM_RUNTIME is enabled automatically
Installing breakpad exception handler for appid(steam)/version(1474415843)
libGL error: No matching fbConfigs or visuals found
libGL error: failed to load driver: swrast
What’s interesting is that if I change my GPU driver to xorg, it works perfectly.
What can I do to make it work? It stopped working after the latest steam update(36 hours ago).
I tried uninstalling nvidia — sudo apt-get remove nvidia* and re-installing the driver, but with no luck.
asked Oct 7, 2016 at 15:16
Ubuntu 16.04+
For anyone still getting same error, if you are using nvidia driver, sometimes you will see that libGL.so.1 points to ambiguous libGL provided by both mesa and nvidia. To test this, you can run this command
$ sudo ldconfig -p | grep -i gl.so
The output was something like:
libwayland-egl.so.1 (libc6,x86-64) => /usr/lib/x86_64-linux-gnu/libwayland-egl.so.1
libftgl.so.2 (libc6,x86-64) => /usr/lib/x86_64-linux-gnu/libftgl.so.2
libcogl.so.20 (libc6,x86-64) => /usr/lib/x86_64-linux-gnu/libcogl.so.20
libQt5OpenGL.so.5 (libc6,x86-64) => /usr/lib/x86_64-linux-gnu/libQt5OpenGL.so.5
libQtOpenGL.so.4 (libc6,x86-64) => /usr/lib/x86_64-linux-gnu/libQtOpenGL.so.4
libQtOpenGL.so.4 (libc6) => /usr/lib/i386-linux-gnu/libQtOpenGL.so.4
libOpenGL.so.0 (libc6,x86-64) => /usr/lib/nvidia-378/libOpenGL.so.0
libOpenGL.so (libc6,x86-64) => /usr/lib/nvidia-378/libOpenGL.so
libGL.so.1 (libc6,x86-64) => /usr/lib/nvidia-378/libGL.so.1
libGL.so.1 (libc6) => /usr/lib/i386-linux-gnu/mesa/libGL.so.1
libGL.so.1 (libc6) => /usr/lib32/nvidia-378/libGL.so.1
libGL.so (libc6,x86-64) => /usr/lib/nvidia-378/libGL.so
libGL.so (libc6) => /usr/lib32/nvidia-378/libGL.so
libEGL.so.1 (libc6,x86-64) => /usr/lib/nvidia-378/libEGL.so.1
libEGL.so.1 (libc6) => /usr/lib32/nvidia-378/libEGL.so.1
libEGL.so (libc6,x86-64) => /usr/lib/nvidia-378/libEGL.so
libEGL.so (libc6) => /usr/lib32/nvidia-378/libEGL.so
Now I just needed to remove the library provided by mesa and everything worked perfectly.
$ sudo rm /usr/lib/i386-linux-gnu/mesa/libGL.so.1
Update:
This issue no longer exists from Ubuntu 18.04 LTS.
answered Apr 11, 2017 at 9:49
15
In my situation I had to install the i386 NVIDIA drivers. It worked thereafter.
sudo apt install libnvidia-gl-440:i386
Have a great day!
answered Feb 18, 2020 at 2:46
Stan S.Stan S.
4675 silver badges5 bronze badges
8
Windows Subsystem for Linux (WSL) has same error
In Windows Subsystem for Linux (WSL) under Windows 10 there the file /usr/lib/i386-linux-gnu/mesa/libGL.so.1 does not exist. Instead there is the file /usr/lib/x86_64-linux-gnu/mesa/libGL.so.1 seems to replace it. However if you delete the replacement file the library doesn’t work at all.
Rename library then rename back solves problem
If you rename the file and then rename it back the errors disappear and it works a lot faster:
───────────────────────────────────────────────────────────────────────────────
rick@alien:/mnt/e/etc$ lock-screen-timer
Linux version 4.4.0-43-Microsoft (Microsoft@Microsoft.com) (gcc version 5.4.0 (GCC) ) #1-Microsoft Wed Dec 31 14:42:53 PST 2014
libGL error: No matching fbConfigs or visuals found
libGL error: failed to load driver: swrast
Gtk-Message: GtkDialog mapped without a transient parent. This is discouraged.
───────────────────────────────────────────────────────────────────────────────
rick@alien:/mnt/e/etc$ sudo ldconfig -p | grep -i gl.so
libwayland-egl.so.1 (libc6,x86-64) => /usr/lib/x86_64-linux-gnu/libwayland-egl.so.1
libcogl.so.20 (libc6,x86-64) => /usr/lib/x86_64-linux-gnu/libcogl.so.20
libQt5OpenGL.so.5 (libc6,x86-64) => /usr/lib/x86_64-linux-gnu/libQt5OpenGL.so.5
libGL.so.1 (libc6,x86-64) => /usr/lib/x86_64-linux-gnu/mesa/libGL.so.1
libEGL.so.1 (libc6,x86-64) => /usr/lib/x86_64-linux-gnu/mesa-egl/libEGL.so.1
───────────────────────────────────────────────────────────────────────────────
rick@alien:/mnt/e/etc$ sudo rm /usr/lib/i386-linux-gnu/mesa/libGL.so.1
rm: cannot remove '/usr/lib/i386-linux-gnu/mesa/libGL.so.1': No such file or directory
───────────────────────────────────────────────────────────────────────────────
rick@alien:/mnt/e/etc$ sudo mv /usr/lib/x86_64-linux-gnu/mesa/libGL.so.1 /usr/lib/x86_64-linux-gnu/mesa/libGL.so.1.ORIGINAL
───────────────────────────────────────────────────────────────────────────────
rick@alien:/mnt/e/etc$ lock-screen-timer
Linux version 4.4.0-43-Microsoft (Microsoft@Microsoft.com) (gcc version 5.4.0 (GCC) ) #1-Microsoft Wed Dec 31 14:42:53 PST 2014
/usr/bin/zenity: error while loading shared libraries: libGL.so.1: cannot open shared object file: No such file or directory
───────────────────────────────────────────────────────────────────────────────
rick@alien:/mnt/e/etc$ sudo mv /usr/lib/x86_64-linux-gnu/mesa/libGL.so.1.ORIGINAL /usr/lib/x86_64-linux-gnu/mesa/libGL.so.1
───────────────────────────────────────────────────────────────────────────────
rick@alien:/mnt/e/etc$ lock-screen-timer
Linux version 4.4.0-43-Microsoft (Microsoft@Microsoft.com) (gcc version 5.4.0 (GCC) ) #1-Microsoft Wed Dec 31 14:42:53 PST 2014
Gtk-Message: GtkDialog mapped without a transient parent. This is discouraged.
───────────────────────────────────────────────────────────────────────────────
rick@alien:/mnt/e/etc$
I verified the change is persistent, ie close the WSL terminal window and open a new window.
What’s using the library?
The library is used by yad in the lock-screen-timer bash script upgraded with hybrid support for WSL in addition to Ubuntu. Yad is a fork of Zenity which is why you see the Zenity-like Gtk-Message: reference in the third error message above.
Here’s what the yad window looks like in Ubuntu (in WSL it’s slightly different):
answered Nov 19, 2017 at 17:26
WinEunuuchs2UnixWinEunuuchs2Unix
97.3k33 gold badges228 silver badges398 bronze badges
7
This might be a nvidia driver issue, according to a steam-for-linux issue.
In my case, I installed SuperTuxKart through flapak, when I ran it, I met following errors:
..:: Antarctica Rendering Engine 2.0 ::..
Linux 4.15.0-52-generic #56-Ubuntu SMP Tue Jun 4 22:49:08 UTC 2019 x86_64
libGL error: No matching fbConfigs or visuals found
libGL error: failed to load driver: swrast
My solution is:
- Check nvidia driver on my system
ubuntu-drivers devices
It has nvidia-driver-430 installed already.
- According to the steam-for-linux issue issue, install
nvidia-driver-418to replacenvidia-driver-430
sudo apt install libnvidia-gl-418
It prompted that it lack dependency of libnvidia-compute-418, so just install libnvidia-compute-418 first.
sudo apt install libnvidia-compute-418
then
sudo apt install libnvidia-gl-418
- Reboot system.
Then I ran SuperTuxKart, it worked.
answered Jun 30, 2019 at 7:11
Yong YangYong Yang
811 silver badge3 bronze badges
2
In my case the issue was that I had enabled some CUDA apt sources that had installed the 440 nvidia driver and tools. Once I disabled that and installed the then latest version of nvidia driver (435), it installed everything else needed and the error went away.
answered May 25, 2020 at 1:11
The solutions that worked for me:
-
Ubuntu 20.04:
sudo apt install libnvidia-gl-440
(without:i386) -
WSL2 Windows 10: run XServer with -nowgl (and -ac):
"C:Program FilesVcXsrvvcxsrv.exe" :0 -multiwindow -clipboard -nowgl -ac
#see https://askubuntu.com/a/1394781/498339
answered Feb 25, 2022 at 8:45
PJ127PJ127
2312 silver badges7 bronze badges
Being a professional graphic designer you value your graphics card more than your life. Or, be it for enhancing your gaming experience or working for hours and hours on rendering your video edits, a good graphics card will certainly make your life and the process of rendering easier and even painless. Either way, when your graphics card in your favorite version of your free operating system starts acting up and you’re unable to use your new, flashy application or game due to an error such as Failed to Load Driver Swrast, fear not! We have all the steps required to get you back on track, from the easy to the long and drawn out. Buckle in!
This article applies specifically to a Linux error, but maybe you’re wondering more about another Operating System – you can check here for my Ultimate List of Windows Error Codes. Maybe consoles interest you more? Check here for the Ultimate PS4 Error Code List.
This is an era of communication and you can find almost everything online. I remember back in my days when we had to actually go out and buy games but now I can simply do it in the comfort of my home and at very reasonable prices – thanks to Steam discounts. Getting back to my point, sometimes – when on Linux – when you have just bought yourself the latest game and are eager to play you launch Steam without any further delay. The excitement of it has you on the tip of your toes while the anxiety of playing your new game and telling your friends on the earliest is also creeping into your head. However, all this excitement goes away when Steam decides to betray you. Disappointed you look towards your computer screen and think, now what? Well, don’t panic! I’m certainly here to help.
You would basically try launching steam via Terminal like this;
Running Steam on ubuntu 15.04 64-bit
STEAM_RUNTIME is enabled automatically
Installing breakpad exception handler for appid(steam)/version(1437790054)
libGL error: unable to load driver: r600_dri.so
libGL error: driver pointer missing
libGL error: failed to load driver: r600
libGL error: unable to load driver: swrast_dri.so
libGL error: failed to load driver: swrast
And to your dismay, it won’t work.
Possible Easy Solution
To fix this problem try running these commands in Terminal:
rm ~/.local/share/Steam/ubuntu12_32/steam-runtime/i386/usr/lib/i386-linux-gnu/libstdc++.so.6
rm ~/.local/share/Steam/ubuntu12_32/steam-runtime/i386/usr/lib/i386-linux-gnu/libgcc_s.so.1
After this Steam should be working properly.
Pro Tip: If you are installing the proprietary AMD drivers don’t do it! They are bad for the stability of your OS in comparison to other open source drivers. At this point, you might point out how open source drivers perform badly. In that case, better stop living under a rock and upgrade! What I mean is upgrade the Mesa version by adding xorg edgers ppa.
sudo add-apt-repository ppa:xorg-edgers/ppa
After that type this;
sudo apt-get update & sudo apt-get upgrade
You will be required to reboot after that and then you will be upgraded to Mesa version. This method is tried and tested for Ubuntu 16.04.
Running Steam using terminal can be complicated even if you are well aware of the commands. Here is a simple query to give you an idea about what errors you can face while installing Steam on Ubuntu 15.04 and how to solve them.
More Details: What are Ubuntu and Mesa?
Mesa is an API that allows interfacing between the graphics hardware and software. Basically, independent of Operating System, Mesa provides an OpenGL API. Its job is to create a transitional layer in between graphics API and the graphics hardware in the operating system. On the other hand, Ubuntu is an open source free to use operating system, based on Linux. You can download Ubuntu from here.
The basic difference between Windows and Linux is the Direct Rendering Infrastructure, also known as the DRI. DRI, which is a framework that allows access to the graphics hardware directly under the Windows System. Mesa, using OpenGL, is an interface that defines a standard set of functions that are needed for drawing 3D graphics. Now I know that computer science is not your major, but keeping that in mind in this day and age you cannot go without knowing how to use a computer, even if it’s only for occasional use. As difficult as the setups are, the job it does for you is a thousand times better and more fruitful than all the trouble you went through.
Another condition could be that you are quite sure NVIDIA-Linux driver is installed properly and there is nothing you can recognize which might seem to be causing trouble. The visible effects of this sometimes appear during start and then GL windows are not drawn, rather, they just contain the background, ie:
If you installed the NVIDIA drivers using binary .run package then you are in for a surprise. You need to install that each and every time there is a kernel update. Other files are also overwritten so they might be disrupted when packages are updated. Newbies might have trouble in realizing minute details that go in the process of updating and building Linux-based machines and servers, as they can be of great use but most of the people use tools to produce a site with an unmanaged machine.
What is SWRAST?
Swrast is a software renderer and therefore, it is not the job of swrast to find the hardware driver for your graphic card. There is a couple of libGL libraries installed and a symbolic link to those libraries. If you want to have a look at them refer to the command line below:
sudo find /usr -iname “*libGL.so*” -exec ls -l {} ;
Sometimes installing graphics card break these symbolic links. To check this you might want to run a small OpenGL program test and verify the symbolic links. You can do so via:
export LIBGL_DEBUG=verbose
glxgears
This is going to fail and will probably tell you that your OpenGL library is not working. If you do not see this error then there are other things to consider. For now, the solution to this would be making sure that the symbolic link i.e. /usr/local/lib/libGL.so.1.2.0 is pointing at the right OpenGL library.
Brand New to Your Nvidia Card?
The earlier method does not work properly and when someone switches to Nvidia in the bios, and there is no libGL installed in the first place. Oh no! What should we do? Have no fear, we’ve got you covered, too. It’s pretty simple, really – all computer hardware generally has evolving versions of software drivers to ‘drive’ that hardware and ‘make it go.’
The solution here? Install drivers! Visit this site and download Nvidia updated drivers!
Simple enough, right? Reboot your machine, and give your Application or game another shot – and see what happens!
Shortcut / End-All Solution
Should nothing else prove to work, try in terminal:
sudo apt-get remove nvidia*
which will remove any nvidia drivers you've got installed already. Next, reboot. Now, again in terminal:
sudo add-apt-repository ppa:xorg-edgers/ppa
sudo apt-get update
sudo apt-get install nvidia-349 nvidia-settings
sudo add-apt-repository -r ppa:xorg-edgers/ppa
This will install Nvidia's 349 driverset, which is known to be the most stable. Try your game or application again!
Conclusion
Installing graphics card drivers provide the possibility that the symbolic links used for OpenGL libraries break. The solution to this problem is manually fixing symbolic links.
Computer related errors have always been a nuisance to mankind ever since the introduction of computers into our daily lives. Even though most of the solutions are available online it is one tough job to land on the right link at the right time. I hope I provided an answer to all of your queries!
Pro Tips Galore:
- Should nothing else work – try reinstalling your Operating System. A fresh start is oftentimes exactly what you need – check out these tips under Pro Tips Galore about reinstalling the Windows OS, they basically apply the same in this scenario except you want to download your shiny version of Linux instead. Maybe, right?
- While you’re at it, make sure you’re using the most recent version of your Operating System. Updates and upgrades can do beautiful things when you’re facing errors like these!
- Failing that, try a new graphics card (along with new drivers). Try switching to AMD? AMD and Nvidia have had a long-standing battle for ‘best,’ and you might find that a comparable alternative from the ‘other side’ to be a good fit.
- Failing that, try a new operating system. There’re plenty of flavors of Linux out there – or, potentially, you could try Windows to sort out your woes.
- Failing that – check other, similar titles. Are they also misbehaving? Do you see any relevant troubleshooting articles for those specific games through searching your favorite Internet Search Engine?
“There’s nothing that cannot be found through some search engine or on the Internet somewhere.” – Eric Schmidt
What’s more impressive than knowing so much about Linux? Knowing about the Internet in general, of course! Click here for the Ultimate List of HTTP Errors.
Thanks, and again – I truly hope this helped put away your issue! If you’re interested in more articles I’ve written helping people in other circumstances like these, click on my name as author up top. You can also search all of Error Codes Pro by clicking the little Search icon in the top-right, and typing in whatever error you’re facing.
Ryan is a computer enthusiast who has a knack for fixing difficult and technical software problems. Whether you’re having issues with Windows, Safari, Chrome or even an HP printer, Ryan helps out by figuring out easy solutions to common error codes.
# Environment
— Host: ubuntu 18.04 with cuda 10.2 and nvidia-440
— Docker image: ubuntu 16.04
# Example: Run Rviz
«`sh
# rosrun rviz rviz
[ INFO] [1591698594.187146454]: rviz version 1.12.17
[ INFO] [1591698594.187204754]: compiled against Qt version 5.5.1
[ INFO] [1591698594.187226653]: compiled against OGRE version 1.9.0 (Ghadamon)
libGL error: No matching fbConfigs or visuals found
libGL error: failed to load driver: swrast
Could not initialize OpenGL for RasterGLSurface, reverting to RasterSurface.
libGL error: No matching fbConfigs or visuals found
libGL error: failed to load driver: swrast
Segmentation fault (core dumped)
«`
# Example: error when run OpenGL
«`sh
$ sudo apt-get update
$ sudo apt-get install libglu1-mesa-dev freeglut3-dev mesa-common-dev
«`
«`cpp
#include
void displayMe(void)
{
glClear(GL_COLOR_BUFFER_BIT);
glBegin(GL_POLYGON);
glVertex3f(0.5, 0.0, 0.5);
glVertex3f(0.5, 0.0, 0.0);
glVertex3f(0.0, 0.5, 0.0);
glVertex3f(0.0, 0.0, 0.5);
glEnd();
glFlush();
}
int main(int argc, char** argv)
{
glutInit(&argc, argv);
glutInitDisplayMode(GLUT_SINGLE);
glutInitWindowSize(400, 300);
glutInitWindowPosition(100, 100);
glutCreateWindow(«Hello world!»);
glutDisplayFunc(displayMe);
glutMainLoop();
return 0;
}
«`
Compile:
«`sh
g++ main.cpp -o firstOpenGlApp -lglut -lGLU -lGL
./firstOpenGlApp
«`
Error detail:
«`sh
# ./firstOpenGlApp
libGL error: No matching fbConfigs or visuals found
libGL error: failed to load driver: swrast
freeglut (./firstOpenGlApp): ERROR: Internal error in function fgOpenWindow
«`
# Analysis
— locate
«`sh
# locate libGL.so
/usr/lib/x86_64-linux-gnu/libGL.so
/usr/lib/x86_64-linux-gnu/mesa/libGL.so
/usr/lib/x86_64-linux-gnu/mesa/libGL.so.1
/usr/lib/x86_64-linux-gnu/mesa/libGL.so.1.2.0
«`
— ldd
«`sh
# ldd firstOpenGlApp
linux-vdso.so.1 => (0x00007fff839cf000)
libglut.so.3 => /usr/lib/x86_64-linux-gnu/libglut.so.3 (0x00007f0388eea000)
libGL.so.1 => /usr/lib/x86_64-linux-gnu/mesa/libGL.so.1 (0x00007f0388c76000)
libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x00007f03888ac000)
libX11.so.6 => /usr/lib/x86_64-linux-gnu/libX11.so.6 (0x00007f0388572000)
libm.so.6 => /lib/x86_64-linux-gnu/libm.so.6 (0x00007f0388269000)
libXi.so.6 => /usr/lib/x86_64-linux-gnu/libXi.so.6 (0x00007f0388059000)
libXxf86vm.so.1 => /usr/lib/x86_64-linux-gnu/libXxf86vm.so.1 (0x00007f0387e53000)
libz.so.1 => /lib/x86_64-linux-gnu/libz.so.1 (0x00007f0387c39000)
libexpat.so.1 => /lib/x86_64-linux-gnu/libexpat.so.1 (0x00007f0387a10000)
libxcb-dri3.so.0 => /usr/lib/x86_64-linux-gnu/libxcb-dri3.so.0 (0x00007f038780d000)
libxcb-present.so.0 => /usr/lib/x86_64-linux-gnu/libxcb-present.so.0 (0x00007f038760a000)
libxcb-sync.so.1 => /usr/lib/x86_64-linux-gnu/libxcb-sync.so.1 (0x00007f0387403000)
libxshmfence.so.1 => /usr/lib/x86_64-linux-gnu/libxshmfence.so.1 (0x00007f0387200000)
libglapi.so.0 => /usr/lib/x86_64-linux-gnu/libglapi.so.0 (0x00007f0386fcf000)
libXext.so.6 => /usr/lib/x86_64-linux-gnu/libXext.so.6 (0x00007f0386dbd000)
libXdamage.so.1 => /usr/lib/x86_64-linux-gnu/libXdamage.so.1 (0x00007f0386bba000)
libXfixes.so.3 => /usr/lib/x86_64-linux-gnu/libXfixes.so.3 (0x00007f03869b4000)
libX11-xcb.so.1 => /usr/lib/x86_64-linux-gnu/libX11-xcb.so.1 (0x00007f03867b2000)
libxcb-glx.so.0 => /usr/lib/x86_64-linux-gnu/libxcb-glx.so.0 (0x00007f0386599000)
libxcb-dri2.so.0 => /usr/lib/x86_64-linux-gnu/libxcb-dri2.so.0 (0x00007f0386394000)
libxcb.so.1 => /usr/lib/x86_64-linux-gnu/libxcb.so.1 (0x00007f0386172000)
libdrm.so.2 => /usr/lib/x86_64-linux-gnu/libdrm.so.2 (0x00007f0385f61000)
libpthread.so.0 => /lib/x86_64-linux-gnu/libpthread.so.0 (0x00007f0385d44000)
libdl.so.2 => /lib/x86_64-linux-gnu/libdl.so.2 (0x00007f0385b40000)
/lib64/ld-linux-x86-64.so.2 (0x00007f0389132000)
libXau.so.6 => /usr/lib/x86_64-linux-gnu/libXau.so.6 (0x00007f038593c000)
libXdmcp.so.6 => /usr/lib/x86_64-linux-gnu/libXdmcp.so.6 (0x00007f0385736000)
«`
— glxinfo
«`sh
# glxinfo | more
libGL error: No matching fbConfigs or visuals found
libGL error: failed to load driver: swrast
Error: couldn’t find RGB GLX visual or fbconfig
name of display: :0
132 GLX Visuals
visual x bf lv rg d st colorbuffer sr ax dp st accumbuffer ms cav
id dep cl sp sz l ci b ro r g b a F gb bf th cl r g b a ns b eat
«`
# Solution
## Dockerfile
— Use nvidia/cudagl rather than nvidia/cuda
«`sh
# versiion
ARG cuda_version=9.0
# ARG cudnn_version=7
ARG ubuntu_version=16.04
ARG nvidia_cudnn_version=7.1.3.16-1+cuda9.0
FROM nvidia/cudagl:${cuda_version}-devel-ubuntu${ubuntu_version}
# FROM nvidia/cuda:${cuda_version}-cudnn${cudnn_version}-devel-ubuntu16.04
# base image
MAINTAINER [email protected]
# ENV LANG C.UTF-8
# ENV LC_ALL C.UTF-8
################################################################################
# Install the Nvidia cuDNN library missing in the parent image.
# https://gitlab.com/nvidia/cuda/blob/ubuntu16.04/10.1/devel/cudnn7/Dockerfile
ARG nvidia_cudnn_version
ENV NVIDIA_CUDNN_VERSION=${nvidia_cudnn_version}
RUN apt-get update && apt-get install -y —no-install-recommends
libcudnn7=${NVIDIA_CUDNN_VERSION}
libcudnn7-dev=${NVIDIA_CUDNN_VERSION}
&& apt-mark hold libcudnn7
&& rm -rf /var/lib/apt/lists/*
################################################################################
# Install ROS Kinetic Kame.
# http://wiki.ros.org/kinetic/Installation/Ubuntu
# Update the package list.
RUN echo «deb http://packages.ros.org/ros/ubuntu xenial main» > /etc/apt/sources.list.d/ros-latest.list
# Add the package keys.
RUN apt-key adv —keyserver ‘hkp://ha.pool.sks-keyservers.net:80’ —recv-key C1CF6E31E6BADE8868B172B4F42ED6FBAB17C654
# Install ‘ros-kinetic-desktop-full’ packages (including ROS, Rqt, Rviz, and more).
#ARG ros_desktop_version
#ENV ROS_DESKTOP_VERSION=${ros_desktop_version}
RUN apt-get update && apt-get install -y —no-install-recommends
ros-kinetic-desktop-full
&& rm -rf /var/lib/apt/lists/*
# Install ROS bootstrap tools
RUN apt-get update && apt-get install —no-install-recommends -y
python-rosdep
python-rosinstall
python-vcstools
python-rosinstall-generator
python-wstool
RUN rosdep init
&& rosdep update
################################################################################
«`
## Docker-compose
— Add
«`sh
runtime: nvidia
environment:
— DISPLAY
— QT_X11_NO_MITSHM=1
volumes:
— /tmp/.X11-unix:/tmp/.X11-unix:rw
«`
Sample:
«`sh
version: ‘2.3’
services:
ubuntu16_cuda9_ros:
image: yubaoliu/root:ros-cuda9.0-cudnn7-ubuntu16.04
build:
context: .
dockerfile: Dockerfile
args:
cuda_version: 9.0
# cudnn_version: 7
ubuntu_version: 16.04
runtime: nvidia
stdin_open: true
tty: true
environment:
— DISPLAY
— QT_X11_NO_MITSHM=1
volumes:
— /tmp/.X11-unix:/tmp/.X11-unix:rw
— ubuntu16_cuda9_ros:/root
# entrypoint: /entrypoint-kinetic.sh
volumes:
ubuntu16_cuda9_ros:
«`
## xhost +local:root
# Verify
«`sh
xhost +local:root
docker-compose -f ros_cuda9.0.yml up
Start a terminal
roscore
«`
«`sh
# rosrun rviz rviz
[ INFO] [1591758684.872139458]: rviz version 1.12.17
[ INFO] [1591758684.872168343]: compiled against Qt version 5.5.1
[ INFO] [1591758684.872175509]: compiled against OGRE version 1.9.0 (Ghadamon)
process 107: D-Bus library appears to be incorrectly set up; failed to read machine uuid: UUID file ‘/etc/machine-id’ should contain a hex string of length 32, not length 0, with no other text
See the manual page for dbus-uuidgen to correct this issue.
[ INFO] [1591758685.537067433]: Stereo is NOT SUPPORTED
[ INFO] [1591758685.537229733]: OpenGl version: 4.6 (GLSL 4.6).
«`
# References
— [How to Install OpenGL on Ubuntu Linux](http://www.codebind.com/linux-tutorials/install-opengl-ubuntu-linux/)
I’m running a GUI application in a container in privileged mode on a MAX OS X host.
I’be been successfully able to start the GUI in the container using this link: http://kartoza.com/en/blog/how-to-run-a-linux-gui-application-on-osx-using-docker/
Now within my GUI application, I’m trying to pop up another window and I get the following:
Using Volk machine: avx_64_mmx_orc
libGL error: failed to load driver: swrast
How do I go about solving this?
asked Oct 17, 2016 at 17:59
Had the same issue trying to forward GUI from Ubuntu Server to my Mac.
On Ubuntu, installing the swrast driver for OpenGL rendering solved the issue —
sudo apt-get install -y mesa-utils libgl1-mesa-glx
Bryan K
4384 silver badges15 bronze badges
answered Apr 17, 2020 at 21:22
Avi AvidanAvi Avidan
7767 silver badges17 bronze badges
0
I’m not sure about Mac OSX as host but I’ve had the same error message. Here are the two steps that worked for me on Ubuntu 16.04 LTS:
- install the same driver version in the container as you have it on the host
- see: https://github.com/jessfraz/dockerfiles/issues/253#issuecomment-313995830
- re-run the docker container with the parameters
-v /tmp/.X11-unix:/tmp/.X11-unix:rw --privilegedin order to make it able to use DRI
The essential part aside from the driver was actually the --privileged parameter.
That fixed the problem on my Ubuntu. Hope it helps.
answered Jul 13, 2017 at 13:24
Hendrik WieseHendrik Wiese
1,9543 gold badges19 silver badges48 bronze badges
1
One of my colleagues had the same issue on Redhat 8 and solved it by installing mesa-dri-drivers.x86_64.
answered Mar 23, 2022 at 15:21
I experienced the same issue after an upgrade from Ubuntu Hirsute to Kinetic Kudo but all the above methods didnt work despite the drivers being accurate.
The issue was resolved by renaming the folder /usr/local/lib/x86_64-linux-gnu to /usr/local/lib/x86_64-linux-gnu.bak since it was containing the driver files libdrm_intel.so, libdrm_nouveau.so and other graphic driver files.
answered Sep 4, 2022 at 22:30
If anyone is here because they cant get flutter to work, its probably because of the snap install.
Install it manually from the tarball or clone it from github
here’s the documentation to install it manually
or look at my post here
answered Nov 22, 2022 at 16:15






