Nvidia Drivers (Debian)
From TheLinuxVault
You can use the module assistant in Debian to install the Nvidia driver. You will need to have the non-free repositories enabled in your apt sources list. You can do this while running X.
su nano /etc/apt/sources.list
If they do not already exist then add the parts in red to the file.
deb http://ftp.uk.debian.org/debian stable main contrib non-free deb http://security.debian.org/ stable/updates main contrib non-free
Now bring your system up to date.
apt-get update
You can now install the necessary packages.
apt-get install nvidia-kernel-source module-assistant nvidia-settings nvidia-xconfig
Get the module assistant prepared and install the Nvidia module.
m-a prepare m-a a-i nvidia
Now add the Nvidia module to your modules file.
grep -q ^nvidia /etc/modules || echo nvidia >> /etc/modules
Install the nvidia-glx package that will reconfigure your xorg.conf file
apt-get install nvidia-glx
If you already have a previous Nvidia driver installed you will need to remove it. If you try to modprobe without first removing it then it will fail.
rmmod nvidia modprobe nvidia
You now need to edit the xorg.conf file to change the driver being used.
nano /etc/X11/xorg.conf
Find the line that reads
Section "Device"
Identifier "Generic Video Card"
Driver "vesa"
BusID "PCI:1:0:0"
EndSection
And change it to read
Section "Device"
Identifier "Generic Video Card"
Driver "nvidia"
BusID "PCI:1:0:0"
EndSection
You now need to restart either KDM or GDM; whichever you use.
/etc/init.d/kdm restart
or
/etc/init.d/gdm restart
You can check if the driver is working correctly by installing the glxinfo package.
apt-get install mesa-utils
You can then run the command
glxinfo | grep rendering
If the output reads 'direct rendering: Yes' then the Nvidia driver is working.
If you were to upgrade your Kernel in the future and keep the nvidia-kernel-source package on your system then all you need to do is run the following.
rmmod nvidia m-a a-i nvidia apt-get install nvidia-glx
For old cards you may need to replace m-a a-i nvidia with m-a a-i nvidia-legacy.
apt-get install module-assistant m-a prepare m-a a-i nvidia-legacy
I do not have any legacy cards to test this so I cannot confirm if it works. I do know that the Nvidia FX5200 that I have does not require the legacy package and that card is about 4 years old so most cards should use the standard Nvidia package without an issue.

