"Xlib: extension "GLX" missing on display ":0"." -- special case ...

I’ve got one of those “optimus” Notebooks. But usually I only use the Intel integrated GPU. So I switched off the discrete Nvidia GPU in the BIOS. hank_se provided this code, which I saved as /etc/init.d/boot.local:


#! /bin/sh
#
# Copyright (c) 2002 SuSE Linux AG Nuernberg, Germany.  All rights reserved.
#
# Author: Werner Fink, 1996
#         Burchard Steinbild, 1996
#
# /etc/init.d/boot.local
#
# script with local commands to be executed from init on system startup
#
# Here you should add things, that should happen directly after booting
# before we're going to the first run level.
#

mode=$(/sbin/lspci | grep VGA);#Make shure we are in command of /usr/X11R6/lib
if  -e /etc/ld.so.conf.d/nvidia-gfxGO3.conf ]; then
    /bin/rm /etc/ld.so.conf.d/nvidia-gfxGO3.conf
fi  
#Check graphics mode and take apropriate action
if  `echo $mode | grep -c "Intel" ` -gt 0 ]; then
if  -e /usr/lib64/xorg/modules/updates/extensions/libglx.so ]; then
    /bin/rm /usr/lib64/xorg/modules/updates/extensions/libglx.so
fi 
if  -e /usr/X11R6/lib/libGL.so.1 ]; then
    /bin/rm /usr/X11R6/lib/libGL.so.1
    /bin/rm /usr/X11R6/lib64/libGL.so.1
fi


#Else we must be in Nvidia mode
else
    /bin/ln -s /usr/lib64/xorg/modules/updates/extensions/libglx.so.* /usr/lib64/xorg/modules/updates/extensions/libglx.so
    /sbin/ldconfig /usr/X11R6/lib
    /sbin/ldconfig /usr/X11R6/lib64    
fi

This is a kind of switch. If the Nvidia module is active, do …

Once in a while I reboot and switch to the discrete Nvidia card in BIOS. It works, but without 3D. If I type

glxinfo

I get:

name of display: :0
Xlib:  extension "GLX" missing on display ":0".
Xlib:  extension "GLX" missing on display ":0".
Xlib:  extension "GLX" missing on display ":0".
Xlib:  extension "GLX" missing on display ":0".
Xlib:  extension "GLX" missing on display ":0".
Xlib:  extension "GLX" missing on display ":0".
Xlib:  extension "GLX" missing on display ":0".
Error: couldn't find RGB GLX visual or fbconfig
Xlib:  extension "GLX" missing on display ":0".
Xlib:  extension "GLX" missing on display ":0".

I’m on openSuse 13.2 on an Thinkpad T420s and this is one of the last bits to make this installation close to perfect (ok, except for kmail, sigh). Any help much appreciated, how to get GLX working under Nvidia.

I did’t install the driver the hard way, but from the Nvidia-repo as package.

Regards,

Alexander

There was a slight change of the file layout in 13.2, you can try this in boot.local instead.

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

There was a slight change of the file layout in 13.2, you can try this in boot.local instead.

What would I do without your help? Saved to file, put in /etc/init.d/boot.local, rebooted, perfect.

Thank you – again.

Regards,

Alexander