Recent Cuda+Nvidia driver on bumblebee system breaks x-server, here's a workaround

Hello,
I have a Cuda+Nvidia+Bumblebee setup in my laptops, and there was an official cuda update supported for OpenSUSE LEAP 15.0+. If you use the default version in the repository and associated Nvidia driver, the X-server becomes broken.

Thankfully from experience I found out what it was and I was able to fix it. Here’s what to check first:

startx

and check the error code, in my case, there was an error in reading one of the entries in

/etc/X11/xorg.conf.d

At this Nvidia update, for some reason the driver updates and installed:

90-nvidia.conf.

I deleted it and re-compiled kernel by:

sudo mv /etc/X11/xorg.conf.d/90-nvidia.conf/ ~/ 
sudo mkinitrd

I just wanted to share for the sake of documentation and beginners using similar setup.

There seems to be a more serious issue that I need to resolve. It seems that intel integrated GPU is not being loaded properly.

cat /var/log/Xorg.0.log |grep intel
    12.360] (==) Matched intel as autoconfigured driver 0
    12.360] (II) LoadModule: "intel"
    12.361] (WW) Warning, couldn't open module intel
    12.361] (EE) Failed to load module "intel" (module does not exist, 0)

I installed xf86-video-intel

sudo zypper in xf86-video-intel

and the xorg log shows the following:


