Nvidia driver's libglx broken after update

A little while ago I did a system update that ended up breaking my graphics driver. I could still log in and use my computer fine, but anything requiring extensive use of OpenGL now doesn’t work.

After a few hours of troubleshooting, I’ve narrowed the problem down to the driver’s libglx. I found these lines in my /var/log/Xorg.0.log:


(II) LoadModule: "glx"
(II) Loading /usr/lib64/xorg/modules/extensions/libglx.so
(II) Module glx: vendor="X.Org Foundation"
     compiled for 1.17.2, module version = 1.0.0
     ABI class: X.Org Server Extension, version 9.0
...]
(EE) NVIDIA(0): Failed to initialize the GLX module; please check in your X
(EE) NVIDIA(0):     log file that the GLX module has been loaded in your X
(EE) NVIDIA(0):     server, and that the module is the NVIDIA GLX module.  If
(EE) NVIDIA(0):     you continue to encounter problems, Please try
(EE) NVIDIA(0):     reinstalling the NVIDIA driver.

So, I did the suggested thing and reinstalled the NVIDIA driver. No go. Eventually, I manually set libgx by running:


# update-alternatives --set libglx.so /usr/lib64/xorg/modules/extensions/nvidia/nvidia-libglx.so

and naturally, that caused everything to die. I had to boot in to runlevel 3 and set it back to Xorg’s version in order to use my computer again.

This is on openSUSE Leap with the latest Xorg server installed and x11-video-nvidiaG04 package version 352.79-19.1.

Does anybody know why NVIDIA’s libglx would break like this?

Maybe nvidia’s libGL got overwritten by Mesa’s version?

How did you install the driver in the first place?

Also, what graphics card do you have?
Maybe it’s not supported by the latest G04 driver version…

It would probably also be interesting to see the (complete) Xorg log when everything is broken, i.e. you use nvidia’s libglx.

Maybe, but I’ve reinstalled the NVIDIA driver several times, so I’d think it would have re-overwritten Mesa’s version by now.

I installed the x11-video-nvidiaG04 (and associated packages) from the NVIDIA Graphics Drivers repository at http://download.nvidia.com/opensuse/leap/42.1. I had to do one modification to /etc/init.d/boot.local to ensure it was using NVIDIA’s libglx when I first installed it, but after that it worked perfectly until the aforementioned system update. I’ve since undone that change to boot.local, since it doesn’t seem to be necessary anymore, and it breaks my system at this point anyway.

I have a GeForce GTX 960, and the G04 version is what zypper recommends when installed with “install-new-recommends”.

See, that’s what I thought too, but it doesn’t seem to log anything when that happens. I’ll try again to make sure that’s the case, but I’ve been trying to locate a specific error message for a while.

Managed to get a little more information about what’s happening. Here’s a link to my Xorg.0.log when it tries to load NVIDIA’s libglx: http://pastebin.com/5ACA7qcy

The odd thing is that nothing there stands out as an error to me.

Probably, yes.

I installed the x11-video-nvidiaG04 (and associated packages) from the NVIDIA Graphics Drivers repository at http://download.nvidia.com/opensuse/leap/42.1.

That should set the libglx symlink properly on installation, and also install libGL in a way that it is not overwritten.

I had to do one modification to /etc/init.d/boot.local to ensure it was using NVIDIA’s libglx when I first installed it,

And what change exactly?
Such a thing should not be necessary.

I have a GeForce GTX 960, and the G04 version is what zypper recommends when installed with “install-new-recommends”.

Ok, that definitely is supported.

See, that’s what I thought too, but it doesn’t seem to log anything when that happens. I’ll try again to make sure that’s the case, but I’ve been trying to locate a specific error message for a while.

Well, you didn’t actually write what exactly is broken. You only wrote “that caused everything to die”.
So not even Xorg starts any more afterwards?
Otherwise there must be a log, unless you use gdm.

Can you at least post the Xorg log when using Xorg’s libglx then please?

Also, is nvidia-glG04 installed?
Maybe post a list of all installed nvidia packages:

rpm -qa | grep nvidia

Right, that looks fine.

So what exactly is happening in that case?

Try to login to a simple desktop (IceWM e.g., that should be installed in any case), and run glxinfo (install Mesa-demo-x if that command is not found). Does that show an error?

Also maybe try to disable the intel chip in the BIOS settings/UEFI firmware if possible.

What happens is that, instead of seeing gdm, I get the GNOME “Oh no! An error has occurred!” screen. The only way to log in is to boot runlevel 3.

List of installed packages:


nvidia-glG04-352.79-19.1.x86_64
nvidia-uvm-gfxG04-kmp-default-352.79_k4.1.12_1-19.1.x86_64
x11-video-nvidiaG04-352.79-19.1.x86_64
nvidia-computeG04-352.79-19.1.x86_64
nvidia-gfxG04-kmp-default-352.79_k4.1.12_1-19.1.x86_64

The change to boot.local was the following script, which I found somewhere online when I ran into issues the first time setting up:


mode=$(/sbin/lspci | egrep 'VGA|3D');

# Make shure we are in command of /usr/X11R6/lib
if  -e /etc/ld.so.conf.d/nvidia-gfxGO*.conf ]; then
    /bin/rm /etc/ld.so.conf.d/nvidia-gfxGO*.conf
