60

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.

63

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.

15
  • 13
    Man, you deserve a huge cookie. – Aritz Lopez Aug 13 '17 at 10:31
  • 3
    on debian 9, I removed this one and worked, but no mention to "mesa", however, "dpkg -S libGL.so.1" give a tip which one you should remove. So: rm /usr/lib/i386-linux-gnu/libGL.so.1 And enjoy your cookie :) – FabricioFCarv Feb 16 '18 at 1:22
  • 1
    This is correct; at first I thought that it would be better to remove the package (libgl1-mesa-glx) that libGL.so.1 belongs to, but as it happens, this is a requirement of the Steam package. So just remove libGL.so.1 (which should be a symbolic link anyway). – bbarker Mar 18 '18 at 11:13
  • 5
    This issue persists on 18.10 – QkiZ Nov 10 '18 at 23:05
  • 5
    After updating Linux Mint from 18 to 19 i had this issue. I had to remove /usr/lib/i386-linux-gnu/libGL.so.1 Thank you Zobayer Hasan for your help! – kayo Feb 24 '19 at 23:24
18

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!

6
  • 2
    Thanks bro! This works for me in Ubuntu 20.04. – Noctis Apr 20 '20 at 20:00
  • 2
    I was able to get away with just sudo apt install libnvidia-gl-440 – gbronner May 1 '20 at 22:58
  • This worked for me after upgrading to nvidia-driver-440! I didn't realize that my glxgears binary was 32-bit at first. – erjiang Jun 30 '20 at 17:38
  • 1
    I play WoW using Lutris, and after upgrading from 390 to 450 to support my new GeForce GTX 1660 on Mint 19.3, I was getting the same error in my WINE console output: "libGL error: No matching fbConfigs or visuals found libGL error: failed to load driver: swrast The error was resolved by installing libnvidia-gl-450:i386 which was not selected by default for some reason. – EvilSupahFly Jul 21 '20 at 22:26
  • 2
    It says Depends: libnvidia-gl-450:i386, but installing libnvidia-gl-450:i386 threatens to remove cuda-10-1 cuda-demo-suite-10-1 cuda-drivers cuda-drivers-450 cuda-runtime-10-1 libnvidia-gl-450 libnvidia-ifr1-450 nvidia-driver-450 but i need cuda 10.1. As Cuda 11 and Cuda 10.2 is not supported by many libraries I daily use. Want to use steam and Cuda. – Black Chase Sep 2 '20 at 5:28
13

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):

Lock Screen Timer

5
  • 2
    This didn't work for me - although I'm not using lock-screen-timer – Eric Mar 5 '18 at 12:50
  • lock-screen-timer is just an example of a script that calls the GUI. You could use gedit. – WinEunuuchs2Unix Mar 5 '18 at 13:14
  • Sure, I realize. My point is that my application (rqt) might be invoking the GUI in a different way, which might be why it still fails after trying your fix – Eric Mar 5 '18 at 13:54
  • Hm. For me gnome-terminal throws the same warning, but even without renaming anything, the warning is gone when starting a second instance of gnome-terminal. Isn't that the case maybe for your "solution" too? – jan-glx Apr 24 '18 at 11:19
  • This did not work for me as well – Tropilio Oct 28 '19 at 13:56
5

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:

  1. Check nvidia driver on my system

ubuntu-drivers devices

It has nvidia-driver-430 installed already.

  1. According to the steam-for-linux issue issue, install nvidia-driver-418 to replace nvidia-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

  1. Reboot system.

Then I ran SuperTuxKart, it worked.

2
  • This helped me in using Target3001 in wine. – eDeviser Nov 29 '19 at 20:22
  • I am on AMD graphics facing this issue. – Aditya Patnaik Sep 8 '20 at 8:23
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.

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