Best way to install NVIDIA driver

Hello, I have a laptop running Windows with an NVIDIA RTX 2070, and I was interested in switching to Linux, particularly Tumbleweed. After a good amount of research, I have come across two possible ways to install the NVIDIA driver…

  1. Recommended by the OpenSUSE wiki via https://en.opensuse.org/SDB:NVIDIA_drivers, you have to use the community NVIDIA repos and install the NVIDIA KMP driver.
  2. Not recommended, install the .run file from the NVIDIA website and install with DKMS.

I believe these are referred to as “the easy way” and “the hard way” respectively. My understanding is that either method has pros and cons.

Method 1 Pros

  • Driver is built to work with kernel provided by OpenSUSE repos
  • Easily update driver with sudo zypper dup

Method 1 Cons

  • Driver only works with kernel provided by OpenSUSE repos
  • Cannot install other kernels and use NVIDIA driver
  • NVIDIA driver must be updated in community repo when a new kernel is available, otherwise it won’t work

Method 2 Pros

  • Can install other kernels and have driver still work
  • Can get most recent driver from NVIDIA website
  • Driver automatically rebuilds when new kernel is installed

Method 2 Cons

  • Not recommended by OpenSUSE wiki
  • Driver built for general Linux use, not specifically built or tested for OpenSUSE
  • Requires manual installation to update driver with each new release

If my understanding is incomplete, please correct me.

Before I decide that I want to install Tumbleweed, I would like to know which method is actually better, despite the first being recommended. Specifically, has anyone had any issues when it comes to updates? Is the NVIDIA experience on Tumbleweed good or is it buggy sometimes? My next choice for a distro is Fedora 42, and I want to hear from the community before I make a choice.

Thank you!

That really depends on your HW and your use case. If you have a pretty standard laptop and you are an average user, the “easy” way is what you need: just update by zypper dup and forget about it.
If you have an “unusual” HW setup (multiple GPUs, mixed tecnologies…) and/or you are a developer or tester or just an “advanced experimenter” you may have better control and customizable installs with “the hard way”.
With Tumbleweed expect the occasional glitch with either method, given the frequent kernel updates: generally they go smooth, but better to keep the last couple of old kernels just in case. Anyway problems get fixed in a week or so in most cases.

Anyway, you can get some assistance here on the Forums.

@eclipse User @deebido may offer some insight to a recent install the ‘hard way’?

1 Like

I’ll do my best @malcolmlewis

First of all, welcome to the forum @eclipse !

You’re pretty spot on. I’ll elaborate on a few things.

Regarding Method 1 from the official Nvidia repo NVIDIA:repo-non-free
This will most likely be added on a new install already and where it will pull new recommends from.

Recommended by the OpenSUSE wiki via SDB:NVIDIA drivers - openSUSE Wiki, you have to use the community NVIDIA repos and install the NVIDIA KMP driver.

Shouldn’t exclusively need community repos for Nvidia drivers. If you open YaST2 on a new install, you will see the Nvidia packages you need already selected and you can click save and they will install. This would be the same as running sudo zypper install-new-recommendsafter logging in a new install.

NVIDIA driver must be updated in community repo when a new kernel is available, otherwise it won’t work

This isn’t completely true I believe. You just need to make sure the Nvidia KMP rebuilds when you get a kernel update. Sometimes it didn’t rebuild automatically for me and in those cases I would run the command sudo zypper in -f nvidia-driver-G06-kmp-default. Force reinstalling this package and rebuild with the new kernel.

Cannot install other kernels and use NVIDIA driver

If you’re talking about zen-kernel etc, I can’t elaborate on this one, I have only used kernels provided by openSUSE but I would think it would be the same as making sure the Nvidia KMP rebuilds with it and it will work as expected.

Regarding Method 2:The Hard Way

Can install other kernels and have driver still work

If you’re talking about other kernels like the zen-kernel? This is something @malcolmlewis can possibly elaborate on further. I assume you would install the new kernel first and then the execute the .run file but I don’t know for sure. That’s how I would do it.

Driver automatically rebuilds when new kernel is installed

In theory, yes. I have not had the chance to deal with this yet but if you follow the guide then I would expect those results with dkms.

A little more info
If you choose to go with the .run file and have secure boot enabled, it will give you the key location to import into mokutil. Something like /usr/share/nvidia/nvidia-modsign-crt-12A345B.der You will need that to run sudo mokutil --import /usr/share/nvidia/nvidia-modsign-crt-12A345B.der when you are done with the .run file Also make sure nvidia-drm.modeset=1and fbdev=1 are in your kernel parameters. Reboot and you get the mokutil screen like in the guide. Follow the steps from the guide for that screen.

This next part you’ll want to do with or without secure boot. make this file or edit it /etc/modprobe.d/50-nvidia-tweaks.conf and add

blacklist nouveau
options nouveau modeset=0
##Power Management
## Disable runtime D3 power management features
##options nvidia NVreg_DynamicPowerManagement=0x00
## Allow the GPU to go into its lowest power state when no applications are running
options nvidia NVreg_DynamicPowerManagement=0x02
## For suspending, make sure not using tmpfs!
options nvidia NVreg_PreserveVideoMemoryAllocations=1
options nvidia NVreg_TemporaryFilePath=/var/tmp
## Enable the PAT feature
options nvidia NVreg_UsePageAttributeTable=1
## Enable PCI 3.0
##options nvidia NVreg_EnablePCIeGen3=1
## Support for CUDA Stream Memory Operations in user-mode applications.
options nvidia NVreg_EnableStreamMemOPs=1

Before I decide that I want to install Tumbleweed, I would like to know which method is actually better, despite the first being recommended.

It does say the .run file is desired on Nvidia:The Hard Way page. I don’t think either way is better or worse, they achieve the same thing I believe. Depends on how you want to go about it and spend the time on it or not.

Specifically, has anyone had any issues when it comes to updates?

There can be and it has happened recently where the Nvidia kmp didn’t rebuild with a kernel update but you learn how to navigate it and get to where you want like force reinstalling the nvidia-driver-G06-kmp-default package after a kernel update if needed. This is regarding Method 1 with the Nvidia:repo-non-free.

Is the NVIDIA experience on Tumbleweed good or is it buggy sometimes?

I am personally having a great time with Nvidia and Hyprland on Tumbleweed. I also use KDE Plasma and Sway, wayland only.

2 Likes

If you open YaST2 on a new install

I should have added YaST2 and go to Software Management.

Thank you so much for the response! It sounds like I might have misunderstood method 1. If you can easily just reinstall the driver to make it work, then that sounds like the way to go. I’m gonna install Tumbleweed and try it out. I might try to use something like the zen kernel and see if that works. If not, the stock kernel isn’t bad. The differences are pretty small anyway.

1 Like