Installing NVIDIA on modern machines ending disastrously

Hello,
I currently am focusing on two machines with OpenSUSE LEAP 42.3 LEAP.
Z: Lenovo T480 with MX150 dGPU
T: A desktop with NVIDIA GTX 1070

My previous experience with Lenovo T430 and W530 resulted in hogging onto Nouveau and optimizing it as much as I can, and recently I’ve been trying to be a bit more adventurous and ended up spending hours fixing the damage I’ve done (mind you I am also holding onto ext4 with all my might). There are three sets of instructions I followed:
For Z I’ve done:
https://en.opensuse.org/SDB:NVIDIA_Bumblebee
//The middle of this instruction points to one below as “optional” but it is couter-productive because nvidia-bumblebee conflicts with x11-video. I suspect in fact, this breaks the install because we’re asked to recompile the kernel with the Nvidia modules, and then it gets deleted by installing nvidia-bumblebee

https://en.opensuse.org/SDB:NVIDIA_drivers
//zypper inr -r NVIDIA actually recommends not installing anything, but I tell it to install latest x11-video because it supports the dGPU.

I blacklist nouveau and nvidia and optirun fails to start dGPU and compositor constantly crashes.

https://en.opensuse.org/SDB:NVIDIA_the_hard_way
//NVDIA driver flat out refuses to install unless nouveau has been effectively uninstalled, not just disabled. Even with nouveau gone from kernel module, it still refuses to install.

It took me several hours but I was able to re-install the older kernel, recompile without broken nvidia references, and unblock nouveau completely.

For T I’ve done:
https://en.opensuse.org/SDB:NVIDIA_drivers
//Sure enough, everything installs well, and boots fine, but cannot start KDE and xshell locally. Ironically, I can start xshell remotely just fine.
https://en.opensuse.org/SDB:NVIDIA_the_hard_way
//Same problem, simply won’t realize that nouveau has been wiped clean out of the drive and doesn’t install.

I am a little bit lost here, am I the only one who is having trouble with NVIDIA linux drivers? The only machine I have it working with is (with bumblebee) is Lenovo T430 with OpenSUSE 13.2 KDE!

Update:
Latest Nvidia driver version 410.93 from their website has successfully been installed on T, and xserver is working locally as well

I spoke too soon, compositor and xserver crashes within the first 5 minutes.

Hi
Hmmm, the latest is 418.30?
https://download.nvidia.com/XFree86/Linux-x86_64/

I’m running that on Tumbleweed though, with a GT710 card…

T seems to be only capable of running OpenGL 3.1 compositor. XRender constantly crashes and OpenGL 2.0 is… ugly.

Sorry, I meant latest recommended by Nvidia website (Linux x64 (AMD64/EM64T) Display Driver | 410.93 | Linux 64-bit | NVIDIA)

Spoke too soon yet again, OpenGL 3.1 seems to crash after 30 mins. Currently crash testing OpenGL 2.0 I am curious though. How is it that Nouveau seem more compatible and stable than the proprietary drivers which are meant to be better?

Out of curiosity: Your repos?

zypper lr -d

Z repos:

Repository priorities are without effect. All enabled repositories share the same priority.

#  | Alias                     | Name                                    | Enabled | GPG Check | Refresh | Priority | Type   | URI                                                         
                 | Service
---+---------------------------+-----------------------------------------+---------+-----------+---------+----------+--------+-------------------------------------------------------------
-----------------+--------
 1 | NVIDIA                    | NVIDIA                                  | No      | ----      | ----    |   99     | rpm-md | https://download.nvidia.com/opensuse/leap/42.3              
                 |         
 2 | X11_Bumblebee             | Bumblebee project (openSUSE_Leap_42.3)  | No      | ----      | ----    |   99     | rpm-md | http://download.opensuse.org/repositories/X11:/Bumblebee/ope
nSUSE_Leap_42.3/ |         
 3 | google-chrome             | google-chrome                           | Yes     | (r ) Yes  | Yes     |   99     | rpm-md | http://dl.google.com/linux/chrome/rpm/stable/x86_64         
                 |         
 4 | kernel                    | kernel                                  | No      | ----      | ----    |   99     | rpm-md | http://download.opensuse.org/repositories/Kernel:/stable/sta
ndard/           |         
 5 | libdvdcss                 | libdvdcss                               | Yes     | (r ) Yes  | Yes     |   99     | rpm-md | http://opensuse-guide.org/repo/openSUSE_Leap_42.3/          
                 |         
 6 | openSUSE-Leap-42.3-0      | openSUSE-Leap-42.3-0                    | No      | ----      | ----    |   99     | yast2  | cd:///?devices=/dev/disk/by-id/scsi-S__%5Cx5b               
                 |         
 7 | packman                   | packman                                 | Yes     | (r ) Yes  | Yes     |   99     | rpm-md | http://packman.inode.at/suse/openSUSE_Leap_42.3/            
                 |         
 8 | repo-debug                | openSUSE-Leap-42.3-Debug                | No      | ----      | ----    |   99     | NONE   | http://download.opensuse.org/debug/distribution/leap/42.3/re
