Nvidia fails to load driver "swrast"

Horrible story: Bought an Lenovo T 420s with “optimus”: two GPUs, a nvidia (Model: GF119 [Quadro NVS 4200M]) and an intel (integrated)

Sometimes I need the DisplayPort, which has been connected to the nvidia card, but not to the intel thing. So I can not use bumblebee, because bumblebee only uses the nvidia to support the intel gpu: with bumblebee the DisplayPort remains unuseable.

OK. I can switch in the Bios between Intel and nvidia. Usually I use the Intel card, but once in a while I need the nvidia card. So I installed the nvidia driver NVIDIA 346.35 from the repo.

Some friendly people provided a kind of switch:


#! /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 | egrep 'VGA|3D');

#Make shure we are in command of /usr/X11R6/lib
if  -e /etc/ld.so.conf.d/nvidia-gfxG0*.conf ]; then
    /bin/rm /etc/ld.so.conf.d/nvidia-gfxG0*.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
      /sbin/ldconfig
      if  -e /etc/X11/xorg.conf ]; then
          mv /etc/X11/xorg.conf /etc/X11/xorg.conf.nvidia
      fi
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
    if  -e /etc/X11/xorg.conf.nvidia ]; then
        mv /etc/X11/xorg.conf.nvidia /etc/X11/xorg.conf
    fi
fi



Unfortunately this does not work properly. When I switch to nvidia in the Bios, boot openSuse 13.2, start KDE and e.g. start nvidia-settings, I get:


 nvidia-settings 
libGL error: No matching fbConfigs or visuals found
libGL error: failed to load driver: swrast
[VS] Software VDPAU backend library initialized
libGL error: No matching fbConfigs or visuals found
libGL error: failed to load driver: swrast
libva info: VA-API version 0.34.0
libva info: va_getDriverName() returns 0
libva info: Trying to open /usr/lib64/dri/nvidia_drv_video.so
libva info: va_openDriver() returns -1
Package xorg-server was not found in the pkg-config search path.
Perhaps you should add the directory containing `xorg-server.pc'
to the PKG_CONFIG_PATH environment variable
No package 'xorg-server' found



I know, I should have given back this notebook and have purchased another one. Anyway, could someone help?

Uninstall the package libvdpau_va_gl1. This redirects nvidia’s VDPAU to intel’s VA-API which breaks nvidia-settings.
HW decoding with VDPAU will not work on the intel chip then, but most players support VA-API anyway.

That did not help, unfortunately.

Maybe this is a useful information ?! :


sudo ldconfig -p |grep libGL
root's password:
        libGLU.so.1 (libc6,x86-64) => /usr/lib64/libGLU.so.1
        libGLU.so.1 (libc6) => /usr/lib/libGLU.so.1
        libGLEWmx.so.1.10 (libc6,x86-64) => /usr/lib64/libGLEWmx.so.1.10
        libGLEW.so.1.10 (libc6,x86-64) => /usr/lib64/libGLEW.so.1.10
        libGLESv2.so.2 (libc6,x86-64) => /usr/lib64/libGLESv2.so.2
        libGLESv2.so.2 (libc6) => /usr/X11R6/lib/libGLESv2.so.2
        libGLESv1_CM.so.1 (libc6) => /usr/X11R6/lib/libGLESv1_CM.so.1
        libGL.so.1 (libc6,x86-64) => /usr/lib64/libGL.so.1
        libGL.so.1 (libc6) => /usr/X11R6/lib/libGL.so.1
        libGL.so.1 (libc6) => /usr/lib/libGL.so.1

And glxinfo:

glxinfo
name of display: :0
libGL error: No matching fbConfigs or visuals found
libGL error: failed to load driver: swrast
display: :0  screen: 0
direct rendering: No (If you want to find out why, try setting LIBGL_DEBUG=verbose)
server glx vendor string: NVIDIA Corporation
server glx version string: 1.4
server glx extensions:


This is a frustrating waste of precious time.

Made update to new nvida driver (346.59). Works. But the Intel-GPU no longer. Finish.

And how did you install it?
If you used the .run installer, it will overwrite system files. No way to get the intel driver working with a single script then.

Regarding your general problem:
If this new laptop is a real “Optimus” system, your method of switching between intel and nvidia is not going to work either, as only the intel chip is connected to the display. You have to use Bumblebee then to be able to switch between the two.

Can you please post your Xorg.0.log in both cases? I.e. when (supposedly) using nvidia and when using intel?
And please also post the output of “/sbin/lspci” in both cases. Maybe the script doesn’t correctly detect the intel chip (or the nvidia for that matter)?

Oh, and the script worked fine on your old system.
But that was with the G03 driver, right?

Or is this still the same system?
In that case: what did you change? Only upgrading the nvidia driver?

Thank you very much for your time and effort. I decided to buy a new notebook without nvidia chips. Horrible linux driver, and the whole idea of optimus is sick. Never again.

You are probably right, the script does not detect properly, whether the intel or the nvidia chip is “on”. But if you and I invest some more time to amend the script and it works — in three weeks there will change something else and the whole nonsense starts again. I had a look into theo old xorg-log and it startet loading the nvidia driver. Maybe there is a function in the kernel to load the same modules than last time…

Have a nice weekend,

Alexander

Here’s my output, although not an Optimus system they shouldn’t differ.

ldconfig -p |grep libGL  
    libGLU.so.1 (libc6,x86-64) => /usr/lib64/libGLU.so.1
    libGLU.so.1 (libc6) => /usr/lib/libGLU.so.1
    libGLEWmx.so.1.10 (libc6,x86-64) => /usr/lib64/libGLEWmx.so.1.10
    libGLEW.so.1.10 (libc6,x86-64) => /usr/lib64/libGLEW.so.1.10
    libGLESv2.so.2 (libc6,x86-64) => /usr/X11R6/lib64/libGLESv2.so.2
    libGLESv2.so.2 (libc6) => /usr/X11R6/lib/libGLESv2.so.2
    libGLESv1_CM.so.1 (libc6,x86-64) => /usr/X11R6/lib64/libGLESv1_CM.so.1
    libGLESv1_CM.so.1 (libc6) => /usr/X11R6/lib/libGLESv1_CM.so.1
    libGL.so.1 (libc6,x86-64) => /usr/X11R6/lib64/libGL.so.1
    libGL.so.1 (libc6,x86-64) => /usr/lib64/libGL.so.1
    libGL.so.1 (libc6) => /usr/X11R6/lib/libGL.so.1
    libGL.so.1 (libc6) => /usr/lib/libGL.so.1
    libGL.so (libc6,x86-64) => /usr/X11R6/lib64/libGL.so
    libGL.so (libc6,x86-64) => /usr/lib64/libGL.so



The stuff in /usrX11R6/* is installed by nvidia-glG0* and x11-video-nvidiaG0* , are those packages installed and up to date?

You have to go at NVIDIA site. They have auto detect GPU. Likewise, intel driver have auto detect. Just go to their site.

And how should this help?

The intel driver is included in the distribution anyway, no need to go to their site.

The problem is that installing the nvidia driver overwrites certain system files, which breaks Mesa and therefore the intel driver.

Dear wolfi,
dear hank_se,

thank you very much for your help during the last three years. I swaped that notebook for another one, without any trace of this horrible nvidia / optimus nonsense.

Alexander