#1077266 glx-diversions: does not divert libGLX.so

#1077266#5
Date:
2024-07-27 14:20:47 UTC
From:
To:
glx-diversions diverts /usr/lib/x86_64-linux-gnu/libGL.so to
/etc/alternatives/glx--libGL.so-x86_64-linux-gnu which can be
controlled by update-glx --config glx.

But libGLX.so remains static:

$ ls -l /usr/lib/x86_64-linux-gnu/libGLX.so.0.0.0
-rw-r--r-- 1 root root 141736 Apr 27 14:53
/usr/lib/x86_64-linux-gnu/libGLX.so.0.0.0
$ dpkg -S /usr/lib/x86_64-linux-gnu/libGLX.so.0.0.0
libglx0:amd64: /usr/lib/x86_64-linux-gnu/libGLX.so.0.0.0


I think this explains why the nvidia drivers are not working in
OFFLOAD (optimus) mode, e.g.
$ __NV_PRIME_RENDER_OFFLOAD=1  __GLX_VENDOR_LIBRARY_NAME=nvidia __VK_LAYER_NV_optimus=NVIDIA_only  glxinfo
name of display: :0
X Error of failed request:  BadValue (integer parameter out of range for operation)
  Major opcode of failed request:  152 (GLX)
  Minor opcode of failed request:  24 (X_GLXCreateNewContext)
  Value in failed request:  0x0
  Serial number of failed request:  50
  Current serial number in output stream:  51


I suspect this error would not occur if libGLX.so was diverted (given
an alternative) to libGLX_nvidia.so.0
(handled by update-glx --config glx, ultimately
/usr/lib/x86_64-linux-gnu/nvidia/current/libGLX_nvidia.so.0
from libglx-nvidia0)


For what it's worth, nvidia now provides a fully supported open source kernal
module, nvidia-open-kernel-dkms, so the nvidia driver is essentially no
longer non-free. Please help them complete this change of policy by
supporting use of the driver.