Thursday, May 04, 2006

HOWTO install NVIDIA drivers on Linux

HOWTO install NVIDIA drivers on FC3

I had one heck of a time installing the nVidia drivers on my system, so I thought I would post the steps that worked for me, so others could be spared the pain. I got these instructions from several sources. For the record, these instructions worked on a GeForce 4 MX440 and a GeForce FX5200. They were performed on a clean install of FC 3, and all actions were performed as root. The latest nVidia driver(NVIDIA-Linux-x86-1.0-6629-pkg1.run) was used. I have an AMD Sempron 2600. These instructions will not work unless you have the development packages installed. It has been reported that these instructions do not work on TNT2 cards. However, I have heard there is a work around, but I'm not sure what it is.
Do not type the quotes around the command line commands. These are only there to separate what is to be typed from the rest of the instructions.

READ AND PRINT OUT THIS PAGE BEFORE STARTING

1)Download the latest nVidia drivers to a directory of your choice

2)Edit the /etc/inittab manually using a text editor. Change the line that reads "id:5:initdefault:" to read "id:3:initdefault:" . Certain tutorials will instruct you to use the telinit 3, init 3, or even runinit 3 command. These commands didn't work for me, though. However, they may work for other people.

3)Reboot your system. You will end up in a command prompt environment. DO NOT PANIC. This is what it is supposed to do. Use the "cd" command to move to the directory you downloaded the driver to. For example, if you downloaded the driver to the /root/ folder, then run the command "cd /root/".

4)Now type "sh NVIDIA-Linux-x86-1.0-6629-pkg1.run".

5)Accept the license agreement. Now it will probably say that it could not find the kernel source. You can allow the installation program to look for the source online, but it won't work unless the servers are updated. Now it will say that it needs to compile its own kernel. Please allow it to do so. This is the part of the installation were the development tools are required.

6)Now run the command "cd /etc/X11"

7)Next type "vim xorg.conf". This opens the text editor. Use the arrow keys to move the cursor. Press the Insert key, and on the bottom, either "INSERT" or "REPLACE" will be shown. If INSERT is selected, then when you type the text you types will be inserted before the selected character. If replace is selected, then what you type will replace the selected character(s). Look for a line that reads "Driver "nv"", or "Driver "vega"". Change it to read "Driver "nvidia"". Now go scroll up until you get to "Section "Module"". Make sure that one of the lines between"Section "Module"" and "EndSection" says "Load "glx"". If the lines "Load "dri"" or "Load "GLcore" are present, then comment them out by placing a # at the beginning of the line.

8) To exit and save changes, push esc. Now type ":wq" and hit enter. If you mess up you can quit without saving by hitting esc and then typing ":q!".

9)Now that you are back to command prompt, type "rpm -e --nodeps xorg-x11-Mesa-libGL"
NOTE: If you update "xorg-x11" package with up2date or yum, you will have to do the above command again.

10)Now run "modprobe nvidia"

11)Now run "cp -a /dev/nvidia* /etc/udev/devices
Allow it to overwrite what is there.

12)Now run "chown root.root /etc/udev/devices/nvidia*"

13) Almost there, all that's left is to edit /etc/inittab back to what it was. To do this, type "cd /etc/". Now type "vim inittab" . Change the "3" back to a "5".

14)Reboot by hitting ctl-alt-delete

15)You're done!!!

I hope this helps a lot of people, feedback and more information is certainly welcome.
A special thanks to perfect_circle for helping me with this. Also, parts of this tutorial were taken from http://www.fedoraforum.org/forum/showthread.php?t=26260

No comments: