Ubuntu libGL error failed to load driver swrast

I setup PlayOnLinux to install some windows games on my linux machine, however, frequently one of the issues of cross-os gaming is that you must run them in a 32bit wine configuration.

Ok, thats not so bad, but everytime I completed the PlayOnLinux install process, and actually ran the game, I was getting the following errors in the debug log:

libGL error: No matching fbConfigs or visuals found
libGL error: failed to load driver: swrast
X Error of failed request:BadValue (integer parameter out of range for operation)
Major opcode of failed request: 154 (GLX)
Minor opcode of failed request: 3 (X_GLXCreateContext)
Value in failed request: 0x0
Serial number of failed request: 250
Current serial number in output stream: 254

To make a long story short, it seems there was an issue with my 32bit openGL drivers (the 64bit ones worked just fine).  To solve the issue, I ran the following command to check out where my libraries were pointing to:

ldconfig -p | grep libGL.so.1

Which in my case was returning:

libGL.so.1 (libc6,x86-64) => /usr/lib/nvidia-352/libGL.so.1
libGL.so.1 (libc6) => /usr/lib/i386-linux-gnu/mesa/libGL.so.1

Well, the first line (the one with libc6,x86-64) was reporting the location of the 64 bit libGL library, that one was ok.

The second one (libc6),  is the 32bit library, I can see it was pointing to some /usr/lib/i386-linux-gnu/mesa/ folder..  The spot it should really be pointing to is  /usr/lib32 . In your case, you may not even have this second line (hence no 32bit driver) read below on how to add it if this is the case

These library paths are defined inside the /etc/ld.so.conf.d folder. So, I greped in there for mesa, and I found the culprit.  In my case it was the file /etc/ld.so.conf.d/i386-linux-gnu_GL.conf .  The content of the file was:


I commented that line and added the correct folder (/usr/lib32).  So the file became:


If in your case you never had a libc6 library reported by ldconfig -p | grep libGL.so.1, you can just go ahead and create a file /etc/ld.so.conf.d/local.conf or whatever, with the contents:


Anyways, once that file is in place, you need to run ldconfig to enable the new configuration:

sudo ldconfig

And to test the configuration you can run again:

ldconfig -p | grep libGL.so.1

You should see the libc6 line pointed to the correct folder in /usr/lib32 .  Now your 32bit GLX should work!

Happy Gaming!

Bookmark the permalink.
There are to Ubuntu libGL error failed to load driver swrast

  1. Hi!

    Your guide totally worked for me!

    – problem – when installing world of tanks on Ubuntu 16 via wine (this guide – http://help.ubuntu.ru/wiki/wot#настройка_wine_и_инсталляция_игры)
    – also encounteted this problem while trying to run steam on Ubuntu 16
    – same error log as yours

    After changing the config file – all began to work =)

  2. Running Kubuntu 18.04 I found:
    > ls /etc/ld.so.conf.d/
    libc.conf x86_64-linux-gnu.conf
    The file libc.conf contained “/usr/local/lib” only. I added two lines:
    Then I ran:
    > ldconfig
    The problem “libGL error failed to load driver swrast” disappeared.

Leave a Reply

Your email address will not be published. Required fields are marked *