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 also "the hard way" as it requires few steps of preparation that other methods have not.


Install dependencies (patterns) for the NVIDIA driver

  • devel_C_C++
  • devel_kernel

Install the software patterns via YaST or in command line:

# zypper install -t pattern devel_C_C++ devel_kernel

Download the NVIDIA binary driver

Go to the NVIDIA Driver Downloads homepage and download the driver for your NVIDIA graphics card. Remember to choose the right operating system Linux 32 or 64 bit. If your are unsure which card you have in your machine you can check this (in KDE) by opening "My Computer" on the desktop. Under "Display info" you will see "Model".

Note: This kind of installation requires to repeat driver compilation each time kernel is updated, so keep NVIDIA script (NVIDIA-Linux-******.run) in the same directory that is easy to reach with command line tools, as that is all you will have after computer is started with a new kernel.

Install the NVIDIA driver

Note: Once switched in console mode, if you have nouveau driver installed, the NVIDIA*.run installer will complain that nouveau module is running, or, if you removed it, the installation will fail for the reason that nouveau driver is still started from initrd. If you should encounter one of such issues, please follow instructions to blacklist and prevent nouveau from starting at boot inside initrd, reboot and then follow instructions in this section.

To install the driver you need to log out and under the shutdown options choose "console login". If this logout option is not supported in your desktop environment (DE), please log out from your GUI session and select "Console login" from drop down menu of the Display Manager screen. Anyway, after logging out from your GUI session, you can log in at any time to a real console using the key-combination Ctrl-Alt-F1.

Then you can log in as root by typing:

$ su -

Enter your root password (You wont see any reaction from the console at this point) And press the "Enter"-key on your keyboard

If you saved your NVIDIA driver in your users home directory just type:

# sh /home/user/NVIDIA.run

Replace "user" with your username and "NVIDIA.run" with the name of the downloaded Nvidia driver executable.

When the installer is done, type:

# mkinitrd

Then restart your computer.

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

Blacklist nouveau

The proprietary NVIDIA driver module conflicts with the open-source alternative "nouveau". The installer of proprietary NVIDIA driver resolves the conflict automatically by preventing the "nouveau" driver from loading.

Manual intervention is normally not required, but if you have to do it manually, the procedure is to run in root user's shell:

# echo "blacklist nouveau" >> /etc/modprobe.d/50-blacklist.conf && mkinitrd && reboot

The change will have to be undone if you wish to uninstall NVIDIA proprietary driver and use nouveau again.

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).


openSUSE Tumbleweed and Leap

If you are using openSUSE Tumbleweed or Leap, please download the proprietary driver from official NVIDIA website. Please make sure to keep the installer on your disk, as you will need it with every kernel upgrade.

NVIDIA proprietary driver works flawlessly on Leap 42.2. On Leap 42.3 you need to uninstall the drm-kmp-default package first (boo#1044816).

$ zypper rm drm-kmp-default

For Tumbleweed the driver is almost always compatible. However, please keep in mind that you must re-install the driver (simply by running the installer program) after each kernel, Mesa and Xorg upgrade (in Tumbleweed this means in practice after each upgrade to a new snapshot).

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).

Installation of NVIDIA proprietary driver on Tumbleweed and Leap is trivial. Simply run the installer program as user root and go through several questions; after the installation is completed, run "mkinitrd" in a root shell, then reboot the machine, and NVIDIA is ready to go!

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

Further readings

For experienced users
  • x11-video-nvidia, package that downloads NVidia driver, sets it and DKMS up enabling the automatic update of the nVIDIA proprietary Driver kernel modules upon each kernel upgrade.
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! :-)