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

165,587

Solution 1

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.

Solution 2

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!

Solution 3

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 ([email protected]) (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 ([email protected]) (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 ([email protected]) (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

Solution 4

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.

Solution 5

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.

Share:
165,587

Related videos on Youtube

cbll
Author by

cbll

Updated on September 18, 2022

Comments

  • cbll
    cbll over 1 year

    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.

  • Aritz Lopez
    Aritz Lopez almost 7 years
    Man, you deserve a huge cookie.
  • FredericB
    FredericB over 6 years
    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 :)
  • Zobayer Hasan
    Zobayer Hasan about 6 years
    Yep, basically you need to remove libGL.so.1 from wherever it is in your system.
  • Eric
    Eric about 6 years
    This didn't work for me - although I'm not using lock-screen-timer
  • WinEunuuchs2Unix
    WinEunuuchs2Unix about 6 years
    lock-screen-timer is just an example of a script that calls the GUI. You could use gedit.
  • Eric
    Eric about 6 years
    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
  • bbarker
    bbarker about 6 years
    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).
  • jan-glx
    jan-glx about 6 years
    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?
  • alephalpha
    alephalpha almost 6 years
    I don't have a mesa folder in /usr/lib/i386-linux-gnu/. I tried removing /usr/lib/i386-linux-gnu/libGL.so.1, and steam said: You are missing the following 32-bit libraries, and Steam may not run: libGL.so.1
  • Zobayer Hasan
    Zobayer Hasan almost 6 years
    This was an error scenario that caused due to conflicts between mesa and nvidia. If you don't have one or the other, then probably the reason is something different. If you are using ubuntu 18.04, this issue no longer exists.
  • Waruna Ranasinghe
    Waruna Ranasinghe almost 6 years
    I had the same problem in CentOS 7. (thanks @ZobayerHasan saved a lot of time). Removing the default libGL libs solved the issue. But is there a better solution without deleting the default library?
  • QkiZ
    QkiZ over 5 years
    This issue persists on 18.10
  • Zobayer Hasan
    Zobayer Hasan over 5 years
    @QkiZ, Interesting, cause I did fresh install of 18.04 and steam, with nvidia drivers. And this problem did not occur. Somehow 18.10 re-introduced the problem?
  • QkiZ
    QkiZ over 5 years
    Yes. I resolved it by resolution from github.com/ValveSoftware/steam-for-linux/issues/…
  • kayo
    kayo about 5 years
    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!
  • NikoNyrh
    NikoNyrh about 5 years
    Removing /usr/lib/i386-linux-gnu/libGL.so.1 lets the Steam launch somewhat but then complains that this is missing, if it is found then the launch crashes to "An X Error occurred" :(
  • Zobayer Hasan
    Zobayer Hasan almost 5 years
    @NikoNyrh You should only remove it when it is redundant, otherwise probably have to look into other solutions.
  • NikoNyrh
    NikoNyrh almost 5 years
    It seems that my issue is related to CUDA 10 not shipping with x86 version of some drivers(?) which Steam requires. I don't have the relevant links at hand atm.
  • Tropilio
    Tropilio over 4 years
    This did not work for me as well
  • eDeviser
    eDeviser over 4 years
    This helped me in using Target3001 in wine.
  • Antoine Boucher
    Antoine Boucher over 4 years
    This issue persists on 19.10 sudo rm -rf /lib/x86_64-linux-gnu/libGL.so.1 fix it
  • Noctis
    Noctis about 4 years
    Thanks bro! This works for me in Ubuntu 20.04.
  • gbronner
    gbronner about 4 years
    I was able to get away with just sudo apt install libnvidia-gl-440
  • erjiang
    erjiang almost 4 years
    This worked for me after upgrading to nvidia-driver-440! I didn't realize that my glxgears binary was 32-bit at first.
  • EvilSupahFly
    EvilSupahFly almost 4 years
    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.
  • Black Chase
    Black Chase over 3 years
    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.
  • Aditya Patnaik
    Aditya Patnaik over 3 years
    I am on AMD graphics facing this issue.
  • Neil Stockbridge
    Neil Stockbridge about 3 years
    Thanks heaps. I needed to: apt install libnvidia-gl-460:i386 on Ubuntu 18.04
  • Praytic
    Praytic about 3 years
    I don't even have mesa folder in my WSL2
  • WinEunuuchs2Unix
    WinEunuuchs2Unix about 3 years
    @Praytic The answer was posted for WSL (version 1). I haven't had time to reboot and test WSL2 yet.
  • Matthew Zaleski
    Matthew Zaleski almost 3 years
    This fixed an issue for me. I recently installed Ubuntu 20.04 within WSL2 (Windows 10) where the host machine has an NVidia GPU.