Could not initialize GLX with NVIDIA 384.66 on Ubuntu 16.04


I’m running ubuntu 16.04 with three Titan X cards. I installed NVIDIA 384.66 driver as part of installing cuda via the following commands:

sudo dpkg -i cuda-repo-ubuntu1604_8.0.61-1_amd64.deb
sudo apt-get update
sudo apt-get install cuda

I also followed the steps listed in this StackExchange answer:

However, when I run an X-Window application that uses GLX (Agisoft Photoscan, to be precise), I see the following output:

Could not initialize GLX

Additionally, when I run glxgears, I see:

Error: couldn't get an RGB, Double-buffered visual

(In both cases, the program crashes.)

The above problems also occur with 3 1080Tis in another machine.

Can someone help me fix this? Thanks.

nvidia-bug-report.log.gz (283 KB)

Looks like you don’t have a monitor connected and use AllowEmptyInitialConfiguration to get the xserver started. This way, you don’t really get a (virtual) screen. Use option ConnectedMonitor to achieve that.

You should still get GLX even with AllowEmptyInitialConfiguration. From the attached bug report, it looks like libglx is initializing correctly in the X server. Can you please attach the output of glxinfo from one of the X screens? Also please check that the correct client-side libGL is installed. The bug report script normally uses “ldd /usr/bin/glxinfo” to check this, but apparently you don’t have glxinfo installed.

Are you trying to use indirect GLX, by any chance?

Here are some key outputs:

$ glxinfo
name of display: localhost:12.0
Error: couldn't find RGB GLX visual or fbconfig

$ ldd /usr/bin/glxinfo =>  (0x00007ffe475b3000) => /usr/lib/nvidia-384/ (0x00007fec754ce000) => /usr/lib/x86_64-linux-gnu/ (0x00007fec75194000) => /lib/x86_64-linux-gnu/ (0x00007fec74dc9000) => /lib/x86_64-linux-gnu/ (0x00007fec74bc5000) => /usr/lib/nvidia-384/ (0x00007fec74995000) => /usr/lib/nvidia-384/ (0x00007fec746c6000) => /usr/lib/x86_64-linux-gnu/ (0x00007fec744a4000)
	/lib64/ (0x0000556b3d959000) => /usr/lib/x86_64-linux-gnu/ (0x00007fec74292000) => /usr/lib/x86_64-linux-gnu/ (0x00007fec7408d000) => /usr/lib/x86_64-linux-gnu/ (0x00007fec73e87000)

Perhaps I am trying indirect GLX? I’m not sure what that is. I’m running SSH -Y from a remote client. Is that the problem?


I am facing the same issue as i have connected the UBUNTU server 16.04 via XRDP.

root@ubuntu:/# glxinfo
name of display: :11.0
Error: couldn’t find RGB GLX visual or fbconfig

root@ubuntu:/# ldd /usr/bin/glxinfo => (0x00007ffeb0b51000) => /usr/lib/x86_64-linux-gnu/mesa/ (0x00007f4beab58000) => /usr/lib/x86_64-linux-gnu/ (0x00007f4bea81e000) => /lib/x86_64-linux-gnu/ (0x00007f4bea454000) => /lib/x86_64-linux-gnu/ (0x00007f4bea22b000) => /usr/lib/x86_64-linux-gnu/ (0x00007f4bea028000) => /usr/lib/x86_64-linux-gnu/ (0x00007f4be9e25000) => /usr/lib/x86_64-linux-gnu/ (0x00007f4be9c1e000) => /usr/lib/x86_64-linux-gnu/ (0x00007f4be9a1b000) => /usr/lib/x86_64-linux-gnu/ (0x00007f4be97ec000) => /usr/lib/x86_64-linux-gnu/ (0x00007f4be95da000) => /usr/lib/x86_64-linux-gnu/ (0x00007f4be93d7000) => /usr/lib/x86_64-linux-gnu/ (0x00007f4be91d1000) => /usr/lib/x86_64-linux-gnu/ (0x00007f4be8fcf000) => /usr/lib/x86_64-linux-gnu/ (0x00007f4be8db6000) => /usr/lib/x86_64-linux-gnu/ (0x00007f4be8bb1000) => /usr/lib/x86_64-linux-gnu/ (0x00007f4be898f000) => /usr/lib/x86_64-linux-gnu/ (0x00007f4be8789000) => /usr/lib/x86_64-linux-gnu/ (0x00007f4be8578000) => /lib/x86_64-linux-gnu/ (0x00007f4be826f000) => /lib/x86_64-linux-gnu/ (0x00007f4be8052000) => /lib/x86_64-linux-gnu/ (0x00007f4be7e4e000)
/lib64/ (0x00007f4beadca000) => /usr/lib/x86_64-linux-gnu/ (0x00007f4be7c4a000) => /usr/lib/x86_64-linux-gnu/ (0x00007f4be7a44000)

Please provide me the solution if someone has the resolution.

If you want a simple solution, set up a real X server then use x11vnc to connect.

@williamvdk: Try export __GLX_VENDOR_LIBRARY_NAME=nvidia before you start your program with indirect GLX.