©opyright
Leon Pennington 2000-2005

Valid CSS!

Valid XHTML 1.0!

How-To NVidia Drivers

Version 2.1
Updated 21/01/04

NVidia's graphic scards are a problem in many distro's, this How-To show's how to get past those problems in the Debian GNU/Linux Distro.

This was originally based on a post by Qian Gong on the debian-user mailing list. With the addition of information on making the current drivers work with the 2.6 Test Kernel. I've now altered it quite a bit, removing the need for comiling the kernel.

If you think I've missed something, or have a correction to make, or this doesn't work for you, email me at leon@leonscape.co.uk and I'll try to do my best to fix it as soon as possible.


Contents


Changelog

  • 2.1 21/01/04 Updated for the new kernel drivers, also removed compilation of kernel

  • 2.0 11/05/03 Updated to add 2.6 Kernel info and Additional Debian info

  • 1.1 20/03/03 Added Compiling Errors

  • 1.0 28/02/03 Completed First Version

Contents

Before we start

Kernels and Packages are being updated all the time, and their version numbers change. Rather than me updating this file everytime a new version comes out I'll be using a simple convention.

Everytime you see this <KernelVersion> replace it with the kernel version your using. You Replace this <DriverVersion> with the driver version your using.

To carry out all the commands below you have to be logged in as root. if you get commands not found, or permission errors, then your not root! Either exit and login again, or su to root.

Contents

Getting what you need

The first priority is to download the NVidia drivers deb files. The easiest way is

# apt-get install nvidia-kernel-common
# apt-get install nvidia-kernel-source

Their are GLX drivers for nvidia cards, but if you try too download them now, you'll get dependancy errors as we haven't yet installed the driver.

The latest drivers may not be available in your sources list so apt-get won't find them. To solve this I've provided a link to the latest drivers. Simply dowload the the packages listed above, and the nvidia-kernel-glx to a convient directory and type the following in a console.

# cd <Where You Download Files>
# dpkg -i nvidia-kernel-common_<DriverVersion>_i386.deb
# dpkg -i nvidia-kernel-source_<DriverVersion>_i386.deb

There may be some other packages listed called nvidia-kernel-src, and nvidia-glx-src, they are part of an older set of packages, and are for transitional reasons.

If you wish to use the 2.6 kernels, you don'y have to worry as the drivers supplied by debian will automatically patch the drivers for you.

Kernel files and others

If you are building your own kernel, or already have done so move on to the next section. If not we will need to download the header files for your kernel. To find out which kernel your running type this

# uname -r

you should get a line similar too 2.4.21-4-k7 So to download the headers for this use 2.4.21-4-k7 instead of <KernelVersion> Now type the following

# apt-get install debhelper modutils kernel-package libncurses5-dev
# apt-get install kernel-headers-<KernelVersion>
# apt-get install xlibmesa-dev

Now we need to set some enviromental variables. So that our driver builds correctly.

# export KSRC=/usr/src/kernel-headers-<KernelVersion>
# export KVERS=<KernelVersion>
Contents

Compiling the driver module file

The next thing we need to do, is unpack the source of the driver.

# cd /usr/src
# tar xvzf nvidia-kernel-source.tar.gz

If you built your own kernel then type the following.

# cd /usr/src/kernel-source-<KernelVersion>
# make-kpkg modules_image

If your using a kernel image from Debian do this instead.

# cd /usr/src/modules/nvidia-kernel
# debian/rules binary_modules

Now fro either way we need to install the new driver.

# dpkg -i nvidia-kernel-<KernelVersion>-nvidia_<DriverVersion>+10.00.Custom_i386.deb

The file name might not be exactly this form, but it will be very similar. Now the next thing to do is install the glx driver.

# apt-get install nvidia-glx

If you downloaded it from the web do this instead.

cd <Where You Download Files>
# dpkg -i nvidia-glx_<DriverVersion>_i386.deb

When you do either of these their will be a configuration question about the TLS ( Thread Local Storage ) Libraries. You can simply answer the question. If your running two kernels ( one a 2.4 and another a 2.6 ), you can switch between the different versions of the Libraries with the command below.

# dpkg-reconfigure -plow nvidia-glx

Now we need to add the module to the running kernel. The command modconf brings up the module configuration. Their should be an entry at the bottom called nvidia. Select it. You'll be taken to a second level menu with two options. Select the bottom one. It will as you are you sure and it will also ask you for parameters. Just hit enter at both screens. When it has been successfully installed, exit the program.

If your running a 2.6 kernel, make sure that the driver for framebuffers is set to VESA and not anything else. VESA is slow but works. Currently their is no framebuffer driver for Nvidia cards. You can set this in the modconf program.

Contents

Configuring XFree86

We'll be editing the Configuration file for XFree86, we're going to make a back up of our current version then edit our config to get everything working.

# cd /etc/X11
# cp XF86Config-4 XF86Config-4.old
# vi XF86Config-4

First go down the file to to the Modules section we're looking for the GLcore and dri modules. We need to comment the lines out. to do this go to the beginning of the lines and press i followed by # then press esc twice.

Then we need to add a new line with Load "glx" on it. do this by going to the end of one of the lines in the section and pressing i followed by enter. and type it in. Then press esc twice.

his should leave this section of the file looking like the one below, alothough your config file may have other modules.

Section "Module"
Load "bitmap"
# Load "GLcore"
Load "dbe"
Load "ddc"
Load "extmod"
Load "freetype"
Load "glx"
Load "int10"
Load "record"
Load "speedo"
Load "type1"
Load "vbe"
# Load "dri"
EndSection

We also need to change the driver from nv too nvidia. Further down the file you will find a section named Device and the Driver "nv" line. press i and change it.

Section "Device"
Identifier "Generic Video Card"
Driver "nvidia"
EndSection

There are options you can pass to the nvidia driver here. My favourite is to add Option "NoLogo" "true". This switchs off the NVidia logo that comes up evertime the X server starts.

Finally all we have to do is comment out the dri section, its usually at the botton of the file.

#Section "DRI"
#Mode 0666
#EndSection

Now press shift-q followed by w and then enter to write the file. then press shift-q, q, enter to exit vi.

This is the time to switch off Debconf's handling of the Xfree86 config. If you don't then if you update programs and others etc. then Debconf will rewrite your XFree86 config and mess with our editing so type the following.

# dpkg-reconfigure xserver-xfree86

Answer no to the first question, and you should not have this problem. If you do updates and things aren't working as they should with something else, remeber the config isn't being handled automatically, so you have to keep on top of it yourself, or allow Debconf to do it, and re-edit the config it creates.

Contents

CC_MISMATCH error

One problem that does come up is with getting a CC_MISMATCH error. The make-kpkg tool says to bypass this problem set IGNORE_CC_MISMATCH. Simply type:

# export IGNORE_CC_MISMATCH=true

Then Retry the process that failed, and now it should work.

Contents