How to enable indirect GLX contexts (+iglx) in Ubuntu 14.04 LTS with nvidia gfx-cards
Solution 1
I had a similar issue when running some GL applications via 'ssh -X' and solved it by adding "+iglx" to xserver-command in /usr/share/lightdm/lightdm.conf.d/50-xserver-command.conf.
[SeatDefaults]
# Dump core
xserver-command=X -core +iglx
After which you either reboot or Ctrl-Alt-F1, login, and 'sudo service lightdm restart'.
I hope this helps!
Solution 2
An alternative (and display-manager-independent) way to add the options is to add the following section to /etc/X11/xorg.conf:
Section "ServerFlags"
Option "IndirectGLX" "on"
EndSection
Solution 3
I was having the same issue running a custom OpenGL program over ssh -X
. The above solution worked with a slight modification
Section "ServerFlags"
Option "AllowIndirectGLX" "on"
Option "IndirectGLX" "on"
EndSection
This worked with ubuntu 16.04 server running kubuntu-desktop with NVIDIA GTX 1070 GPU and NVIDIA binary driver installed through apt.
Related videos on Youtube
cmks
Updated on September 18, 2022Comments
-
cmks over 1 year
I am running a linux-host for Qt-software-development at a central place.
With my windows box I use Xming as a local X-server and putty to connect to that linux-host. With this configuration I can use all X (xclock, xterm) and GLX (qtcreator, gxlinfo, glxgears...) programs at the linux-host.
My main workstation is a ubuntu 14.04 LTS with a nvidia gfx card. When I connect to the linux-host with my ubuntu-system using "ssh -p port# -YC my.dev.host.com" I also can use all X programs (xclock, xterm) programs but I can not use GLX programs (qtcreator, gxlinfo, glxgears...).
As far I learned this is because the X-server dont support indirect GLX contexts by default for version younger 1.16.
So my questions ist: How can I enable indirect GLX contexts (X-server and nvidida driver) in my ubuntu 14.04 LTS installation to get things working as expected from a X-server.
Thank you for any help!
cmks
Here is the output of glxgears, maybe that helps:
[email protected]:~# LIBGL_DEBUG=verbose glxgears libGL: screen 0 does not appear to be DRI2 capable libGL: OpenDriver: trying /usr/lib/x86_64-linux-gnu/dri/tls/swrast_dri.so libGL: OpenDriver: trying /usr/lib/x86_64-linux-gnu/dri/swrast_dri.so libGL: Can't open configuration file /root/.drirc: No such file or directory. libGL: Can't open configuration file /root/.drirc: No such file or directory. 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: 35 Current serial number in output stream: 37
-
cmks about 8 yearsglxdemo, glxheads and glxinfo are working now. glxgears starts but shows only the first frame. I guess it is related to "Running synchronized to the vertical refresh." There are still the messages
libGL error: No matching fbConfigs or visuals found
andlibGL error: failed to load driver: swrast
-
cmks about 8 yearsThe libGL errors are caused by the try to use DRI. Setting
LIBGL_ALWAYS_INDIRECT=1
prohibits using of DRI in then there are no error messages. But glxgears still only shows one frame -
David Foerster almost 7 yearsWelcome to Ask Ubuntu! I recommend to edit this answer to expand it with specific details about where to add this. (See also How do I write a good answer? for general advice about what sorts of answers are considered most valuable on Ask Ubuntu.)
-
ArcaneDominion over 6 yearsMy xorg.conf keeps getting overwritten everytime I restart
lightdm
. -
Ben Middleton over 6 yearsSeems like the right setting is
Option "IndirectGLX" "on"
. According to this,enableIndirectGLX
must evaluate toTRUE
so theBadValue
error is not returned. The default is:FALSE
=-iglx
(on command line). So on of either set:+iglx
command line option, ORIndirectGLX "on"
or equivalent "truthy" value -
Ben Middleton over 6 yearsNvidia docs for the binary drivers say there is another option
AllowIndirectGLXProtocol
for the same thing. However, their docs are somewhat confusing, because they mention theBadValue
error will be returned with their setting name asAllowIndirectGLXProtocol = "true"
. This is completely opposite of what they say later "The NVIDIA GLX implementation will prohibit creation of indirect GLX contexts if AllowIndirectGLXProtocol option is set to False.
" So it's confusing, and maybe docs are wrong? -
Steve Dee almost 6 yearsCould your glxgears crash be: bugs.freedesktop.org/show_bug.cgi?id=99555 ? Looks like IGLX is broken in Xorg for about a year :(
-
gerardw almost 6 years@ArcaneDominion Put commands in a file in /usr/share/X11/xorg.conf.d (at least on xubuntu 16.04)
-
benathon about 3 yearsCan you clarify if you edited the client (the computer which run ssh -X) or the server (the computer with the ssh server)?