9

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:

root@my.dev.host.com:~# 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
8

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!

  • glxdemo, 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 and libGL error: failed to load driver: swrast – cmks Mar 17 '16 at 14:49
  • The 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 – cmks Mar 17 '16 at 15:16
  • Could your glxgears crash be: bugs.freedesktop.org/show_bug.cgi?id=99555 ? Looks like IGLX is broken in Xorg for about a year :( – Steve Dee Jun 2 '18 at 11:10
4

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
  • My xorg.conf keeps getting overwritten everytime I restart lightdm. – ArcaneDominion Dec 8 '17 at 10:04
  • @ArcaneDominion Put commands in a file in /usr/share/X11/xorg.conf.d (at least on xubuntu 16.04) – gerardw Jun 28 '18 at 17:41
0

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.

  • 1
    Welcome 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.) – David Foerster Jul 7 '17 at 13:10
  • Seems like the right setting is Option "IndirectGLX" "on". According to this, enableIndirectGLX must evaluate to TRUE so the BadValue error is not returned. The default is: FALSE = -iglx (on command line). So on of either set: +iglx command line option, OR IndirectGLX "on" or equivalent "truthy" value – TrinitronX Jan 13 '18 at 5:59
  • Nvidia docs for the binary drivers say there is another option AllowIndirectGLXProtocol for the same thing. However, their docs are somewhat confusing, because they mention the BadValue error will be returned with their setting name as AllowIndirectGLXProtocol = "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? – TrinitronX Jan 13 '18 at 6:28

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.