Differences between revisions 211 and 212
Revision 211 as of 2013-05-09 11:34:19
Size: 31943
Editor: warmsun0220
Comment:
Revision 212 as of 2013-05-24 15:47:01
Size: 10197
Editor: GeoffSimmons
Comment: Rewrite: only state DKMS procedures for stock Debian kernels, for current stable and oldstable releases.
Deletions are marked like this. Additions are marked like this.
Line 4: Line 4:
 . This document explains how to make use of NVIDIA video hardware on a Debian GNU/Linux system. The [[#free|following section]] shortly describes the free drivers while the [[#non-free|rest of the document]] covers the non-free but 3D-accelerated drivers.
<<TableOfContents>>
= NVIDIA Proprietary Driver =
Line 7: Line 6:
<<Anchor(free)>> This page describes how to install the NVIDIA proprietary display driver on Debian systems.
Line 9: Line 8:
= Free drivers =
Debian has three free drivers that support NVIDIA cards. You can see which one is in use by running
<<TableOfContents(4)>>
Line 12: Line 10:
{{{
$ grep -B2 'Module class: X.Org Video Driver' /var/log/Xorg.0.log
== Identification ==

The NVIDIA graphics processing unit (GPU) series/codename of an installed video card can usually be identified using the {{{lspci}}} command. For example:
 {{{
$ lspci -nn | grep VGA
01:00.0 VGA compatible controller [0300]: nVidia Corporation G80 [GeForce 8800 GTS] [10de:0193] (rev a2)
Line 16: Line 18:
You can simply [[ConfigureX|configure X]] to change the free driver to use. See [[HowToIdentifyADevice/PCI]] for more information. The PCI ID can be used to verify device support.
Line 18: Line 20:
None of the free drivers fully support 3D acceleration, though the Nouveau drivers [[http://nouveau.freedesktop.org/wiki/MesaDrivers|have 3D acceleration]]. Only the non-free ''nvidia'' drivers support full 3D acceleration, but they are more complex and X is more likely to break, you're reliant on NVIDIA to fix bugs. If X breaks and it seems difficult to get X to work with the non-free ''nvidia'' drivers, remember that switching back to a free driver should get X working again. == Drivers ==
Line 20: Line 22:
== vesa == The proprietary "NVIDIA Accelerated Linux Graphics Driver" provides optimized hardware acceleration of OpenGL applications via a direct-rendering X server. It is a binary-only [[Xorg]] driver requiring a Linux kernel module for its use.
Line 22: Line 24:
The ''vesa'' driver is a generic video driver. Three driver versions are available for [[DebianWheezy|Debian 7.0 "Wheezy"]]:
Line 24: Line 26:
== nv ==  * [[#wheezy|Version 304.88]] ([[http://us.download.nvidia.com/XFree86/Linux-x86/304.88/README/supportedchips.html|supported devices]])
  * For !GeForce 6xxx and higher GPUs.
 * [[#wheezy-173xx|Version 173.14.35 (legacy GPUs)]] ([[http://www.nvidia.com/object/IO_32667.html|supported devices]])
  * For !GeForce 5xxx / !GeForce FX GPUs.
 * [[#wheezy-96xx|Version 96.43.23 (legacy GPUs)]] ([[http://www.nvidia.com/object/IO_32667.html|supported devices]])
  * For !GeForce 2, !GeForce 3 and !GeForce 4 GPUs.
Line 26: Line 33:
The ''nv'' driver usually gives better results than ''vesa'', but it is not included on wheezy or newer releases. Three driver versions are available for [[DebianSqueeze|Debian 6.0 "Squeeze"]]:
Line 28: Line 35:
== Nouveau ==
In addition to ''vesa'' and ''nv'', Debian contains the Nouveau drivers starting with squeeze. The Nouveau drivers are reverse-engineered from official NVIDIA drivers. These drivers are experimental and not recommended, unless you are having issues with the ''nv'' driver and don't want to use the ''nvidia'' drivers. Nouveau drivers will be stable starting with Wheezy.
 * [[#squeeze|Version 195.36.31]] ([[http://us.download.nvidia.com/XFree86/Linux-x86/195.36.31/README/supportedchips.html|supported devices]])
  * For !GeForce 6xxx and higher GPUs, through to some !GeForce 400 series.
 * [[#squeeze-173xx|Version 173.14.27 (legacy GPUs)]] ([[http://www.nvidia.com/object/IO_32667.html|supported devices]])
  * For !GeForce 5xxx / !GeForce FX GPUs.
 * [[#squeeze-96xx|Version 96.43.18 (legacy GPUs)]] ([[http://www.nvidia.com/object/IO_32667.html|supported devices]])
  * For !GeForce 2, !GeForce 3 and !GeForce 4 GPUs.
Line 31: Line 42:
=== Installation === The 71.86.xx driver - supporting NVIDIA NV4/NV5/NV6/NV10/NV15 GPUs and variants - is not available, as this does not support Xorg X server versions later than 1.4 (DebianBug:620526, DebianBug:708338).
Line 33: Line 44:
To use the nouveau drivers, your kernel drm version and your libdrm version need to match. The installation can basically be done this way:
{{{
# apt-get install xserver-xorg-video-nouveau
}}}
Then [[ConfigureX|configure X]] and set ''nouveau'' as your device driver.

<<Anchor(non-free)>>

= Non-free drivers =

== Why use a Debian-specific method? ==
NVIDIA drivers can be installed using NVIDIA's official installer or the Debian driver packages. Each method has its advantages, but the Debian way is probably easier. Even when building a driver module manually, the Debian way is more reliable and probably will save labor in the long run.

NVIDIA's installer is documented at other places such as [[NvidiaGraphicsDriversNvidiaWay|this one]].

Whichever installation method, the [[#Troubleshooting|troubleshooting section]] may help.

=== Comparison of nvidia-installer and the Debian way ===
Advantages of "the Debian way":

 * More automated, which saves work if the kernel is changed.
 * Uses Debian package management tools, so it's cleaner. If your system breaks after using the Debian way, that would be a bug which can be reported in the BTS.
 * Can be done while X is running. (X must be restarted to apply the driver change.)
 * Users of ''make-kpkg'' should find it fits easily into their existing build procedure.
 * No downloading files from ''nvidia.com'', the Debian packages contain all necessary parts.

Advantages of NVIDIA's official installer:

 * Most recent NVIDIA driver versions. Debian packages commonly lag behind a month or more. You can compare the [[http://www.nvidia.com/object/unix.html|current version]] and the [[DebianPkg:nvidia-glx|latest version in your Debian release]] to see if there's a difference.
<<Anchor(Installation)>>
All versions above are available only for the x86 and x86-64 architectures (Debian [[i386]] and [[DebianAMD64|AMD64]] ports respectively).
Line 65: Line 47:
How to install the NVIDIA 3D drivers, the Debian way.
Line 67: Line 48:
=== Overview ===
The NVIDIA 3D drivers consist of two parts: a kernel module, and a collection of user-space libraries and a X video driver. The libraries and the X driver (sometimes called the "binary driver" or GLX libraries) are distributed in binary form by NVIDIA, and are packaged for Debian in the DebianPkg:nvidia-glx packages. Since NVIDIA's 3D drivers are not open source, non-free APT sources are needed to install them. The kernel module (aka the "kernel interface to the binary driver") is distributed in source form (though with one binary component), and packaged for Debian in the DebianPkg:nvidia-kernel-source packages. The version numbers of the kernel module and user-space libraries and X video driver must match. User libraries only need be installed once, but the kernel module must be recompiled every time the kernel is changed. What to do:
<<Anchor(wheezy)>>
=== Debian 7.0 "Wheezy" ===
Line 70: Line 51:
 * 0. Make sure APT has ''non-free'' and ''contrib'' sources (consult the [[DebianMan:5/sources.list|sources.list(5)]] man page for help on doing this)
 * 1. Determine which version of the drivers should be installed.
 * 2. Install the kernel module
 * 3. Install the user-space GLX libraries and the X driver
 * 4. Configure X to use the ''nvidia'' driver
Steps 3 and 4 need only be done once, but Step 2 is required every time the kernel is changed.
==== Version 304.88 ====
Line 77: Line 53:
=== Steps ===
<<Anchor(Legacy)>>
For support of !GeForce 6xxx and higher GPUs ([[http://us.download.nvidia.com/XFree86/Linux-x86/304.88/README/supportedchips.html|supported devices]]). For older devices, see [[#wheezy-173xx|Version 173.14.35 (legacy GPUs)]] and [[#wheezy-96xx|Version 96.43.23 (legacy GPUs)]].
Line 80: Line 55:
==== Choose a driver version ====
The current drivers do not support some legacy NVIDIA cards. Up to now, the NVIDIA drivers dropped support for some legacy cards 3 times. However, NVIDIA maintains the last driver version released before a legacy cards support drop. This means there are currently 4 drivers series maintained by NVIDIA. The first support drop happened in 2005, so the oldest legacy drivers series (71''xx'') should support cards released before 2005 but not those released after 2005. The second support drop happened in 2006, leading to the 96''xx'' legacy drivers series. The third support drop happened in 2008, leading to the 173.14 legacy drivers series.
 1. Add "contrib" and "non-free" components to {{{/etc/apt/sources.list}}}, for example: {{{
# Debian 7.0 "Wheezy"
deb http://http.debian.net/debian/ wheezy main contrib non-free
}}}
 1. Update the list of available packages. Install the appropriate linux-headers and kernel module packages: {{{
# aptitude update
# aptitude -r install linux-headers-$(uname -r|sed 's,[^-]*-[^-]*-,,') nvidia-kernel-dkms
}}}
 This will also install the recommended [[DebianPkg:wheezy/nvidia-glx|nvidia-glx]] package. DKMS will build the nvidia module for your system.
 1. Create an [[#configure|Xorg server configuration file]].
 1. Restart your system to enable the nouveau blacklist.
Line 83: Line 67:
No Debian suite contains the 4 available drivers series, but it may be possible to install unofficial packages if your card requires a drivers series not available in your suite. Squeeze and Lenny both contain the newest and second newest legacy series, 173.14 and 96.43. Squeeze also contains the current series. Wheezy only contains the current series. The oldest drivers series, 71xx, is not in any current Debian suite (except unstable, but unusable). It is basically impossible to use the nvidia driver on cards no longer supported after 71xx on a current Debian suite. <<Anchor(wheezy-173xx)>>
==== Version 173.14.35 (legacy GPUs) ====
Line 85: Line 70:
The 71xx version is the only one to support RIVA TNT, RIVA TNT2/TNT2 Pro, RIVA TNT2 Ultra, Vanta/Vanta LT, RIVA TNT2 Model 64/Model 64 Pro, Aladdin TNT2, !GeForce 256, !GeForce DDR, Quadro, !GeForce2 GTS / !GeForce2 Pro, !GeForce2 Ti, !GeForce2 Ultra and Quadro2 Pro. Versions newer than 96.43 do not support !GeForce2 and !GeForce4 cards. [[http://www.nvidia.com/object/IO_32667.html|A more detailed list]] of cards only supported by legacy drivers is available. For support of !GeForce 5xxx / !GeForce FX GPUs ([[http://www.nvidia.com/object/IO_32667.html|supported devices]]).
Line 87: Line 72:
Debian distributes several versions of the drivers using several packages with different names. For example, the X driver and user-space libraries from the current series are in the ''nvidia-glx'' package. However, with time, the current drivers become legacy drivers, so the ''nvidia-glx'' package in Lenny is not current anymore.  1. Add "contrib" and "non-free" components to {{{/etc/apt/sources.list}}}, for example: {{{
# Debian 7.0 "Wheezy"
deb http://http.debian.net/debian/ wheezy main contrib non-free
}}}
 1. Update the list of available packages. Install the appropriate linux-headers and kernel module packages: {{{
# aptitude update
# aptitude -r install linux-headers-$(uname -r|sed 's,[^-]*-[^-]*-,,') nvidia-kernel-legacy-173xx-dkms
}}}
 This will also install the recommended [[DebianPkg:wheezy/nvidia-glx-legacy-173xx|nvidia-glx-legacy-173xx]] package. DKMS will build the nvidia module for your system.
 1. Create an [[#configure|Xorg server configuration file]].
 1. Restart your system to enable the nouveau blacklist.
Line 89: Line 84:
Use current drivers if possible. You can determine which cards are supported by consulting [[http://us.download.nvidia.com/XFree86/Linux-x86/195.36.24/README/supportedchips.html|Appendix A of NVIDIA's 195.36.24 driver README]]. <<Anchor(wheezy-96xx)>>
==== Version 96.43.23 (legacy GPUs) ====
Line 91: Line 87:
Set a VERSION variable, which the rest of the instructions will refer to, to "-legacy-96xx", "-legacy-173xx" or an empty string. If you want to install the default version from your suite, there is no need to set VERSION to the empty string. To find the name of a card, you can try ''lspci''. To determine which version you should use, you can run [[attachment:nvidia-versions.sh|this script]], which will propose to set VERSION. For support of !GeForce 2, !GeForce 3 and !GeForce 4 GPUs ([[http://www.nvidia.com/object/IO_32667.html|supported devices]]).
Line 93: Line 89:
==== Install the kernel module ====  1. Add "contrib" and "non-free" components to {{{/etc/apt/sources.list}}}, for example: {{{
# Debian 7.0 "Wheezy"
deb http://http.debian.net/debian/ wheezy main contrib non-free
}}}
 1. Update the list of available packages. Install the appropriate linux-headers and kernel module packages: {{{
# aptitude update
# aptitude -r install linux-headers-$(uname -r|sed 's,[^-]*-[^-]*-,,') nvidia-kernel-legacy-96xx-dkms
}}}
 This will also install the recommended [[DebianPkg:wheezy/nvidia-glx-legacy-96xx|nvidia-glx-legacy-96xx]] package. DKMS will build the nvidia module for your system.
 1. Create an [[#configure|Xorg server configuration file]].
 1. Restart your system to enable the nouveau blacklist.
Line 95: Line 101:
===== Stock or custom kernel? =====
Some of the installation methods below depend on whether you're running a stock kernel, i.e. a prebuilt kernel from the Debian distribution. If you know which kind of kernel you have, you can skip to the [[#Methods|following section]].
<<Anchor(squeeze)>>
=== Debian 6.0 "Squeeze" ===
Line 98: Line 104:
By default, Debian comes with a stock kernel. If you don't know what kind of kernel you're running, then it's probably a stock kernel. If you're not sure, run ==== Version 195.36.31 ====
Line 100: Line 106:
{{{
$ uname -r
For support of !GeForce 6xxx and higher GPUs ([[http://us.download.nvidia.com/XFree86/Linux-x86/195.36.31/README/supportedchips.html|supported devices]]), up to and including some !GeForce 400 series devices. For older devices, see [[#squeeze-173xx|Version 173.14.27 (legacy GPUs)]] and [[#squeeze-96xx|Version 96.43.18 (legacy GPUs)]].

 1. Add "contrib" and "non-free" components to {{{/etc/apt/sources.list}}}, for example: {{{
# Debian 6.0 "Squeeze"
deb http://http.debian.net/debian/ squeeze main contrib non-free
Line 103: Line 112:
and check if the output looks like 2.*.*-small number-architecture (e.g. or 2.6.18-6-486). If it does, you're most likely running a stock kernel.  1. Update the list of available packages. Install the appropriate linux-headers and kernel module packages: {{{
# aptitude update
# aptitude -r install linux-headers-2.6-$(uname -r|sed 's,[^-]*-[^-]*-,,') nvidia-kernel-dkms
}}}
 This will also install the recommended [[DebianPkg:squeeze/nvidia-glx|nvidia-glx]] package. DKMS will build the nvidia module for your system.
 1. Update the initial ramdisk to include the nouveau blacklist (DebianBug:613951): {{{
# update-initramfs -u
}}}
 1. Create an [[#configure|Xorg server configuration file]].
 1. Restart your system to enable the nouveau blacklist.
Line 105: Line 123:
<<Anchor(Methods)>> <<Anchor(squeeze-173xx)>>
==== Version 173.14.27 (legacy GPUs) ====
Line 107: Line 126:
===== Methods =====
There are five different methods for installing the kernel module.
For support of !GeForce 5xxx / !GeForce FX GPUs ([[http://www.nvidia.com/object/IO_32667.html|supported devices]]).
Line 110: Line 128:
<<Anchor(Method1)>>  1. Add "contrib" and "non-free" components to {{{/etc/apt/sources.list}}}, for example: {{{
# Debian 6.0 "Squeeze"
deb http://http.debian.net/debian/ squeeze main contrib non-free
}}}
 1. Update the list of available packages. Install the appropriate linux-headers and kernel module packages: {{{
# aptitude update
# aptitude -r install linux-headers-2.6-$(uname -r|sed 's,[^-]*-[^-]*-,,') nvidia-kernel-legacy-173xx-dkms
}}}
 This will also install the recommended [[DebianPkg:squeeze/nvidia-glx-legacy-173xx|nvidia-glx-legacy-173xx]] package. DKMS will build the nvidia module for your system.
 1. Update the initial ramdisk to include the nouveau blacklist (DebianBug:613951): {{{
# update-initramfs -u
}}}
 1. Create an [[#configure|Xorg server configuration file]].
 1. Restart your system to enable the nouveau blacklist.
Line 112: Line 143:
===== Use module-assistant ===== <<Anchor(squeeze-96xx)>>
==== Version 96.43.18 (legacy GPUs) ====
Line 114: Line 146:
This method is easy, and should work with most stock or custom kernels. For a custom kernel, you need to have its Linux headers installed. For support of !GeForce 2, !GeForce 3 and !GeForce 4 GPUs ([[http://www.nvidia.com/object/IO_32667.html|supported devices]]).
Line 116: Line 148:
It needs DebianPkg:module-assistant and DebianPkg:nvidia-kernel-common. To install them with apt-get:  1. Add "contrib" and "non-free" components to {{{/etc/apt/sources.list}}}, for example: {{{
# Debian 6.0 "Squeeze"
deb http://http.debian.net/debian/ squeeze main contrib non-free
}}}
 1. Update the list of available packages. Install the appropriate linux-headers and kernel module packages: {{{
# aptitude update
# aptitude -r install linux-headers-2.6-$(uname -r|sed 's,[^-]*-[^-]*-,,') nvidia-kernel-legacy-96xx-dkms
}}}
 This will also install the recommended [[DebianPkg:squeeze/nvidia-glx-legacy-96xx|nvidia-glx-legacy-96xx]] package. DKMS will build the nvidia module for your system.
 1. Update the initial ramdisk to include the nouveau blacklist (DebianBug:613951): {{{
# update-initramfs -u
}}}
 1. Create an [[#configure|Xorg server configuration file]].
 1. Restart your system to enable the nouveau blacklist.
Line 118: Line 163:
{{{
# apt-get install module-assistant nvidia-kernel-common
}}}
<<Anchor(configure)>>
== Configuration ==
Line 122: Line 166:
Run the following command: As the nvidia driver is not autodetected by [[Xorg]], a configuration file is required to be supplied. For example:
Line 124: Line 168:
{{{
# m-a auto-install nvidia-kernel${VERSION}-source
}}}
And that's it. If all went well, your ''nvidia'' kernel module is now built and installed; you may [[#Libraries|proceed to step 3]]. If not, read the rest of this section.

You must use the same version of gcc to build your nvidia kernel module as was used to build your kernel. This might be a problem if you are running a stock kernel. If module-assistant fails, read its log output and look for messages suggesting that you need, for example, gcc-4.0 instead of gcc-4.1. Then install the corresponding package and retry ''auto-install''.

The ''auto-install'' step is the biggest step of the procedure, and is the most likely to fail. ''auto-install'' can be divided in smaller module-assistant steps, which can help debugging:

 * ''get''
 * ''build''
 * ''install''
If # m-a get nvidia; fails, try installing the DebianPkg:nvidia-kernel-source package. If APT fails to install nvidia-kernel-source, you should go back to step 0 and make sure you didn't miss something.

If you are unable to install the module using module-assistant, try [[#Method2|installing a pre-built module]] if you use a stock kernel or try to [[#Method4|build manually, with a custom kernel]].

<<Anchor(Method2)>>

===== Install a pre-built module =====
This method is easy if you're running a recent stock kernel for which a pre-built module is available; it will not work at all if you're running a custom kernel or if you're running Debian 6 and need a legacy driver. There are pre-built modules available for all the kernels installed by default by Debian Lenny, and pre-built modules for the current drivers series for all kernels installed by default by Debian Squeeze. If the module-assistant method doesn't work for you and there are pre-built modules available for your kernel, use this method.

If you don't know your kernel version, run

{{{
$ uname -r
}}}
If there is a pre-built module for your kernel, install its package. The name starts with "nvidia-kernel-". This is followed by an indication of the drivers series you want (this string is empty for the default drivers series). The name ends by the identifier of your Linux image. For example, with apt-get:

{{{
# apt-get install nvidia-kernel${VERSION}-$(uname -r)
}}}
If this step succeeds, you may now [[#Libraries|proceed to step 3]]. If there are no pre-built modules for your kernel, and [[#Method1|method 1]] and [[#Method3|method 3]] fail, you may want to try [[#Method5|method 5]].

<<Anchor(Method3)>>

===== Use DKMS =====
This is the easiest method and recommended unless you have some reason to not want to install a compiler.

All you need to do is install the kernel headers package for the Linux image that you're running (usually named '''linux-headers-<version>''' where <version> is whatever version of kernel you're running) and then install '''nvidia-kernel-dkms''' or the nvidia-kernel-legacy-...-dkms package for the legacy version of the drivers that you need.

DKMS will take care of the build and install process automatically.

<<Anchor(Method4)>>

===== Build manually, with a custom kernel =====
Use this method if you're configuring and building a custom kernel. This method is known to be possibly inexact or incomplete.

 1. Install the kernel module source. For example, with apt-get:
{{{/etc/X11/xorg.conf.d/20-nvidia.conf}}}
Line 173: Line 170:
# apt-get install nvidia-kernel${VERSION}-source
}}}
 This will install a source tarball in ''/usr/src/''. Unpack it in ''/usr/src'':
 {{{
$ cd /usr/src
# tar -xf nvidia-kernel-*.tar.gz
}}}
 This will unpack the kernel module sources into ''/usr/src/modules/nvidia-kernel[something]''.

 1. Configure your kernel. This step isn't documented here; if you need to learn how, see the kernel-package documentation. But in summary, what you have to do is
 {{{
$ cd /usr/src/linux
# make xconfig
}}}
 and then choose the options you want. Note, however, that each of the following kernel options has been reported to cause trouble with the ''nvidia'' driver (the first 2 are gone for Debian 7):
  * Device drivers –> Graphics Support –> nVidia Riva support (FB_RIVA)
  * Device drivers –> Graphics support –> nVidia Framebuffer Support (FB_NVIDIA)
  * Device drivers –> Graphics support –> VESA VGA graphics support (FB_VESA)
  * Processor Type and Features –> Local APIC support on uniprocessors (X86_UP_APIC) (not available if you have an SMP kernel, including hyperthreading)
 It is therefore recommended that you disable all of the above options in your kernel configuration. If for some reason you don't disable them, and then your X display doesn't work properly with the ''nvidia'' driver, you should suspect these options as the likely cause of the trouble. For more details, see the Troubleshooting section.

 1. Build the kernel and the ''nvidia'' kernel module:
 {{{
# make-kpkg clean
# make-kpkg kernel_image modules_image
}}}
 For an introduction to using make-kpkg to build kernel packages, see [[http://newbiedoc.sourceforge.net/system/kernel-pkg.html|Creating custom kernels with Debian's kernel-package system]], or [[http://www.debianuniverse.com/readonline/chapter/21|Compiling Kernels the Debian Way]]. See also the [[DebianMan1/make-kpkg|make-kpkg(1)]] man page, for a description of other options and targets that you can use in this command. The result of the above command will be two Debian package files, linux-image-*.deb and nvidia-kernel-*.deb, both in /usr/src or /usr/src/modules. The first file contains your kernel, and the second contains your '''nvidia''' kernel module. <<BR>>At the same time, if you have sources for any other add-on kernel modules in /usr/src/modules, then the "modules_image" target will cause make-kpkg to build Debian package files for them, too. For example, if you install the fuse-source package you'll get a source archive /usr/src/fuse.tar.gz, which you can unpack to get fuse module sources in /usr/src/modules/fuse. If you've done this, then this same invocation of make-kpkg will also build a fuse module package file, /usr/src/fuse-*.deb, that's specific to your new kernel.

 1. Install the new kernel and kernel module:
 {{{
$ cd /usr/src
# dpkg -i /path/linux-image-*.deb /path/nvidia-kernel-*.deb
}}}
 Use the fileglobs as above if you want, but watch out that you don't have more than one Linux image or nvidia-kernel package file lying around in /usr/src. If you do you'll get a blizzard of error messages. It's probably better to explicitly type all of the version information rendered as * above.
  
 1. Boot your new kernel. Before trying to get the NVIDIA 3D drivers to work, make sure that the new kernel boots and that X starts well using a free X driver.
[[#Libraries|Proceed to step 3]].

<<Anchor(Method5)>>

===== Build manually, with a stock kernel =====
Use this method if you're running a stock kernel and the two first methods failed. module-assistant should automate this process. In other words, if the first method failed but this one works, you should probably submit a bug report against module-assistant.

The following procedure is adapted from the instructions in /usr/share/doc/nvidia-kernel-source/README.Debian and is known to be potentially inexact.

 1. Save the release number of your kernel (e.g. 2.6.18-6-686) in a couple of environment variables:
 {{{
export KVERS=$(uname -r)
export KSRC=/usr/src/linux-headers-$KVERS
export KPKG_DEST_DIR=/usr/src
}}}
 Note that these variables are used by the build commands below, so you really do need to set and export them, as in the above commands.
 1. Install the kernel module source: run
 {{{
# apt-get install nvidia-kernel-source nvidia-kernel-common
}}}
 This will give you a source tarball /usr/src/nvidia-kernel-source.tar.gz. Unpack it with
 {{{
$ cd /usr/src
# tar -zxf nvidia-kernel-source.tar.gz
}}}
 This will unpack the kernel module sources into /usr/src/modules/nvidia-kernel.
 In case there is no such tarball, but /usr/src/nvidia-kernel.tar.bz2, unpack it with
 {{{
$ cd /usr/src
# tar -jxf nvidia-kernel.tar.bz2
}}}
 1. Install the header files for your kernel:
 {{{
# apt-get install linux-headers-$KVERS
}}}
 This will give you kernel header files in /usr/src/linux-headers-$KVERS. Be sure to check that the installed kernel image and kernel header packages have the same version number: run
 {{{
$ apt-cache policy linux-image-$KVERS linux-headers-$KVERS
}}}
 and check that the version number listed as Installed is the same for both packages. If it isn't, find the distribution that has the version of linux-headers that you need, e.g. testing, and rerun the above installation command, adding '-t testing' (or whichever).
 1. Build the kernel module package:
 {{{
$ cd /usr/src/modules/nvidia-kernel
# debian/rules binary-modules
}}}
 The result will be a package file /usr/src/nvidia-kernel-*.deb, which contains your kernel module. Note: several users have told me recently that their nvidia package file ends up in /usr/src/modules, instead of /usr/src. I don't know yet why this happens. If this is your case, please adjust the next command appropriately.
 1. Install the kernel module:
 {{{
# dpkg -i /usr/src/nvidia-kernel-*.deb
}}}
 Use the fileglob as above if you want, but watch out that you don't have more than one nvidia-kernel package file lying around in /usr/src. If you do you'll get a blizzard of error messages. It's probably better to explicitly type all of the version information that I rendered as * above.
Now [[#Libraries|proceed to step 3]], below. <<Anchor(Libraries)>>

==== Install the NVIDIA X driver and user-space libraries ====
Install the X driver and user-space libraries package. For example, with apt-get:

{{{
# apt-get install nvidia-glx${VERSION}
}}}
Note: The reason this step has to come after step 2 is that nvidia-glx depends on a virtual package called 'nvidia-kernel-$NVVERSION', where $NVVERSION is the upstream part of the version of the nvidia-glx package. This virtual package should be provided by the kernel module package that you installed in step 2; so you have to complete that step first. If the installation of nvidia-glx fails because the 'nvidia-kernel-$NVVERSION' isn't satisfied, you should probably make sure that step 2 went OK.

==== Configure X to use the nvidia driver ====
You can use [[#config-manual|The manual way]] or [[#using-nvidia-xconfig|nvidia-xconfig]], which will create a basic xorg.conf and a final one with your preferred settings.

<<Anchor(config-manual)>>
===== The manual way =====
/etc/X11/xorg.conf can instruct X to use the nvidia driver. If you have one, modify it, otherwise it must be created.

====== Modify an existing xorg.conf ======
Consider backing up your current X configuration file:

{{{
# cp -p /etc/X11/xorg.conf /etc/X11/xorg.conf.bak
}}}
Watch out for typos, and check your X log if things go wrong.

Edit /etc/X11/xorg.conf:

 * If it contains a "Module" section, remove or comment out (prepend with a #) any lines that refer to the "dri" or "GLCore" modules.
 * In the "Device" section for your video card, change the driver (normally nv or vesa) to '''nvidia'''. If the driver is not defined, add the line
 {{{
Driver "nvidia"
}}}

====== Create an xorg.conf ======
Create an xorg.conf with the following content:

{{{
Line 298: Line 171:
    Identifier "Video Card"
    Driver  "nvidia"
    Identifier     "My GPU"
    Driver         "nvidia"
Line 303: Line 176:
<<Anchor(using-nvidia-xconfig)>>
===== Using nvidia-xconfig =====
'''Warning''': this method is generally not recommended due to an important X bug (DebianBug:504692).

Install nvidia-xconfig. For example, using apt-get:
{{{
# apt-get install nvidia-xconfig
}}}
Now make a basic xorg.conf to include NVIDIA driver:

{{{
# nvidia-xconfig
The configuration file above can be created using these commands:
 {{{
# mkdir /etc/X11/xorg.conf.d
# echo -e 'Section "Device"\n\tIdentifier "My GPU"\n\tDriver "nvidia"\nEndSection' > /etc/X11/xorg.conf.d/20-nvidia.conf
Line 317: Line 182:
=== Restart X ===
This is the easiest but probably most crucial step. If it doesn't work for some reason, and you want to get back to X before fixing the problem, you'll have to revert step 4 (by choosing a free X driver again). When you think you fixed the problem, you can do step 4 again and retry starting X. Remember that even if it works you'll want to read the [[#Upgrades|next section]] to avoid future trouble. And if it doesn't...check the Troubleshooting section.
'''Restart your system at this point to enable the nouveau driver blacklist.'''
Line 320: Line 184:
If you don't use a display manager, simply close your session. That should bring to a console. If it doesn't, you must be using a display manager (such as gdm, kdm or xdm). First identify which one you're using. If you don't know, it's probably gdm. You can know by checking whether a process ending with "dm" is running. Once you determined which one you use, close your session and go run the appropriate init script in a console. Here's an example for gdm: == Troubleshooting ==
Line 322: Line 186:
{{{
# invoke-rc.d gdm restart
 * The NVIDIA driver conflicts with the nouveau DRM driver (DebianBug:580894). The nouveau kernel module is blacklisted by the DebianPkg:nvidia-kernel-common package.
  * Restart your system after [[#configure|configuring Xorg]] for the NVIDIA driver.
  * From [[DebianPkg:xserver-xorg-video-nouveau]]'s README.Debian: {{{
If you decide to switch to the proprietary driver, it is highly
recommended to reboot because it is incompatible with nouveau, and
unloading the latter is not easy and may lead to a blank console.
Line 325: Line 193:
Alternatively, you can simply press Alt+E at the login screen if you use kdm. If you can't figure out how to restart X with those instructions, you can simply reboot your system. Otherwise, the keyboard shortcut Ctrl+Alt+Backspace should be reliable, despite being somewhat "unfriendly".
Line 327: Line 194:
==== Check that it worked ====
To check that the acceleration is working, glxinfo can be used. This program is in the mesa-utils package. If
== See Also ==
Line 330: Line 196:
{{{
$ glxinfo |grep rendering
}}}
returns "direct rendering: Yes", acceleration is working. If it returns No, [[#nodri|see section "Hardware acceleration, aka direct rendering, doesn't work"]]. If it returns Yes, 3D acceleration (in games such as !PlanetPenguin Racer or Extreme Tux Racer and Neverball) should work.
<<Anchor(Upgrades)>>
 * [[Xorg]]
Line 336: Line 198:
== How to deal with kernel changes and driver upgrades ==
Steps 3 and 4 are done for good. However, you'll have to repeat step 2 in certain situations. If you don't realize such a situation happens, X will fail to start. You can take two approaches with this: either remember when this will happen and try to prevent it, or remember to come back here when your X fails to start. Either way, you're not done for life. If X fails to start because of this, you can again revert step 4 (by choosing a free X driver again) and redo it when you want to retry using the ''nvidia'' driver for X.

=== When ===
Step 2 installs an ''nvidia'' kernel module for a specific kernel and NVIDIA driver version. You'll have to do it for each kernel, and you'll have to redo it for each new driver version. If you don't know what this means, read on.

==== ...will the NVIDIA driver version change ====
If you're using Debian stable, this won't happen until you upgrade to the next Debian release, but it will happen then.

In all cases, this will happen when the nvidia-glx package is upgraded. All versions of nvidia-glx depend on an nvidia-kernel-''version'' virtual package. When you followed step 2, you installed a package providing this virtual package. However, if you upgrade nvidia-glx before doing step 2 again, APT will attempt to satisfy the virtual package, usually by installing nvidia-kernel-dkms. Instead of letting it do, do step 2 again to get an appropriate kernel module. Then, the virtual package will be satisfied and you can upgrade nvidia-glx safely and without installing a useless package.

==== ...will your kernel change ====
If you build other modules using module-assistant, you have to redo step 2 everytime you'd have to run module-assistant for other modules, that is for every new kernel ABI. If you don't know what that means, read on.

If you install a kernel with a new ABI, a new Linux image package will be installed. For example, if the Linux 2.6.18 gets a new ABI and you currently use linux-image-2.6.18-4-486, you will have to install the linux-image-2.6.18-5-486 package to get the new kernel (the "-4" and "-5" part of the package names indicate respectively that these packages contain the fourth and fifth ABI of Debian's 2.6.18 i386 stock kernels). This may happen without your intervention when upgrading your system if the linux-image-2.6-486 meta package is installed. This can also happen if you install a different kernel. For example, you can have both 2.6.26 and 2.6.32 in Lenny. If you did step 2 for 2.6.26 only, you'll need to do it for 2.6.32 too. You'll notice that a new kernel is installed when a new linux-image-''something'' package is installed. X will fail to start after you booted a new kernel until you perform step 2 for that kernel.

= Troubleshooting =
== X doesn't start ==

You'll find log messages in {{{/var/log/Xorg.0.log}}}.

If you're using "nouveau", check "nomodeset" was ''not'' passed to the kernel (check {{{/etc/default/grub}}}, and if you have to change it, run update-grub after). Check you don't have the nvidia kernel module loaded ({{{lsmod|grep nvidia}}}, and if necessary {{{rmmod nvidia}}}). If you used nvidia-installer, you may also want to check the contents of the files created in /etc/modprobe.d/. The nouveau driver might be blacklisted there as well.

If you're using the "nvidia" driver, make sure the nouveau kernel module isn't loaded ({{{lsmod|grep nouveau}}}, and if necessary {{{rmmod nouveau}}}). If you can't remove the nouveau module and X isn't running, it's usually because the terminal is using it for a better resolution. To prevent this, blacklist the nouveau module (add a line saying "blacklist nouveau" to /etc/modprobe.d/blacklist.conf) and reboot. (Blacklisting the module won't prevent you loading it manually, but will stop it being auto-loaded which is what you want.)

'''Warning: if you switch back to the nouveau driver and don't remove "nomodeset", X won't start.'''

As a last resort, use the "vesa" driver (it nearly always works, but isn't pretty).

== X (or the complete machine when running X) is unstable ==
 * Check whether you use a framebuffer, such as rivafb, nvidiafb and vesafb. The rivafb driver is known to conflict with NVIDIA's drivers. vesafb is known to work in some cases but also to be problematic in other cases. All of these drivers are compiled as modules in stock kernels, except for vesafb. To see if you have one of these modules inserted in your kernel, run
 {{{
$ lsmod|grep 'rivafb\|vesafb\|nvidiafb'
}}}
 If this outputs something, get rid of the module(s) displayed.
 {{{
# rmmod rivafb vesafb nvidiafb
}}}
 will remove the modules temporarily (for this boot). If something causes one of the modules to load automatically at boot, blacklist the modules. If you are using a custom kernel, do not compile these modules in (Device drivers –> Graphics support –> nVidia Riva support (FB_RIVA), Device drivers –> Graphics support –> VESA VGA graphics support (FB_VESA) and Device drivers –> Graphics support –> nVidia Framebuffer Support (FB_NVIDIA)).

<<Anchor(nodri)>>

== Hardware acceleration, aka direct rendering, doesn't work ==
We've covered how to check that the installation worked in section "Check that it worked". If it doesn't, check that you adjusted your X configuration properly. You can do so by checking that

{{{
$ grep Driver /etc/X11/xorg.conf 2>&1|grep nvidia
}}}
returns something. If this is the case but you get an error when trying to use OpenGL apps like glxinfo that looks like this one:

{{{
Error: Could not open /dev/nvidiactl because the permissions
are too resticitive. Please see the FREQUENTLY ASKED QUESTIONS
section of /usr/share/doc/NVIDIA_GLX-1.0/README for steps
to correct.
Fatal signal: Segmentation Fault
}}}
you should make sure that the user running the application is in the ''video'' group.

== Various problems with X ==
Look in your X log file (/var/log/Xorg.0.log). The X server writes a lot of information there about what configuration files it's reading, what display modes it's trying, and errors (EE) it encounters along the way. You can very often find hints there to the source of whatever problem you're having.

== "nvidia license taints kernel" ==
If you get such a warning message on your console or in your syslog, don't worry. Your kernel is fine...or at least as fine as a kernel that can run NVIDIA's 3D driver can be. All this message means is that because your driver isn't open source, you won't get any support from the Linux maintainers if anything goes wrong with your kernel while the module is loaded. See the [[http://www.tux.org/lkml/#s1-18|LKML FAQ]] for more.

== Last resort ==
You can check [[http://www.nvnews.net/vbulletin/forumdisplay.php?f=14|the NVIDIA Linux Forum at nvnews.net]] for issues not related to Debian packaging. For Debian-specific issues, you may look at the bug tracking system or ask a question on Debian help resources, such as the debian-user mailing list and #debian on irc.debian.org.

= More information =
 * For more information about the drivers, see:
  * /usr/share/doc/nvidia-glx/README.Debian
  * /usr/share/doc/nvidia-glx/README.txt.gz
 These files have loads of information about options and for troubleshooting NVIDIA's proprietary drivers. Here's an enticement for you to read them: somewhere in one of them you can find an explanation of how to suppress the NVIDIA splash screen every time you start an X server (hint: search for "No{{{}}}Logo").
 * You can adjust the clock rates of your GPU and video RAM by running nvclock, nvclock_gtk, or nvclock_qt, available respectively in the nvclock, nvclock-gtk, and nvclock-qt packages. Obligatory warning: you can destroy your video hardware with these tools if you're not careful.
 * You can adjust some other, relatively obscure settings of the driver by running nvidia-settings, available in the nvidia-settings package.

= About this document =
This wiki page was created by [[http://philippecloutier.com|Philippe Cloutier]] to publish an update to ''Andrew's Debian-nVidia HOWTO''. You are free to modify this page as long as you agree to let copyright of your changes to the author. For problems, comments, or questions about the information in this document, you can [[mailto:chealer@gmail.com?subject=Debian-NVIDIA|write to the maintainer]]. He's no expert, but he'll do his best to make the document useful.

== Help wanted to maintain this document ==
This document's maintainer no longer uses an NVIDIA card and would like other people to take over maintainership. If you want to help, please [[mailto:chealer@gmail.com?subject=Debian-NVIDIA|contact him]] and/or go ahead.

== Credits ==
Thanks to Andrew Schulman for publishing his HOWTO, agreeing to share his rights on it, and making the HOWTO link to this page since it stopped being maintained.

== Licensing ==
This document is Copyright 2005, by Andrew E. Schulman. Permission is hereby granted to freely copy, distribute, and/or modify any of the contents of this document in any way and for any purpose.

== See also ==
 * [[GraphicsCard]]
----
CategoryProprietarySoftware

Translation(s): English - Español - Français - Italiano - Русский - 简体中文


NVIDIA Proprietary Driver

This page describes how to install the NVIDIA proprietary display driver on Debian systems.

Identification

The NVIDIA graphics processing unit (GPU) series/codename of an installed video card can usually be identified using the lspci command. For example:

  • $ lspci -nn | grep VGA
    01:00.0 VGA compatible controller [0300]: nVidia Corporation G80 [GeForce 8800 GTS] [10de:0193] (rev a2)

See HowToIdentifyADevice/PCI for more information. The PCI ID can be used to verify device support.

Drivers

The proprietary "NVIDIA Accelerated Linux Graphics Driver" provides optimized hardware acceleration of OpenGL applications via a direct-rendering X server. It is a binary-only Xorg driver requiring a Linux kernel module for its use.

Three driver versions are available for Debian 7.0 "Wheezy":

Three driver versions are available for Debian 6.0 "Squeeze":

The 71.86.xx driver - supporting NVIDIA NV4/NV5/NV6/NV10/NV15 GPUs and variants - is not available, as this does not support Xorg X server versions later than 1.4 (620526, 708338).

All versions above are available only for the x86 and x86-64 architectures (Debian i386 and AMD64 ports respectively).

Installation

Debian 7.0 "Wheezy"

Version 304.88

For support of GeForce 6xxx and higher GPUs (supported devices). For older devices, see Version 173.14.35 (legacy GPUs) and Version 96.43.23 (legacy GPUs).

  1. Add "contrib" and "non-free" components to /etc/apt/sources.list, for example:

    # Debian 7.0 "Wheezy"
    deb http://http.debian.net/debian/ wheezy main contrib non-free
  2. Update the list of available packages. Install the appropriate linux-headers and kernel module packages:

    # aptitude update
    # aptitude -r install linux-headers-$(uname -r|sed 's,[^-]*-[^-]*-,,') nvidia-kernel-dkms

    This will also install the recommended nvidia-glx package. DKMS will build the nvidia module for your system.

  3. Create an Xorg server configuration file.

  4. Restart your system to enable the nouveau blacklist.

Version 173.14.35 (legacy GPUs)

For support of GeForce 5xxx / GeForce FX GPUs (supported devices).

  1. Add "contrib" and "non-free" components to /etc/apt/sources.list, for example:

    # Debian 7.0 "Wheezy"
    deb http://http.debian.net/debian/ wheezy main contrib non-free
  2. Update the list of available packages. Install the appropriate linux-headers and kernel module packages:

    # aptitude update
    # aptitude -r install linux-headers-$(uname -r|sed 's,[^-]*-[^-]*-,,') nvidia-kernel-legacy-173xx-dkms

    This will also install the recommended nvidia-glx-legacy-173xx package. DKMS will build the nvidia module for your system.

  3. Create an Xorg server configuration file.

  4. Restart your system to enable the nouveau blacklist.

Version 96.43.23 (legacy GPUs)

For support of GeForce 2, GeForce 3 and GeForce 4 GPUs (supported devices).

  1. Add "contrib" and "non-free" components to /etc/apt/sources.list, for example:

    # Debian 7.0 "Wheezy"
    deb http://http.debian.net/debian/ wheezy main contrib non-free
  2. Update the list of available packages. Install the appropriate linux-headers and kernel module packages:

    # aptitude update
    # aptitude -r install linux-headers-$(uname -r|sed 's,[^-]*-[^-]*-,,') nvidia-kernel-legacy-96xx-dkms

    This will also install the recommended nvidia-glx-legacy-96xx package. DKMS will build the nvidia module for your system.

  3. Create an Xorg server configuration file.

  4. Restart your system to enable the nouveau blacklist.

Debian 6.0 "Squeeze"

Version 195.36.31

For support of GeForce 6xxx and higher GPUs (supported devices), up to and including some GeForce 400 series devices. For older devices, see Version 173.14.27 (legacy GPUs) and Version 96.43.18 (legacy GPUs).

  1. Add "contrib" and "non-free" components to /etc/apt/sources.list, for example:

    # Debian 6.0 "Squeeze"
    deb http://http.debian.net/debian/ squeeze main contrib non-free
  2. Update the list of available packages. Install the appropriate linux-headers and kernel module packages:

    # aptitude update
    # aptitude -r install linux-headers-2.6-$(uname -r|sed 's,[^-]*-[^-]*-,,') nvidia-kernel-dkms

    This will also install the recommended nvidia-glx package. DKMS will build the nvidia module for your system.

  3. Update the initial ramdisk to include the nouveau blacklist (613951):

    # update-initramfs -u
  4. Create an Xorg server configuration file.

  5. Restart your system to enable the nouveau blacklist.

Version 173.14.27 (legacy GPUs)

For support of GeForce 5xxx / GeForce FX GPUs (supported devices).

  1. Add "contrib" and "non-free" components to /etc/apt/sources.list, for example:

    # Debian 6.0 "Squeeze"
    deb http://http.debian.net/debian/ squeeze main contrib non-free
  2. Update the list of available packages. Install the appropriate linux-headers and kernel module packages:

    # aptitude update
    # aptitude -r install linux-headers-2.6-$(uname -r|sed 's,[^-]*-[^-]*-,,') nvidia-kernel-legacy-173xx-dkms

    This will also install the recommended nvidia-glx-legacy-173xx package. DKMS will build the nvidia module for your system.

  3. Update the initial ramdisk to include the nouveau blacklist (613951):

    # update-initramfs -u
  4. Create an Xorg server configuration file.

  5. Restart your system to enable the nouveau blacklist.

Version 96.43.18 (legacy GPUs)

For support of GeForce 2, GeForce 3 and GeForce 4 GPUs (supported devices).

  1. Add "contrib" and "non-free" components to /etc/apt/sources.list, for example:

    # Debian 6.0 "Squeeze"
    deb http://http.debian.net/debian/ squeeze main contrib non-free
  2. Update the list of available packages. Install the appropriate linux-headers and kernel module packages:

    # aptitude update
    # aptitude -r install linux-headers-2.6-$(uname -r|sed 's,[^-]*-[^-]*-,,') nvidia-kernel-legacy-96xx-dkms

    This will also install the recommended nvidia-glx-legacy-96xx package. DKMS will build the nvidia module for your system.

  3. Update the initial ramdisk to include the nouveau blacklist (613951):

    # update-initramfs -u
  4. Create an Xorg server configuration file.

  5. Restart your system to enable the nouveau blacklist.

Configuration

As the nvidia driver is not autodetected by Xorg, a configuration file is required to be supplied. For example:

/etc/X11/xorg.conf.d/20-nvidia.conf

  • Section "Device"
        Identifier     "My GPU"
        Driver         "nvidia"
    EndSection

The configuration file above can be created using these commands:

  • # mkdir /etc/X11/xorg.conf.d
    # echo -e 'Section "Device"\n\tIdentifier "My GPU"\n\tDriver "nvidia"\nEndSection' > /etc/X11/xorg.conf.d/20-nvidia.conf

Restart your system at this point to enable the nouveau driver blacklist.

Troubleshooting

  • The NVIDIA driver conflicts with the nouveau DRM driver (580894). The nouveau kernel module is blacklisted by the nvidia-kernel-common package.

    • Restart your system after configuring Xorg for the NVIDIA driver.

    • From xserver-xorg-video-nouveau's README.Debian:

      If you decide to switch to the proprietary driver, it is highly
      recommended to reboot because it is incompatible with nouveau, and
      unloading the latter is not easy and may lead to a blank console.

See Also


CategoryProprietarySoftware