fi


# Check graphics mode and take apropriate action
if  `echo $mode | grep -c "Intel" ` -gt 0 ]; then
      /usr/sbin/update-alternatives --set libglx.so /usr/lib64/xorg/modules/extensions/xorg/xorg-libglx.so
fi


if  -e /usr/X11R6/lib64/libGL.so.1 ]; then
    /bin/rm /usr/X11R6/lib64/libGL.so.1
fi


if  -e /usr/X11R6/lib/libGL.so.1 ]; then
    /bin/rm /usr/X11R6/lib/libGL.so.1
fi


if  `echo $mode | grep -c "NVIDIA" ` -gt 0 ]; then
    /usr/sbin/update-alternatives --set libglx.so /usr/lib64/xorg/modules/extensions/nvidia/nvidia-libglx.so
    /sbin/ldconfig /usr/X11R6/lib64
    /sbin/ldconfig /usr/X11R6/lib
fi

Again, I’m no longer using this script.

So you are using gdm?
Try switching to xdm then for now by setting DISPLAYMANAGER=“xdm” in /etc/sysconfig/displaymanager.

Then switch to IceWM by setting DEFAULT_WM=“icewm” in /etc/sysconfig/windowmanager, as GNOME likely won’t start either.

Then please post the output of “glxinfo”.

List of installed packages:

Ok. Should work then.

The change to boot.local was the following script, which I found somewhere online when I ran into issues the first time setting up:

This is intended to switch between the nvidia and intel driver.
It serves no purpose otherwise and might even break your system (as it removes the libGL.so.1 symlink and nvidia’s library overrides).

Do you have the file /etc/ld.so.conf.d/nvidia-gfxGO4.conf?
nvidia’s OpenGL cannot work otherwise.
And please post the content.

Contents of /etc/ld.so.conf.d/nvidia-gfxG04.conf:


#/usr/X11R6/lib64
#/usr/X11R6/lib

I’ll try booting into icewm and running glxinfo.

Well this is defenitly a problem:




  -      9.967] (--) PCI: (0:0:2:0) 8086:0412:1458:d000 rev 6, Mem @ 0xf7400000/4194304, 0xd0000000/268435456, I/O @ 0x0000f000/64
  -      9.967] (--) PCI:*(0:1:0:0) 10de:1401:3842:2966 rev 161, Mem @ 0xf6000000/16777216, 0xe0000000/268435456, 0xf0000000/33554432, 



It’s a laptop? And it’s an Optimus? You’d better go for Bumblebee or Prime.

Got some glxinfo output:


name of display: :0
libGL error: No matching fbConfigs or visuals found
libGL error: failed to load driver: swrast
X Error of failed request:  GLXBadContext
  Major opcode of failed request:  154 (GLX)
  Minor opcode of failed request:  6 (X_GLXIsDirect)
  Serial number of failed request:  46
  Current serial number in output stream:  45

And no, this is a desktop computer, not a laptop.

Well, AFAICT from the log, the display is connected to the nvidia card, so the nvidia driver should work.

Using the intel chip would not be possible without hacks while the nvidia driver is installed though.

The nvidia kernel module seems to load fine, for what it’s worth. It’s just an issue with libglx, or something else OpenGL-related.

Well, so the problem definitely is that OpenGL is not working.
It tries to use the swrast driver (Mesa’s software renderer) which needs Xorg’s libglx.

And the problem is caused by your nvidia-gfxG04.conf, it seems:

#/usr/X11R6/lib64
#/usr/X11R6/lib

Both lines are commented out, so nvidia’s libraries are not found.

Remove the ‘#’ sign from both lines and run “sudo ldconfig”, and hopefully the driver will work again.

Huzzah! That did the trick. Thanks a lot for your help. Not entirely sure why those lines were commented out, but it’s entirely possible that I was following someone else’s (apparently bad) advice during initial setup.

Thanks again.

I’m posting because this issue happened again after doing another system update. The two lines in /etc/ld.so.conf.d/nvidia-gfxG04.conf are once again commented out, so I’m going to un-comment them, run ldconfig, and hope that fixes it. But this means that something during the upgrade process is commenting out these lines, since I certainly didn’t do it.

EDIT: Yep, same solution fixed it.

I just opened a bug on the openSUSE bug tracker (not sure if it’s the right place, but Novell’s bug tracker was impossible to navigate): https://bugzilla.opensuse.org/show_bug.cgi?id=972035

I also managed to make this issue 100% reproducible. Re-installing the nvidia-glG04 package comments out the contents of /etc/ld.so.conf.d/nvidia-gfxG04.conf every time.

As explained in your bug report, the packages do comment out the contents of that file if they think you are using an Optimus system (to not break the Intel driver which is used to run the graphical session).
In your case this detection seems to be wrong then, and a bug report was the best thing to do (and yes, it is at the right place).

You could create your own file in /etc/ld.so.conf.d/ (e.g. /etc/ld.so.conf.d/mynvidia-gfxG04.conf, the exact name doesn’t matter but it has to end in .conf) with the uncommented content as workaround, to not having to edit the file after each nvidia update.