How to install Nvidia drivers for Debian GNU/Linux
Disabling kernel mode setting.
For users of Squeeze and newer it has become necessary to disable KMS to install the Nvidia driver.
This is done with adding the following to /etc/default/grub :
You should now run update-grub to save the changes.
This should be done before trying to install the Nvidia driver.
If the nouveau module is loaded it will cause the installation to fail.
I have written this how-to in response to many posts in the Debian forum regarding installing Nvidia's video drivers.
There are currently three main ways of installing the driver:
1,The 'debian method'.
2,Using the downloadable installer from Nvidia's website.
3,SMXI. A script run from the console which can automate the driver install process.
Let's start with method 1,the Debian way.
This is the method i'd recommend if you have an older Nvidia card,such as a 4 or 5 series era card.
So you don't need the latest version driver.
Debian has already written a comprehensive install guide:
So i see little point in copying and pasting the relevant parts here.
If you decide this method is for you,read the guide and follow the instructions.
If you run into trouble,post on the Debian forum.
And don't forget to post as much detail as possible,ie: Which branch of Debian,what architecture you are using and what graphics card and driver you are trying to install etc.
If you use the 'Debian method' and the install fails,and you then decide to try installing the driver downloaded from Nvidia.
You must purge
all Debian Nvidia packages installed from the repositories.This must be done before
trying to run the downloaded Nvidia installer.
Failing to do so will lead to problems later.
This is the method to use if you have a recent graphics card or kernel,that isn't supported by the earlier drivers.
Here's how to install the driver downloaded from the Nvidia website.
First we need to install some packages from the Debian repositories.
I use aptitude,you can substitute apt-get if you are that way inclined.
aptitude install module-assistant build-essential
Next we need to run the following commands as root:
This will then install the appropriate kernel headers package etc for your current running kernel.
Now we need to download the driver from Nvidia,here's a link:
Once the driver has finished downloading,put it in your /home directory.
Now we need to logout and stop the display manager,do this with:
And now login as root.
We now need to stop the display manager with:
Or for GDM3:
Obviously you can substitute kdm or xdm as appropriate.
Now we need to navigate to where the downloaded driver resides,so from my example:
Pc1:~# cd /home/ade
Now run the installer with:
The installer may need a different Gcc version to the one you have installed.Install the appropriate version with aptitude/apt-get and use the following to use this version temporarily:
The installer will now compile and install the module for you.
If you are installing on an amd64 machine,don't forget to install the 32 bit compat libraries when the installer prompts.
I also let the installer edit my /etc/X11/xorg.conf
If all has gone well the driver is installed.
So now we need restart the display manager with:
Now you should be back in the gui,but don't forget to logout as root.
Make sure you have graphics acceleration working,with the following package:
aptitude install mesa-utils
And check with the following command:
glxinfo | grep "direct rendering"
It should say yes.
The last method is Smxi:
To install,do the following as root from a terminal:
cd /usr/local/bin && wget -Nc smxi.org/smxi.zip && unzip smxi.zip && smxi
The installer will now ask to stop X,say yes and then login as root.
To run smxi,just simply type smxi
Work through the questions asked,like if you prefer to use aptitude or apt-get etc.
Eventually you will come to the menu where you can choose to install graphic drivers.
With smxi you have a choice of what drivers to install,from the 2d 'nv' driver to the latest beta driver from nvidia.
As it's a console application it's really as easy as pressing a number key and hitting enter.
Smxi can do a whole host of other tricks which i'm not going to go into here.
Try it,you might like it!.
I hope you find this how-to useful in someway.