Broken X-server from latest repository-default Nvidia driver

Hello,
I recently did an update using default repositories available for Nvidia+Cuda setup on a laptop with bumblebee installed. I am discovering that while I have everything working properly using optirun but default X is somewhat broken. Output from glxinfo and glxgears:


~> glxinfo 
name of display: :0 
Error: couldn't find RGB GLX visual or fbconfig 
~> glxgears 
Error: couldn't get an RGB, Double-buffered visual

As I’ve metioned, this works with bumblebee and I do have minor response time issues here and there. I started noticing this when I tried to launch Steam and it returned:

OpenGL GLX extension not supported by displayMain.cpp (332) : Assertion Failed: Fat
al Error: OpenGL GLX extension not supported by display

I did some research and most of the “solutions” for other distros are simply to upgrade. I am reaching a conclusion that there is some form of incompatibility between libGL(X) and the new Nvidia driver.


~> ldd /usr/bin/glxinfo 
       linux-vdso.so.1 (0x00007ffda574c000) 
       libGL.so.1 => /usr/lib64/libGL.so.1 (0x00007f9efd081000) 
       libX11.so.6 => /usr/lib64/libX11.so.6 (0x00007f9efcd40000) 
       libc.so.6 => /lib64/libc.so.6 (0x00007f9efc986000) 
       libGLX.so.0 => /usr/lib64/libGLX.so.0 (0x00007f9efc754000) 
       libGLdispatch.so.0 => /usr/lib64/libGLdispatch.so.0 (0x00007f9efc49e000) 
       libpthread.so.0 => /lib64/libpthread.so.0 (0x00007f9efc280000) 
       libxcb.so.1 => /usr/lib64/libxcb.so.1 (0x00007f9efc057000) 
       libdl.so.2 => /lib64/libdl.so.2 (0x00007f9efbe53000) 
       /lib64/ld-linux-x86-64.so.2 (0x00007f9efd51e000) 
       libXau.so.6 => /usr/lib64/libXau.so.6 (0x00007f9efbc4f000)  

I am a little bit lost here. It seems that by using Nvidia card through optirun I can get pretty much everything to work, but using Intel card, I can’t access anything that uses OpenGL, and many compositor activities are sluggish.

From what I read, most likely due to incompatibility in libGLX which is only configure for the Nvidia card. I am at a loss.

Does anyone have suggestions?

I am also going to add the following:


~> cat /var/log/Xorg.0.log |grep -i glx
    12.079] (II) LoadModule: "**glx**"
    12.084] (II) Loading /usr/lib64/xorg/modules/extensions/lib**glx**.so
    12.130] (II) Module **glx**: vendor="NVIDIA Corporation"
    12.131] (II) NVIDIA **GLX** Module  440.33.01  Tue Nov 12 23:47:20 UTC 2019
    12.171] (II) Initializing extension **GLX**
~> cat /var/log/Xorg.8.log |grep -i glx  
   697.594] (II) LoadModule: "**glx**"
   697.594] (II) Loading /usr/lib64/nvidia/xorg/modules/extensions/lib**glx**.so
   697.599] (II) Module **glx**: vendor="NVIDIA Corporation"
   697.599] (II) NVIDIA **GLX** Module  440.33.01  Tue Nov 12 23:47:20 UTC 2019
   698.608] (II) Initializing extension **GLX**
   698.608] (II) Initializing extension **GLX**
   698.608] (II) Indirect **GLX** disabled.
   698.608] (II) Initializing extension NV-**GLX**
~> cat /var/log/Xorg.8.log |grep -i intel
   699.146] (II) config/udev: Adding input device HDA **Intel** PCH Mic (/dev/input/event10)
   699.146] (II) config/udev: Adding input device HDA **Intel** PCH Headphone (/dev/input/event11)
   699.147] (II) config/udev: Adding input device HDA **Intel** PCH HDMI/DP,pcm=3 (/dev/input/event12)
   699.147] (II) config/udev: Adding input device HDA **Intel** PCH HDMI/DP,pcm=7 (/dev/input/event13)
   699.147] (II) config/udev: Adding input device HDA **Intel** PCH HDMI/DP,pcm=8 (/dev/input/event14)
   699.147] (II) config/udev: Adding input device HDA **Intel** PCH HDMI/DP,pcm=9 (/dev/input/event15)
   699.148] (II) config/udev: Adding input device HDA **Intel** PCH HDMI/DP,pcm=10 (/dev/input/event16)

Also note 12.079] loads the following:


/usr/lib64/xorg/modules/extensions/libglx.so -> /etc/alternatives/libglx.so
libglx.so -> /usr/lib64/xorg/modules/extensions/nvidia/nvidia-libglx.so

Solution found, and it makes me feel quite dumb. By default Nvidia libglx was loaded instead of general one. The solution was done by the following:

sudo update-alternatives --config libglx.so

then choosing the default libglx provided by xorg.

There are 2 choices for the alternative libglx.so (providing /usr/lib64/xorg/modules/extensions/libglx.so).

  Selection    Path                                                        Priority   Status
------------------------------------------------------------
  0            /usr/lib64/xorg/modules/extensions/nvidia/nvidia-libglx.so   100       auto mode
  1            /usr/lib64/xorg/modules/extensions/nvidia/nvidia-libglx.so   100       manual mode
* 2            /usr/lib64/xorg/modules/extensions/xorg/xorg-libglx.so       50        manual mode

Making sure that this stays default:

sudo update-alternatives --install /usr/lib64/xorg/modules/extensions/libglx.so libglx.so /usr/lib64/xorg/modules/extensions/xorg/xorg-libglx.so  120