How may I force an application to use software-based OpenGL rendering on Ubuntu?

  • What (kind of) application are we talking about?
    – Bobby
    Commented Sep 24, 2010 at 8:13

3 Answers 3


If you're using Mesa's libGL, you can enable software rendering permanently by running:

sudo apt-get install libgl1-mesa-swx11

This will remove the libgl1-mesa-glx hardware-accelerated Mesa libraries and install the software-only renderer.

Alternately, you can set LIBGL_ALWAYS_SOFTWARE=1, which will only affect programs started with that environment variable, not the entire system.

Both these changes may not work if you're using the binary NVidia drivers, which supply their own libGL.

  • 1
    Hi, where can I set this variable LIBGL_ALWAYS_SOFTWARE=1? I have the inverse problem, OpenGL is always software rendered and my laptop does not support Unity3D for ubuntu 15.04. I have hybrid Intel-Nvidia graphics.
    – Santiago
    Commented Sep 9, 2015 at 16:06
  • 1
    libgl1-mesa-swx11 no longer replaces libgl1-mesa-glx. Thus when installing it you need to configure an override to use it. Still, I recommend using the LLVM-Pipe Software rendering using "LIBGL_ALWAYS_SOFTWARE=1 " It's much faster and takes advantage of newer hardware. Also, users of nvidia and amd drivers can force the use of the mesa software pipeline, if mesa is installed, through using an ld.so hack to override the libGL library that is loaded. Commented Nov 5, 2015 at 8:51
  • 2
    Does this work on AMD proprietary drivers? Is there an easy option on Nvidia?
    – user564181
    Commented Feb 27, 2016 at 0:47
  • I wonder why LIBGL_ALWAYS_SOFTWARE=1 could not be made to work with NVIDIA drivers installed + libgl1-mesa-glx, since my program is still linked to /usr/lib/x86_64-linux-gnu/libGL.so (provided by libgl1-mesa-dev) and not /usr/lib/nvidia-361/libGL.so, which seems to be loaded with dlopen by Mesa. Ubuntu 16.04. Commented Sep 4, 2016 at 15:20

If you use NVIDIA drivers by default, then you also need __GLX_VENDOR_LIBRARY_NAME=mesa (in addition to LIBGL_ALWAYS_SOFTWARE=1). I tested on fully updated Arch Linux (NVIDIA 470.57.02).


If this is about your own application, you can link to the software OpenGL implementation Mesa3D.

You must log in to answer this question.