From LQWiki
This is a guide on how to install NVIDIA's drivers for X-windows, the graphical user interface system on Linux. These drivers are not required, but if you wish to run games such as Quake or Unreal at full speed you should install them. Before you start, take note that the drivers are distributed under a non-opensource license.
Contents |
Distribution specific
Fedora Users
For Fedora users, the NVIDIA drivers are available repackaged in RPM, with pre-build kernel modules for easy install and update. Normally you can find the rpms in the livna.org apt/yum respository, but the latest drivers (version 6106) are not yet avaliable as RPMs. See the Fedora FAQ (EL) for more information on how to install on Fedora Core 2 anyway, or here (EL) for more info on the livna nvidia packages.
Drivers before version 6106 will not work with prebuilt Fedora Core 2 kernels, because they do not support 4k Stacks.
Debian
Debian has packages for these drivers. There are two packages that need to be installed.
One for the binary drivers and libraries and one for the kernel module.
For Debian 3.1 (Sarge) and higher they are called nvidia-glx and nvidia-kernel-<version> (both are in the non-free section). Where <version> is one matching your used Debian kernel or source to build the module for your specific kernel. See the README.Debian file that comes with them for full instructions. And use the package module-assistant to help compile the kernel module if you don't have a default Debian kernel. After installing these packages, the X server configuration file needs to be changed, seen the section about that below.
The other optional packages are nvidia-glx-dev for when you need to compile an openGL applicating against the nvidia openGL libs and nvidia-settings for a GUI application to configure the various driver options.
In Debian 3.0 (Woody) these packages are called nvidia-glx-src and nvidia-kernel-src (both are in the contrib section and use wget to download the actual drivers).
Installing and Configuring nvidia drivers in debian http://www.debianhelp.co.uk/nvidia.htm
SuSE
For SuSE users, there is a 1-Click-Install available at http://en.opensuse.org/Nvidia.
Gentoo
Gentoo has ebuilds available which can be installed with:
emerge nvidia-kernel nvidia-glx
The first ebuild "nvidia-kernel" provides Nvidia's driver for their various cards and nvidia-glx provides 3D acceleration (this is optional). To switch to the nvidia openGL implementation run:
eselect opengl set nvidia
You have to edit your X11 config file manually using the procedure described below (note: gentoo uses X.org).
Mandrake/Mandriva
Mandriva has Nvidia RPMs available for PowerPack users (ie. those who bought a boxed set or are club members). If you have a PowerPack the drivers will install automatically when you install the OS.
For everyone else the manual procedure is:
1) If you haven't already done so go to http://easyurpmi.zarb.org and setup access to the software repositories for your version.
2) In the Software section in the Mandrake Control Centre, or using the urpmi command as root, install the packages "kernel-source-2.6" ("kernel-source" for versions 9.2 or below) and "gcc" (without quotes).
3) Make sure you have the latest kernel - the kernel package isn't updated automatically but the kernel-source package is, which could lead to a version mismatch. To do this run (from a terminal window):
su
urpmi.update -a
urpmi kernel
If it lists a whole lot of different kernels most users can just select number 1 in the list. Otherwise run rpm -qa | grep kernel
to see which kernel package you have installed. For more information see http://www.mandriva.com/en/security/kernelupdate
Now follow the rest of the instructions below under "Manual Installation" from "Install" onwards.
Manual installation
Download
The first step is to download some needed files. First, grab the latest version of the drivers from the NVIDIA Website. Once you have that downloaded, make sure you have the source for your kernel. You can check what kernel you have by running the command 'uname -r', without the quotes.
Install
First of all, you need to shut down X. Yes, that's right, we're going to be working from a command line. To do this:
1) Press Ctrl+alt+F1 on the keyboard. Now you should be at a console login screen, login as root.
2) Type the command 'telinit 3' (no quotes) to put your machine into runlevel 3 (no graphical interface). It will tell you about some services its restarting, if it doesn't return you to the command prompt press enter. For more information on this, refer to run levels.
Once you get X shut off, navigate (see Directory_Commands) to where ever you downloaded the driver file to, and run it. You can run it by typing sh filename. It should check to make sure that it downloaded OK, then start up the installation program.
Go through the first screen, accept the license, and when it asks if you want to try and download a kernel interface from NVIDIA, say no. I've never seen anyone get the kernel interface form the site, so we'll save time and move onto the next screen, where it tells us it will compile the kernel interface on its own. This is where our kernel source comes into play. It should compile and install on its own, so go to the next screen. This should pretty much wrap up anything important in the installation.
Editing the X11 configuration
The next step is to edit your X11 configuration file, so it loads the nvidia driver. For XFree86 the file is usually found in /etc/X11/ and called XF86Config, but you might also have XF86Config-4, in which case you should edit that instead. Many newer distributions use X.org, which uses /etc/X11/Xorg.conf in place of /etc/X11/XF86Config.
Before we do that, we should back up the file, just in case something goes wrong.
# cp /etc/X11/XF86Config /etc/X11/XF86Config.backup
Then, open the X config file in a text editor, e.g.:
# vi /etc/X11/XF86Config
Look for the Module section, and make sure it includes the Load "glx" line. If it doesn't, add it in. Then remove the Load "dri" and Load "GLCore" lines, if you have them. If you might want to go back to the old drivers later you can comment out loading dri and GLCore instead of removing them completely by putting a hash at the start of the line. An example configuration:
Section "Module"
Load "dbe" # Double buffer extension
Load "type1"
Load "speedo"
Load "freetype"
Load "glx"
# Load "dri"</nowiki> <br>
# Load "GLcore"</nowiki> <br>
EndSection
Finally, find the Device setion, and change the line Driver "nv" or Driver"vesa" to Driver "nvidia". An example device section:
Section "Device"
Identifier "NVIDIA"
Driver "nvidia"
VideoRam 65536
# Insert Clocks lines here if appropriate
EndSection
To disable the NVidia splash-screen logo when starting X, add the option highlighted below:
Section "Device"
Identifier "NVIDIA"
Driver "nvidia"
'''Option "nologo" "1"'''
VideoRam 65536
# Insert Clocks lines here if appropriate
EndSection
Start X
Now all that's left is to start X back up. To do this type the command 'telinit 5' at the console prompt and it should load X and take you to the normal graphical login screen. You should now have your brand-new NVIDIA drivers installed and working. Good job!
Uninstalling NVIDIA drivers
Did something in your installation go terribly, terrible wrong? No problem! Start your box up in console-only mode, navigate to where you have the nvidia driver installation file saved, and run it with the --uninstall option. sh filename.run --uninstall, and it uninstalls everything it put in. Then it's a simple matter of restoring your XF86Config from the backup we made above.
Issues
- One issue I've had is between the GeForce FX 5200 card and the Asus P4S8X-X motherboard. When you started the X server, it would display garbled text and then hang. This problem can be solved by going into the BIOS and setting your AGP speed down from 8x to 4x.
- Compiling NVIDIA 1.0-7676 on kernel 2.6.14 requires a small modification.
- First you need Module.symvers at the kernel sources dir so you must build the kernel.
- Then extract the driver sources with ./NVIDIA-Linux-x86-1.0-7676-pkg1.run -x.
- Change line 533 of NVIDIA-Linux-x86-1.0-7676-pkg1/usr/src/nv/nv-linux.h to # define NV_PCI_DEVICE_NAME(dev) pci_pretty_name(dev)
- After this install the driver with ./NVIDIA-Linux-x86-1.0-7676-pkg1/nvidia-installer --kernel-source-path=...

This page is available under a