po/oss/          |         
 9 | repo-debug-non-oss        | openSUSE-Leap-42.3-Debug-Non-Oss        | No      | ----      | ----    |   99     | NONE   | http://download.opensuse.org/debug/distribution/leap/42.3/re
po/non-oss/      |         
10 | repo-debug-update         | openSUSE-Leap-42.3-Update-Debug         | No      | ----      | ----    |   99     | NONE   | http://download.opensuse.org/debug/update/leap/42.3/oss/    
                 |         
11 | repo-debug-update-non-oss | openSUSE-Leap-42.3-Update-Debug-Non-Oss | No      | ----      | ----    |   99     | NONE   | http://download.opensuse.org/debug/update/leap/42.3/non-oss/
                 |         
12 | repo-non-oss              | openSUSE-Leap-42.3-Non-Oss              | Yes     | (r ) Yes  | Yes     |   99     | yast2  | http://download.opensuse.org/distribution/leap/42.3/repo/non
-oss/            |         
13 | repo-oss                  | openSUSE-Leap-42.3-Oss                  | Yes     | (r ) Yes  | Yes     |   99     | yast2  | http://download.opensuse.org/distribution/leap/42.3/repo/oss
/                |         
14 | repo-source               | openSUSE-Leap-42.3-Source               | No      | ----      | ----    |   99     | NONE   | http://download.opensuse.org/source/distribution/leap/42.3/r
epo/oss/         |         
15 | repo-source-non-oss       | openSUSE-Leap-42.3-Source-Non-Oss       | No      | ----      | ----    |   99     | NONE   | http://download.opensuse.org/source/distribution/leap/42.3/r
epo/non-oss/     |         
16 | repo-update               | openSUSE-Leap-42.3-Update               | Yes     | (r ) Yes  | Yes     |   99     | rpm-md | http://download.opensuse.org/update/leap/42.3/oss/          
                 |         
17 | repo-update-non-oss       | openSUSE-Leap-42.3-Update-Non-Oss       | Yes     | (r ) Yes  | Yes     |   99     | rpm-md | http://download.opensuse.org/update/leap/42.3/non-oss/      
                 |                                                                    
18 | skype-stable              | skype (stable)                          | Yes     | (r ) Yes  | Yes     |   99     | rpm-md | https://repo.skype.com/rpm/stable/                          
                 |                                                                    
19 | slack                     | slack                                   | Yes     | (r ) Yes  | Yes     |   99     | rpm-md | https://packagecloud.io/slacktechnologies/slack/fedora/21/x8
6_64  

T repos:

#  | Alias                     | Name                                    | Enabled | GPG Check | Refresh | Priority | Type   | URI                                                         
             | Service
---+---------------------------+-----------------------------------------+---------+-----------+---------+----------+--------+-------------------------------------------------------------
-------------+--------
 1 | NVIDIA                    | NVIDIA                                  | No      | ----      | ----    |   99     | rpm-md | https://download.nvidia.com/opensuse/leap/42.3              
             |         
 2 | dvd                       | dvd                                     | Yes     | (r ) Yes  | Yes     |   99     | rpm-md | http://opensuse-guide.org/repo/openSUSE_Leap_42.3/          
             |         
 3 | google-chrome             | google-chrome                           | Yes     | (r ) Yes  | Yes     |   99     | rpm-md | http://dl.google.com/linux/chrome/rpm/stable/x86_64         
             |         
 4 | openSUSE-Leap-42.3-0      | openSUSE-Leap-42.3-0                    | No      | ----      | ----    |   99     | yast2  | cd:///?devices=/dev/disk/by-id/ata-HL-DT-ST_DVDRAM_GH24NSD1_
KESI5MA4632  |         
 5 | packman                   | packman                                 | Yes     | (r ) Yes  | Yes     |   99     | rpm-md | http://packman.inode.at/suse/openSUSE_Leap_42.3/            
             |         
 6 | repo-debug                | openSUSE-Leap-42.3-Debug                | No      | ----      | ----    |   99     | NONE   | http://download.opensuse.org/debug/distribution/leap/42.3/re
po/oss/      |         
 7 | repo-debug-non-oss        | openSUSE-Leap-42.3-Debug-Non-Oss        | No      | ----      | ----    |   99     | NONE   | http://download.opensuse.org/debug/distribution/leap/42.3/re
