AH Logo

Installing Nvidia's binary drivers the Debian Way

While they are not open source drivers, Nvidia provides some very good binary drivers that support almost all their graphics hardware under linux. They are fully featured and very fast. If you have issues with installing non-free software on your system you should look into XFree's "nv" driver to support Nvidia cards. This document assumes use of the unstable branch, but most of the commands should work for both stable and testing. There are a few places where things will differ and I will try to note them. If you find any more differences between branches please email me at fool@atomichamster.com so I can update this page.

Nvidia has released a installer utility that you may find to be more convenient that the Debian method. You can find information about the installer on Nvidia's site here.

The Debian way produces three Debian packages: One that contains the nvidia kernel module, one that contains the driver for XFree86 and one that contains the development files.

You will need to be root for most of these commands.

First install the nvidia-kernel-src and nvidia-glx-src packages.
apt-get install nvidia-glx-src nvidia-kernel-src

Now uncompress the nvidia-kernel-src files in /usr/src.
cd /usr/src
tar zxf nvidia-kernel-src.tar.gz

If you have built your own kernel

You should have everything in place so all you need to do is the build itself.
cd /usr/src/kernel-source-<your kernel version>
make-kpkg modules_image

If you are using a pre-built Debian kernel

You will need to install the corresponding kernel-headers package for your kernel. You can find your kernel version by running uname -r. So, if your kernel version was 2.4.18-k7 you would need to install the kernel-headers-2.4.18-k7 package.

We need to set some environmental variables for the build.
export KSRC=/usr/src/kernel-headers-<your kernel version>
export KVERS=<your kernel version>

Now to actually build the package, change to the nvidia-kernel source directory and run the build script. The nvidia driver version as of this writing is 1.0.4349.
cd /usr/src/modules/nvidia-kernel-<nvidia driver version>
debian/rules binary_modules

Building the GLX modules

This is a simple task of running a dpkg-buildpackage command.
cd /usr/src/nvidia-glx-<nvidia driver version>
dpkg-buildpackage -us -uc

Installing the packages

If everything has gone well you should have three new packages in /usr/src. Just install them with dpkg. You do not need to install the nvidia-glx-dev package for normal use. The file names will be similar to these, make use of your shell's tab completion feature :).
cd /usr/src
dpkg -i nvidia-kernel-2.4.18-k7_1.0.4349-1.0_i386.deb nvidia-glx_1.0.4349-1_i386.deb

Editing /etc/modules

To tell your system to load the nvidia kernel module at boot run modconf. Under kernel/drivers/video select nvidia and hit enter. Just leave the command-line arguments field blank.

N.B.: If you are running stable or testing the nvidia kernel module will be NVdriver instead of nvidia.

Reconfiguring XFree86 to use the nvidia drvier

Now you need to tell X to use the newly installed driver. This can be done very easily by use of the dpkg-reconfigure command.
dpkg-reconfigure xserver-xfree86

Just answer the questions presented and be sure to select "nvidia" when prompted about the X server driver. If your X server fails to start after this just copy the backup created by debconf over the new config.
cp /etc/X11/XF86Config-4.debconf-backup /etc/X11/XF86Config-4

You may want to make a backup of your X config just in case. This way if X fails to start you can just login to a console and copy your old config back.
cp /etc/X11/XF86Config-4 /etc/X11/XF86Config-4.bak

Finishing up

Now just load the nvidia kernel module (modprobe nvidia or modprobe NVdriver if you run testing or stable) and restart your X server. If you are not sure of how to do this, a reboot will do just fine.

You can find more information on building/installing the drivers in /usr/share/doc/nvidia-kernel-src and /usr/share/doc/nvidia-glx-src.




Questions, comments or flames to fool@atomichamster.com, or I am usually in the #debian channel on irc.openprojects.net as Shango.

You are connecting from:

Valid HTML 4.01! Valid CSS!