How may I force an application to use software based opengl rendering on Ubuntu?
Asked
Active
Viewed 3.3k times
3 Answers
25
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.
Cliff L. Biffle
- 103
- 3
ephemient
- 24,884
- 4
- 30
- 20
-
1Hi, 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 Sep 09 '15 at 16:06
-
1libgl1-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. – Robert Wm Ruedisueli Nov 05 '15 at 08:51
-
2
-
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. – Ciro Santilli OurBigBook.com Sep 04 '16 at 15:20
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
Arzet Ro
- 131
- 1
1
If this is about your own application, you can link to the software OpenGL implementation Mesa3D.
Bobby
- 8,944
- 3
- 37
- 45
Malte Clasen
- 131
- 1
- 5