cat /var/log/Xorg.0.log |grep intel
    12.000] (==) Matched **intel** as autoconfigured driver 0
    12.000] (II) LoadModule: "**intel**"
    12.000] (II) Loading /usr/lib64/xorg/modules/drivers/**intel**_drv.so
    12.003] (II) Module **intel**: vendor="X.Org Foundation"
    12.006] (II) **intel**: Driver for Intel(R) Integrated Graphics Chipsets:
    12.006] (II) **intel**: Driver for Intel(R) HD Graphics
    12.006] (II) **intel**: Driver for Intel(R) Iris(TM) Graphics
    12.006] (II) **intel**: Driver for Intel(R) Iris(TM) Pro Graphics
    12.029] (II) **intel**(0): Using Kernel Mode Setting driver: i915, version 1.6.0 20180719
    12.031] (--) **intel**(0): gen9 engineering sample
    12.031] (--) **intel**(0): CPU: x86-64, sse2, sse3, ssse3, sse4.1, sse4.2, avx, avx2; using a maximum of 4 thre
ads
    12.031] (II) **intel**(0): Creating default Display subsection in Screen section
    12.031] (==) **intel**(0): Depth 24, (--) framebuffer bpp 32
    12.031] (==) **intel**(0): RGB weight 888
    12.031] (==) **intel**(0): Default visual is TrueColor
    12.032] (II) **intel**(0): Output eDP1 has no monitor section
    12.032] (**) **intel**(0): Found backlight control interface **intel**_backlight (type 'raw') for output eDP1
    12.032] (II) **intel**(0): Enabled output eDP1
    12.032] (II) **intel**(0): Output DP1 has no monitor section
    12.032] (II) **intel**(0): Enabled output DP1
    12.032] (II) **intel**(0): Output HDMI1 has no monitor section
    12.032] (II) **intel**(0): Enabled output HDMI1
    12.032] (II) **intel**(0): Output DP2 has no monitor section
    12.033] (II) **intel**(0): Enabled output DP2
    12.033] (II) **intel**(0): Output HDMI2 has no monitor section
    12.033] (II) **intel**(0): Enabled output HDMI2
    12.033] (--) **intel**(0): Using a maximum size of 256x256 for hardware cursors
    12.033] (II) **intel**(0): Output VIRTUAL1 has no monitor section
    12.033] (II) **intel**(0): Enabled output VIRTUAL1
    12.033] (--) **intel**(0): Output eDP1 using initial mode 2560x1440 on pipe 0
    12.033] (==) **intel**(0): TearFree enabled
    12.033] (==) **intel**(0): Using gamma correction (1.0, 1.0, 1.0)
    12.033] (==) **intel**(0): DPI set to (96, 96)
    12.034] (II) **intel**(0): SNA initialized with Kabylake (gen9) backend
    12.034] (==) **intel**(0): Backing store enabled
    12.034] (==) **intel**(0): Silken mouse enabled
    12.034] (II) **intel**(0): HW Cursor enabled
    12.034] (==) **intel**(0): DPMS enabled
    12.034] (==) **intel**(0): Display hotplug detection enabled
    12.034] (II) **intel**(0): [DRI2] Setup complete
    12.034] (II) **intel**(0): [DRI2]   DRI driver: i965
    12.034] (II) **intel**(0): [DRI2]   VDPAU driver: va_gl
    12.034] (II) **intel**(0): direct rendering: DRI2 enabled
    12.034] (II) **intel**(0): hardware support for Present enabled
    12.041] (II) **intel**(0): switch to mode 2560x1440@60.0 on eDP1 using pipe 0, position (0, 0), rotation normal
, reflection none
    12.044] (II) **intel**(0): Setting screen physical size to 677 x 381
    14.035] (II) **intel**(0): EDID vendor "AUO", prod id 9014
    14.035] (II) **intel**(0): Printing DDC gathered Modelines:
    14.035] (II) **intel**(0): Modeline "2560x1440"x0.0  245.50  2560 2608 2640 2720  1440 1443 1448 1504 -hsync -v
sync (90.3 kHz eP)

For an odd reason, I can no longer run Steam with intel card, then pipe games through bumblebee.

When I try to launch steam using intel card, I get the following error:

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

but I can still launch steam from

optirun steam

Another development is that anything that requires compositor such as opening and closing Application Launcher menu takes almost 1 second instead of instantaneous response.

Any suggestions?

Full solution, instead of work around found:
https://forums.opensuse.org/showthread.php/538420-Broken-X-server-from-latest-repository-default-Nvidia-driver?p=2921687#post2921687

Summary:

  1. You need the new nvidia configuration file created during installation gone:

sudo rm /etc/X11/xorg.conf.d/90-nvidia.conf/
sudo mkinitrd

  1. You need to re-set the default libglx provided by xorg:
sudo update-alternatives --config libglx.so

and choose

/usr/lib64/xorg/modules/extensions/xorg/xorg-libglx.so

  1. Just to make sure that this libglx stays as automatic default, set its priority higher than one provided with Nvidia.
sudo update-alternatives --install /usr/lib64/xorg/modules/extensions/libglx.so libglx.so /usr/lib64/xorg/modules/extensions/xorg/xorg-libglx.so  120

The end result should look like this:


~> sudo update-alternatives --config libglx.so
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/xorg/xorg-libglx.so       120       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       120       manual mode

Press <enter> to keep the current choice
  1. , or type selection number: 

  1. Reboot and enjoy

Full solution, instead of work around found:
https://forums.opensuse.org/showthread.php/538420-Broken-X-server-from-latest-repository-default-Nvidia-driver?p=2921687#post2921687

Summary:

  1. You need the new nvidia configuration file created during installation gone:

sudo rm /etc/X11/xorg.conf.d/90-nvidia.conf/
sudo mkinitrd

  1. You need to re-set the default libglx.so to the one provided by xorg instead provided by Nvidia:
sudo update-alternatives --config libglx.so

and choose

/usr/lib64/xorg/modules/extensions/xorg/xorg-libglx.so

  1. Just to make sure that this libglx stays as automatic default, set its priority higher than one provided with Nvidia.
sudo update-alternatives --install /usr/lib64/xorg/modules/extensions/libglx.so libglx.so /usr/lib64/xorg/modules/extensions/xorg/xorg-libglx.so  120

The end result should look like this:


~> sudo update-alternatives --config libglx.so
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/xorg/xorg-libglx.so       120       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       120       manual mode

Press <enter> to keep the current choice, or type selection number: 
  1. Reboot and enjoy

=====================================Ending Above =====================================
Thank you,
-SJL