How to configure Nvidia graphics card in Debian

I got most of this information from the Debian wiki but it is a little complicated, so here's a summary of the way it worked for me. This method involves a re-build of the kernel, but it's not as scary as it sounds.

Firstly modify /etc/apt/sources.list so that the Debian source is the 'main contrib non-free' one. This is because the nvidia driver is not open source. The line probably looks like this:

deb http://ftp.uk.debian.org/debian/ etch main contrib non-free

Make a note of the architecture you're currently running. This way when you get upgrades you'll know whether the kernel will need to be re-built.

$ uname -r

Mine is currently at 2.6.18-6-amd64.

As root, ensure the necessary applications are installed.

# apt-get install module-assistant gcc nvidia-kernel-common nvidia-glx

Now to re-build the kernal using module-assistant. Each of these commands may take a while to run:

# m-a update
# m-a prepare
# m-a auto-install nvidia

There! Wasn't so hard, was it! ;) These three steps will be needed whenever there is a new build of Linux headers.

Now there is a little bit of configuration to do, so firstly backup the xorg.conf file to have something to restore if it all goes horribly wrong.

# cd /etc/X11
# cp -p xorg.conf xorg.conf.backup

I find it easiest to run the auto-configure tool rather than changing the xorg.conf file by hand. Be aware this will overwrite xorg.conf, losing any changes you may have made. Just double-check that the backup is there.

# dpkg-reconfigure xserver-xorg

This brings up a series of dialogs to change settings. Most of them can simply be left as default unless there are specific changes you want to make. For example, i set the resolution to 1440 x 900.

Here are some specific things you do need to ensure are set correctly:

X server driver: make sure 'nvidia' is chosen, not 'nv'.
X server modules: unselect 'GLCore' and 'dri'. Select 'glx'.

Now we need to ensure that Nvidia runs at boot time. It's as simple as adding 'nvidia' to /etc/modules. This line will add it, if it's not already there:

# grep -q ^nvidia /etc/modules || echo nvidia >> /etc/modules

Load the nvidia module:

# modprobe nvidia

Note to self: if you have just reinstalled Debian, do remember to take the DVD out before rebooting!

Now reboot.

Any problems … check the wiki! wiki.debian.org/NvidiaGraphicsDrivers

As i mentioned above, whenever a new build of Linux comes through, it normally tells you "You need to reboot soon". Take this as a hint that you may also need to re-build the kernel to accept nvidia again. It's just these three lines:

# m-a update
# m-a prepare
# m-a auto-install nvidia

Related posts (automatically calculated)

  1. How to install Beryl/Emerald on Debian
  2. Ubuntu - Debian done well?
  3. Flash player on Debian 64-bit
  4. How to install Pidgin on Debian
  5. Hurrah! Skype on 64-bit Debian!

This entry was posted on Saturday, June 7th, 2008 at 18:20 and is filed under computer, geeky, linux. You can follow any responses to this entry through the RSS 2.0 feed. You can leave a response, or trackback from your own site.

One Response to “How to configure Nvidia graphics card in Debian”

  1. A little place of calm » Blog Archive » How to install Beryl/Emerald on Debian UNITED STATES WordPress 2.5.1 Says:

    [...] Beryl and Emerald only work for me after i configure the Nvidia drivers for the graphics card. That must be done [...]

Leave a Reply