2013/03/08: NVIDIA Drivers on Fedora

Installing NVIDIA drivers on Fedora.

Keywords: NVIDIA, Fedora, ION drivers


Installing nvidia's binary drivers for Linux

The following instructions guide you through the installation of the nvidia graphics drivers. At the time of this writing, the latest driver version was 310.32. Should be needless to say, but this HOWTO comes with no warranty whatsoever. Instructions for other version or system configurations may differ.

As first step, go to the nvidia web site and download the nvidia binary drivers for your graphics card. The drivers are available at http://www.geforce.com/drivers. The driver package comes as a self-etracting setup binary, that needs to be made executable:

$ sudo chmod 755 NVIDIA-Linux-x86_64-310.32

Most likely you need to install gcc for the nvidia drivers to be linked against your current kernel. Do not worry, this will be all done by the driver installation. You may want to proceed without this step. If things fail you can do this step lateron too.

$ sudo yum install gcc

Next you want to ensure that you are running the latest version of the linux kernel. Issue the following command inside a terminal window.

$ sudo yum update kernel\* selinux-policy\*

Once you have downloaded the latest kernel, you want to restart your system to ensure that the latest kernel version is actively running.

Most likely, you are using the nouveau graphics drivers. The easiest way to figure out is to invoke the nvidia setup. Only downside is, this setup needs to be invoked without the X server being running (i.e., best from the console). Swith to a console (Ctrl-Alt-F2), login and switch to a runlevel without X by issuing (remember if you restart your system and want to run the nvidia setup again, you need to repeat these steps):

$ sudo init 3

You may have to login again, switch again to the directory where you downloaded the nvidia drivers to and issue:

$ sudo ./NVIDIA-Linux-x86_64-310.32.run

If it tells you you are using the nouveau drivers, confirm you want to deactivate them. However, Fedora already enables them as part of the initial ramdisk, and hence they need to be deactivated when the system starts. There are two options to accomplish this.

Option one. Manually at each startup- When your system starts, at the grub prompt, select the kernel you want to use and type e to change the boot settings for this kernel. Scroll to the line containing the kernel command line options (starting with linux /vmlinuz-...) and append the following entry. This has to be repeated whenever your system boots, even after the nvidia drivers have been installed.

rdblacklist=nouveau

Option two. Permanently disable the nouveau driver. Edit your grub configuration file (/boot/grub2/grub.cfg) locate the entry starting your kernel and add the same kernel command line option as above.

Start the installation of the drivers:

$ sudo ./NVIDIA-Linux-x86_64-310.32.run

If the above fails due to missing kernel sources, you need to install the kernel-devel package by issuing (maybe one could include them upfront in the above yum update command - haven't checked):

$ sudo yum install kernel-devel

If the above fails, you need to fix the setup scrip of the nvidia drivers (this happened to me the first time, I think I had a different kernel running, the second time I ran through my HOWTO this wasn't necessary). Unpack them as indicated below.

$ sudo ./NVIDIA-Linux-x86_64-310.32.run -x
$ sudo vi NVIDIA-Linux-x86_64-310.32/kernel/conftest.sh

Now change lines 1705ff as indicated below.

#                if [ -n "$PATCHLEVEL" -a $PATCHLEVEL -ge 6 \
#                        -a -n "$SUBLEVEL" -a $SUBLEVEL -le 5 ]; then
                    SELECTED_MAKEFILE=Makefile.kbuild
                    RET=0
#                fi

Now, change into the NVIDIA-Linux-x86_64-310.32 directory and invoke the extracted installer as follows:

$ sudo ./nvidia-installer

Now everything should be installed and once you restart your system for a very last time (don't forget to disable the nouveau drivers if you have chosen option one above), you should be using the nvidia drivers.


Thomas Gschwind