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 :
Code:
GRUB_CMDLINE_LINUX_DEFAULT="quiet nomodeset"
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.
Method 1
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:
http://wiki.debian.org/NvidiaGraphicsDrivers
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.
Note
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.
Method 2
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.
Code:
aptitude install module-assistant build-essential
Next we need to run the following commands as root:
Code:
m-a update
m-a prepare
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:
http://www.nvidia.com/Download/index.aspx?lang=en-us
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:
Code:
/etc/init.d/gdm stop
Or for GDM3:
Code:
/etc/init.d/gdm3 stop
Obviously you can substitute kdm or xdm as appropriate.
Now we need to navigate to where the downloaded driver resides,so from my example:
Code:
Pc1:~# cd /home/ade
Pc1:/home/ade#
Now run the installer with:
Code:
sh NVIDIA-Linux-x86_64-190.18-pkg2.run
Note:
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 when prompted.
If all has gone well the driver is installed.
So now we need restart the display manager with:
Code:
/etc/init.d/gdm start
Now you should be back in the gui,but don't forget to logout as root.
Logout with:
Code:
ctrl-alt-f1
ctrl-d
ctrl-alt-f7
Make sure you have graphics acceleration working,with the following package:
Code:
aptitude install mesa-utils
And check with the following command:
Code:
glxinfo | grep "direct rendering"
It should say yes.
Method 3
The last method is Smxi:
http://smxi.org/
To install,do the following as root from a terminal:
Code:
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.
The trooper.