po/non-oss/  |         
 8 | repo-debug-update         | openSUSE-Leap-42.3-Update-Debug         | No      | ----      | ----    |   99     | NONE   | http://download.opensuse.org/debug/update/leap/42.3/oss/    
             |         
 9 | repo-debug-update-non-oss | openSUSE-Leap-42.3-Update-Debug-Non-Oss | No      | ----      | ----    |   99     | NONE   | http://download.opensuse.org/debug/update/leap/42.3/non-oss/
             |         
10 | repo-non-oss              | openSUSE-Leap-42.3-Non-Oss              | Yes     | (r ) Yes  | Yes     |   99     | yast2  | http://download.opensuse.org/distribution/leap/42.3/repo/non
-oss/        |         
11 | repo-oss                  | openSUSE-Leap-42.3-Oss                  | Yes     | (r ) Yes  | Yes     |   99     | yast2  | http://download.opensuse.org/distribution/leap/42.3/repo/oss
/            |         
12 | repo-source               | openSUSE-Leap-42.3-Source               | No      | ----      | ----    |   99     | NONE   | http://download.opensuse.org/source/distribution/leap/42.3/r
epo/oss/     |         
13 | repo-source-non-oss       | openSUSE-Leap-42.3-Source-Non-Oss       | No      | ----      | ----    |   99     | NONE   | http://download.opensuse.org/source/distribution/leap/42.3/r
epo/non-oss/ |         
14 | repo-update               | openSUSE-Leap-42.3-Update               | Yes     | (r ) Yes  | Yes     |   99     | rpm-md | http://download.opensuse.org/update/leap/42.3/oss/          
             |         
15 | repo-update-non-oss       | openSUSE-Leap-42.3-Update-Non-Oss       | Yes     | (r ) Yes  | Yes     |   99     | rpm-md | http://download.opensuse.org/update/leap/42.3/non-oss/      
             |         
16 | skype-stable              | skype (stable)                          | Yes     | (r ) Yes  | Yes     |   99     | rpm-md | https://repo.skype.com/rpm/stable/                          
   

I’m sorry, I actually found the solution before but I cannot find it with search anymore for some reason.

Is there a way to force zypper not to update the kernel? On T, only the kernel 4.4.165-81-default is stable with the Nvidia driver. The recent kernel-default-4.4.172-86.1 update actually breaks the setup. I want to keep the OS updated, except for the kernel. For the most part, I think some blacklisting gets ignored and latest kernel gets stuck in a loop trying to load Nouveau.

I have it done with YAST for the time being by setting the kernel-default as “protected, do not modify”, but I forgot the zypper command.

Thank you for your time.

Yes, you can lock packages, even the nvidia ones. F.e.


sudo zypper al kernel-default

Just a grand-closure for this thread and Nvidia/bumblebee setup I was able to do the following:

  1. Install LEAP 15.0 fresh, without nouveau activated (otherwise the laptop freezes and cannot boot)
    Do not upgrade as it often installs nouveau somehow.
  2. Add Nvidia repo for LEAP 15.
    https://en.opensuse.org/SDB:NVIDIA_drivers
  3. Add CUDA repo for LEAP 15.
    https://developer.nvidia.com/cuda-downloads
  4. Install cuda which installs the Nvidia.
  5. reboot, update then reboot again.
  6. Install Codecs then reboot.
    https://opensuse-guide.org/codecs.php

Below steps only apply to laptops with dual graphics (Lenovo T480, Lenovo W430, Alienware 15, Toughbook CF-31, Lenovo T420, Lenovo T430)
7. Install bumblebee with some modification
https://en.opensuse.org/SDB:NVIDIA_Bumblebee
You don’t need to make symbollic link to

...X11R6/

and instead when configuring

etc/bumblebee/bumblebee.conf 

set the nvidia path to the following


[driver-nvidia]
LibraryPath=/usr/lib64:/usr/libI also did not add bumblebee repo and did not install the bumblebee nvidia drivers as they are not compatible with cuda 10.1

Then I update and reboot.
8. I change the application launcher to use the following for nvidia-settings


optirun -b none nvidia-settings -c :8

and in some cases set


/etc/modprobe.d/50-bbswitch.conf

and change the line to


options bbswitch load_state=-1 unload_state=1

This was required for all Lenovo laptops I have.

Now I can freely enjoy GPU programming+bumblebee+nvidia + make sure the computer is used fully. In a different topic, I also installed thinkfan to control the temperatures better as the default settings were quite bad (fan starts at 55 degrees celsius) and laptops constantly overheated.

Be mindful of the sequence, as I have tried mixing up the sequence and it made a lot of mess whenever I did and I had to re-install from beginning.