Tuesday, May 6, 2008

Install Nvidia drivers on Red Hat 9 or RHEL3

This guide will help you install Nvidia drivers on a Linux based computer system that has an Nvidia card. This guide assumes you are using Red Hat Enterprise 3 or Red Hat 9 (or something along those lines. This guide would probably work ok for Fedora too. Not sure about SuSE or Ubuntu though.)

Basically, after a default installation, you will want to try to install your Nvidia drivers. You go to Nvidia.com, you try to pick out the right driver, you go to install and you have no luck. You probably get errors similar to what I have written below. Well, here is what is happening as best as I understand it...

The computer will try to take the Nvidia drivers and basically compile those drivers into the Linux kernel. But after a default install, the kernel source files aren't there. You either have to put them on the computer by copying from the CD or downloading from a repository of some sort. So in my opinion, the best thing to do is to just copy from the CD you installed from. In Ubuntu, you probably just download it, but with Fedora or Red Hat, use the CD.

Ok, so now you should have the kernel source file and the nvidia driver located together in one directory (can be anywhere, just as long as you know where).

Problems: These are the messages you will get if it's not setup up properly.

No precompiled kernel interface was found to match your kernel; would you like the installer to attempt to download a kernel interface for your kernel from the NVIDIA ftp site (ftp://download.nvidia.com)?


ERROR: Unable to find the kernel header files for the currently funning kernel. Please make sure you have installed the kernel header files for your kernel; on Red Hat Linux systems, for example, be sure you have the 'kernel-source' rpm installed. If you know the correct kernel header files are installed, you may specify the kernel include path with the --kernel-include-path' commandline option.


ERROR: Installation has failed. Please see the file '/var/log/nvidia-installer.log' for details. You may find suggestions on fixing installation problems in the README available on the Linux driver download page at www.nvidia.com



Solution:

  1. Install and configure Red Hat Enterprise 3 as best as you can. Configure NFS, NIS, etc. if you like. Or just jump right away into this...

  2. Be sure you are in run level 3 (text mode) before doing all this.

    # vi /etc/inittab
    id:3:initdefault: <-- make sure number value is a 3 so you boot to text mode # reboot
  3. Determine kernel release

    # uname -r
    2.4.21-40.EL


  4. Install kernel source rpm file. First, get it from from one of the CD's (either CD-3 of the install CD's or use the CD that I made (which if you are reading this from my blog, then you probably don't have it.) Just make sure the kernel release numbers match up before proceeding or you might have to format/reinstall).

    # rpm -ivh /full_path_to_rpm/kernel-source-2.4.21-4.EL.i386.rpm


  5. If all goes well, Then try to run the Nvidia driver. In this example, I assume you copied everything to /tmp
    # cd /tmp


I assume you have the Nvidia driver. In this case, this is the one I am using. You can go to nvidia.com and get one from there too. It might be a newer version too.
I just happen to like this one because I know it works with what I have.
# sh NVIDIA-Linux-x86-1.0-8756-pkg1.run


Note: You might get an error message similar to one of the ones above, but keep going and let it recompile. You should see a progress indicator which shows that it's working. It will say it's finished at the end. Then you can change /etc/inittab back to run level 5

# vi /etc/inittab
id:5:initdefault: <-- make sure number value is a 5 so you boot to graphical mode # reboot

Please feel free to comment if you find any mistakes here. Thanks in advance.
---