Home Wiki > SDB:NVIDIA the hard way
Sign up | Login

SDB:NVIDIA the hard way

tagline: From openSUSE

This article will tell you how to manually install the NVIDIA hardware driver from NVIDIA web site on openSUSE. We call it "the hard way" because it requires a few steps of preparation that other methods do not.

Install dependencies (patterns) for the NVIDIA driver

Install the software patterns via YaST or in command line:

# zypper install -t pattern devel_C_C++ devel_kernel

Install libelf-devel via YaST or in command line:

# zypper install libelf-devel

The kernel-source package (548M) in devel_kernel is needed according to the official README and Installation Guide. However, you might investigate --add-this-kernel

Get hardware information

In a terminal:

lspci | grep VGA
lscpu | grep Architecture 

Alternatively:

hwinfo --gfxcard | grep Model
hwinfo --arch

There is also YaST2 -> Hardware Information.

Download the NVIDIA driver installer

Direct links can be found at:

Boot without nouveau

Reboot and press E at GRUB2, then add nomodeset and 3 to the group "splash=silent quiet showopts". For example: "splash=silent quiet nomodeset 3 showopts"

nomodeset ensures the nouveau driver won't be loaded.

3 ensures that the system boots to a virtual console (runlevel 3) instead of to a display manager / X session.

These options will not be saved for the next boot (see YaST2 -> Boot Loader -> Kernel Parameters or /etc/default/grub).

You could also try booting in IGFX (integrated graphics) mode from BIOS. This requires a VGA connection.

Blacklist nouveau

The proprietary driver installer will blacklist nouveau; therefore, you can usually skip this section.

The installer creates the file /etc/modprobe.d/nvidia.conf that contains:

 blacklist nouveau

Other versions might also add:

 options nouveau modeset=0

Options

To view a list of all options:

sh /home/<username>/Downloads/<NVIDIA*.run> -A

Install the NVIDIA driver

First, log in as root (the super user).

On Leap 42.3 you need to uninstall the drm-kmp-default package first.

# zypper rm drm-kmp-default

Normal installation:

# sh /home/<username>/Downloads/<NVIDIA*.run>

When the installer indicates nouveau might have just been blacklisted, you can continue without rebooting (if you booted as suggested).

Allowing the installer to configure /etc/X11/xorg.conf creates a copy (/etc/X11/xorg.conf.nvidia-xconfig-original) of the current version, which it will restore on uninstallation.

Once the installation is complete, run mkinitrd, then restart your computer (shutdown -r now).

mkinitrd reads the new nvidia.conf ("blacklist nouveau"). If you miss this step you can still boot with nomodeset.

Expert mode

Alternatively, there is an "expert" installation mode with more questions:

# sh /home/<username>/Downloads/<NVIDIA*.run> -e

Kernel updates and driver compatibility

Please note: you will have to repeat these steps whenever you update the kernel. This is necessary because, unlike with the NVIDIA driver from the NVIDIA's openSUSE repos, this driver isn't copied to directories for KMPs which remains valid across kernel updates.

Uninstall and use nouveau

The installer is also used to uninstall:

sh <NVIDIA*.run> --uninstall

/etc/modprobe.d/nvidia.conf will be delete.

/etc/X11/xorg.conf will be replaced with /etc/X11/xorg.conf.nvidia-xconfig-original (a pre-installation copy).

You might need to run mkinitrd, depending on your system (more). This is seemingly not required with Leap 42.3

Kernel mode-setting

"Kernel mode-setting (KMS) means that the kernel is responsible for setting up and changing the display mode: resolution, frequencies and color depth."

- https://nouveau.freedesktop.org/wiki/KernelModeSetting/

With the proprietary driver you will see a blank screen after GRUB2 and until your display manager loads. There are two ways to change that:

  1. make nomodeset persistent via YaST2 -> Boot Loader -> Kernel Parameters (at the end of the optional parameters entry)
  2. figure out nvidia's system (please describe it here if you do)

If you use nomodeset you will see plymouth at an odd resolution. You can avoid seeing it by adding plymouth.enable=0 with nomodeset.

More information:

Configuration

To setup your graphics card use nvidia-settings. Some report they have to use "twinview" to get compositing to work on dual screen setups (nvidia replacement for xinerama).

Tearing

One solution for persistent tearing is:

nvidia-settings -> x server display configuration -> advanced -> force composition pipeline

Warning: Saving this to /etc/X11/xorg.conf via the nvidia-settings GUI might adversely affect loading your desktop.

Alternatively, a simple script can be used to turn it on from the command line. For example:

Create /home/<username>/bin/fcp

nvidia-settings --assign CurrentMetaMode="nvidia-auto-select +0+0 { ForceCompositionPipeline = $1 }"
xrefresh

Make it executable:

chmod +x /home/<username>/bin/fcp

Turn it on:

fcp 1

Turn it off:

fcp 0

xrefresh can be installed via zypper. It might be needed to avoid a blank screen.

Ctrl+Alt+F1 then Ctrl+Alt+F7 can also help in that situation.

openSUSE Tumbleweed

It's prudent to download the latest driver before a zypper dup, because changes in the kernel, Mesa, and Xorg can break driver compatibility.

If you are updating to Tumbleweed 20170407 or higher you need to un-install the NVIDIA driver first, then remove two orphaned libGL.so.1.2* files once (restored by NVIDIA's installer) and reinstall libglvnd0 package

# nvidia-installer --uninstall
# rm -f /usr/lib*/libGL.so.1.2*
# zypper in --force libglvnd0

Otherwise the installer will complain about a broken libglvnd installation (boo#1034343) and leave behind libGL.so files that will prevent the RPM-install driver from working correctly (boo#1053115 ).

Alternative, based on OBS

You can build the kernel package as an RPM and install it using RPM/Zypper based on repositories from X11:Drivers:Video. This project contains all the infrastructure needed to build an RPM, but does not build or publish anything.

The advantages of using this method are:

  • unofficial patches for newer kernels are usually applied already
  • nouveau is blacklisted
  • dependencies automatically installed

First, you need to install the osc program

# zypper install osc

Then, checkout the driver project that supports your current graphics card (check for you card in the pci_id* files - when available - or the *.changes files of each package). We'll use nvidia-gfxG04 for the rest of this article.

$ osc co X11:Drivers:Video nvidia-gfxG04

The next step is to download the driver sources, since they are not available in OBS.

$ cd X11:Drivers:Video/nvidia-gfxG04
$ osc service dr

At this point you are ready to build the RPMs. Follow the instructions in the README file to do so.

Once that is done, install the resulting RPMs, and reboot.

The NVidia driver is now setup.

To upgrade to newer versions, you typically need to run

$ osc up
$ osc service dr

The first command brings in any changes done in OBS, while the second one downloads new driver versions.

Handling system upgrades

This page mentions that certain upgrades break the NVidia driver. The best example of those is a new major kernel version, e.g. upgrading from 4.6 to 4.7. The steps for an upgrade are the following:

  • upgrade to a new version, in case you need patches or a newer driver version
  • upgrade to the new kernel
  • reboot in text mode
  • rebuild and reinstall the driver using the instructions supplied above

See also

Icon-cleanup.png This article is in need of attention because it does not follow our wiki guidelines. It still needs some cleanup.
If you want to contribute, please read the rules for this wiki and if you have any questions, don't hesitate to contact the wiki team, we are more then willing to help you! :-)