Tuesday, 7 December 2010

How to install www.nvidia.com drivers in Fedora 14

Since I have been playing around with Fedora 14, I thought I would try and write a very newbie friendly guide on how to install the nvidia drivers from www.nvidia.com.

You could always use the rpmfusion method but that's boring :-)

Are you ready?

Open a terminal and type,

su -c 'yum install gcc make kernel-devel'

This will install the necessary packages to compile the nvidia driver. Next we need to download the appropriate nvidia driver.

At the time of writing, 260.19.21 is the latest nvidia driver.

Fedora 64-bit users, type the following

wget http://us.download.nvidia.com/XFree86/Linux-x86_64/260.19.21/NVIDIA-Linux-x86_64-260.19.21.run

Fedora 32-bit users, type the following

wget http://us.download.nvidia.com/XFree86/Linux-x86/260.19.21/NVIDIA-Linux-x86-260.19.21.run

This will download the NVIDIA-Linux-x86_64-260.19.21.run or NVIDIA-Linux-x86-260.19.21.run file to your current directory.

Once the file has downloaded use nano (a simple text file editor) to edit the grub.conf

su -c 'nano /boot/grub/grub.conf'

Edit your first kernel entry and add the option 'nomodeset' and '3'

# grub.conf generated by anaconda
#
# Note that you do not have to rerun grub after making changes to this file
# NOTICE: You do not have a /boot partition. This means that
# all kernel and initrd paths are relative to /, eg.
# root (hd0,1)
# kernel /boot/vmlinuz-version ro root=/dev/sda2
# initrd /boot/initrd-[generic-]version.img
#boot=/dev/sda
default=0
timeout=5
splashimage=(hd0,1)/boot/grub/splash.xpm.gz
hiddenmenu
title Fedora (2.6.35.9-64.fc14.x86_64)
root (hd0,1)
kernel /boot/vmlinuz-2.6.35.9-64.fc14.x86_64 nomodeset 3 ro root=UUID=d18f27a8-5c8b-4f82-af72-75cc78ad3f27 rd_NO_LUKS rd_NO_LVM rd_NO_MD rd_NO_DM LANG=en_US.UT$
initrd /boot/initramfs-2.6.35.9-64.fc14.x86_64.img
title Fedora (2.6.35.6-45.fc14.x86_64)
root (hd0,1)
kernel /boot/vmlinuz-2.6.35.6-45.fc14.x86_64 ro root=UUID=d18f27a8-5c8b-4f82-af72-75cc78ad3f27 rd_NO_LUKS rd_NO_LVM rd_NO_MD rd_NO_DM LANG=en_US.UT$
initrd /boot/initramfs-2.6.35.6-45.fc14.x86_64.img
title Other
rootnoverify (hd1,0)
chainloader +1

Modify your grub.conf as illustrated above.

To exit nano and save the changes, press 'Ctrl-X' and answer yes by pressing 'Y', finally hit the enter button.

Now reboot your system.

Don't be alarmed that your system boots to a text login screen. The option '3' above is responsible for making the system boot to run level 3 as oppose to the default run level 5 which is a graphical login.

Login by typing your username and password.

Install the nvidia driver by typing,

Fedora 64-bit users

su -c 'sh NVIDIA-Linux-x86_64-260.19.21.run -q -a'

Fedora 32-bit users

su -c 'NVIDIA-Linux-x86-260.19.21.run -q -a'

After the installer has successfully completed, type

su -c 'nvidia-xconfig'

This will generate the xorg.conf file, don't worry if you see a warning message.

Finally, edit your grub.conf again and remove the option '3' from your kernel line.

su -c 'nano /boot/grub/grub.conf'

Do not remove the 'nomodeset' option, it is a requirement. Without it the nvidia driver will crash.

Below is a snippet of the full grub.conf as shown above with the '3' option omitted.

title Fedora (2.6.35.9-64.fc14.x86_64)
root (hd0,1)
kernel /boot/vmlinuz-2.6.35.9-64.fc14.x86_64 nomodeset ro root=UUID=d18f27a8-5c8b-4f82-af72-75cc78ad3f27 rd_NO_LUKS rd_NO_LVM rd_NO_MD rd_NO_DM LANG=en_US.UT$

Delete the '3' option to make your kernel line entry resemble the above.

Exit nano, saving your changes.

Reboot your system.

su -c 'reboot'

The nvidia drivers will now be up and running after the reboot.

Important notice: 

If a system update installs a newer kernel, you must reinstall the nvidia kernel module.

Therefore before restarting your system after a kernel update, repeat the process of adding the option '3' to the first kernel line entry in your grub.conf as described above, then reboot.

After logging in type,

Fedora 64-bit users

su -c 'sh NVIDIA-Linux-x86_64-260.19.21.run -K'

Fedora 32-bit users

su -c 'NVIDIA-Linux-x86-260.19.21.run -K'

Once completed, remember to edit out the option '3' from your grub.conf

su -c 'reboot'

Enjoy Fedora 14.

Update 23/1/2011

If you wish to use newer drivers, substitute 260.19.21 with the newer driver version. For example 260.19.36
And if updating from an older driver version, remember to uninstall the older driver before installing the newer version, for example on a 64-bit system, boot into run level 3 and run su -c 'sh NVIDIA-Linux-x86_64-260.19.21.run --uninstall'