Force software based opengl rendering

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


Solution 1:

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.

Solution 2:

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

Solution 3:

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

env __GLX_VENDOR_LIBRARY_NAME=mesa LIBGL_ALWAYS_SOFTWARE=1 glxinfo