Differences between revisions 290 and 373 (spanning 83 versions)
Revision 290 as of 2016-07-24 12:29:40
Size: 16684
Editor: ?LucaBoccassi
Comment:
Revision 373 as of 2022-04-24 01:42:52
Size: 40275
Editor: ?Forest
Comment: Add contrib & non-free on Bullseye for driver version 470.103.01. Skipping this step fails on a new Bullseye installation as of 2022-04-22.
Deletions are marked like this. Additions are marked like this.
Line 8: Line 8:
NOTE: For Apple systems, follow these steps first to prevent a black screen after installing the drivers: http://askubuntu.com/a/613573/134848

<<TableOfContents(4)>>
Commands in this article prefixed with a {{{#}}} indicate they must be run as root. Replace this character with {{{sudo}}} or switch user to {{{root}}} in your terminal beforehand as necessary.

NOTE: For Apple systems, follow these steps first to prevent a black screen after installing the drivers: https://askubuntu.com/a/613573/134848

<<TableOfContents(5)>>
Line 16: Line 18:
$ lspci -nn | grep VGA
01:00.0 VGA compatible controller [0300]: NVIDIA Corporation G80 [GeForce 8800 GTS] [10de:0193] (rev a2)
$ lspci -nn | egrep -i "3d|display|vga"
07:00.0 VGA compatible controller [0300]: NVIDIA Corporation GM206 [GeForce GTX 960] [10de:1401] (rev a1)
Line 22: Line 24:
'''Note''': if this `lspci` command returns more than one line of output, you have an [[https://www.nvidia.com/object/optimus_technology.html|Optimus]] (hybrid) graphics chipset. After you install the necessary driver package, you'll still need to choose one of the methods on the [[NVIDIA Optimus]] page in order to activate and make use of your NVIDIA card.
Line 24: Line 28:
The {{{nvidia-detect}}} script (DebianPkg:nvidia-detect package in [[http://www.debian.org/doc/debian-policy/ch-archive#s-non-free|non-free]]) can also be used to identify the GPU and required driver: The {{{nvidia-detect}}} script (found in the DebianPkg:nvidia-detect package in the [[https://www.debian.org/doc/debian-policy/ch-archive#s-non-free|non-free]] section) can also be used to identify the GPU and the recommended driver package to install:
Line 26: Line 30:
$ nvidia-detect $ nvidia-detect 
Line 28: Line 32:
02:00.0 VGA compatible controller [0300]: NVIDIA Corporation GF108 [GeForce GT 430] [10de:0de1] (rev a1)
Your card is supported by the default drivers.
07:00.0 VGA compatible controller [0300]: NVIDIA Corporation GM206 [GeForce GTX 960] [10de:1401] (rev a1)

Checking card: NVIDIA Corporation GM206 [GeForce GTX 960] (rev a1)
Your card is supported by all driver versions.
Your card is also supported by the Tesla 440 drivers series.
Your card is also supported by the Tesla 418 drivers series.
Line 34: Line 42:

== 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.

Multiple precompiled driver versions are available for [[DebianJessie|Debian 8 "Jessie"]]:

 * [[#jessie-352|Version 352.79]] ([[http://us.download.nvidia.com/XFree86/Linux-x86_64/352.79/README/supportedchips.html|supported devices]])
  * For Kepler/Maxwell/newer GPUs.
  * Note that 352.79 is currently only available in unstable and jessie-backports.
 * [[#jessie|Version 340.65]] ([[http://us.download.nvidia.com/XFree86/Linux-x86_64/340.65/README/supportedchips.html|supported devices]])
  * For !GeForce 8xxx through 7xx GPUs.
 * [[#jessie-304xx|Version 304.125 (legacy GPUs)]] ([[http://us.download.nvidia.com/XFree86/Linux-x86_64/304.125/README/supportedchips.html|supported devices]])
  * For !GeForce 6xxx and 7xxx GPUs.

Four driver versions are available for [[DebianWheezy|Debian 7 "Wheezy"]]:

 * [[#wheezy-backports|Version 340.65]] ([[http://us.download.nvidia.com/XFree86/Linux-x86_64/340.65/README/supportedchips.html|supported devices]])
  * For !GeForce 8xxx and higher GPUs.
 * [[#wheezy|Version 304.125]] ([[http://us.download.nvidia.com/XFree86/Linux-x86/304.125/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.

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

== Installation ==

=== Debian 8 "Jessie" ===
As of jessie, the need for the proprietary drivers is pretty much over - nouveau now works quite well and works with dual-headed displays by simple and easy configuring from within your desktop (for KDE see ''System_Settings/Hardware/Display_and_Monitor/Display_Configuration''). The proprietary drivers don't provide normal logging and can be a hidden source of problems. If you are doing a distribution upgrade, you should at the very least remove all the nvidia packages from wheezy, get your desktop working with nouveau, then reinstall the nvidia packages if there is a pressing reason.

<<Anchor(jessie-352)>>
==== Version 352.79 (via jessie-backports) ====

 1. Add jessie-backports to your /etc/apt/sources.list, for example: {{{
# jessie-backports
deb http://httpredir.debian.org/debian jessie-backports main contrib non-free
}}}

 1. Install Linux headers for the kernel you are using. If you are using the 3.16 Linux kernel in Debian Jessie:{{{
# apt-get install linux-headers-$(uname -r|sed 's,[^-]*-[^-]*-,,')
}}}
 Or if you are already using a Linux kernel from jessie-backports:{{{
# apt-get install -t jessie-backports linux-headers-$(uname -r|sed 's,[^-]*-[^-]*-,,')
}}}

 1. Then we can install the package `nvidia-driver`.{{{
# apt-get update
# apt-get install -t jessie-backports nvidia-driver
}}}
 DKMS will build the nvidia module for your system.
----
== Desktop Drivers ==

The proprietary "NVIDIA Accelerated Linux Graphics Driver" provides optimized hardware acceleration of OpenGL and Vulkan applications through either Xorg or Wayland. It is a binary-only driver requiring a Linux kernel module for its use.

Multiple precompiled driver versions are available for [[DebianSid|Debian Unstable "Sid"]]:
 * [[#sid-470|Version 470.103.00]] ([[https://us.download.nvidia.com/XFree86/Linux-x86_64/470.103.01/README/supportedchips.html|supported devices]])
  * Supports Kepler, Maxwell, Pascal, Turing, and all current Ampere GPUs. Supports Vulkan 1.2 and OpenGL 4.6.
 * [[#sid-390|Version 390.144]] ([[https://us.download.nvidia.com/XFree86/Linux-x86_64/390.144/README/supportedchips.html|supported devices]])
  * Supports Fermi, Kepler, Maxwell, and most Pascal GPUs. Supports Vulkan 1.0 on Kepler and newer, supports up to OpenGL 4.5 depending on your card.
 * [[#sid-340|Version 340.108 (legacy GPUs)]] ([[https://us.download.nvidia.com/XFree86/Linux-x86_64/340.108/README/supportedchips.html|supported devices]])
  * Older legacy driver, for !GeForce 8 series through !GeForce 300 series. No Vulkan support, supports up to OpenGL 3.3 depending on your card.
  * '''Use of the 340-series driver is strongly discouraged.''' It is not included in stable releases of Debian anymore, has serious unfixable security vulnerabilities, and may not be updated for new kernels in a timely manner. You are highly recommended to use the built-in Nouveau driver if security is a priority.

Multiple precompiled driver versions are available for [[DebianBookworm|Debian 12 "Bookworm"]]:
 * [[#bookworm-470|Version 470.103.01]] ([[https://us.download.nvidia.com/XFree86/Linux-x86_64/470.103.01/README/supportedchips.html|supported devices]])
  * Supports Kepler, Maxwell, Pascal, Turing, and all current Ampere GPUs. Supports Vulkan 1.2 and OpenGL 4.6.
 * [[#bookworm-390|Version 390.144]] ([[https://us.download.nvidia.com/XFree86/Linux-x86_64/390.144/README/supportedchips.html|supported devices]])
  * Supports Fermi, Kepler, Maxwell, and most Pascal GPUs. Supports Vulkan 1.0 on Kepler and newer, supports up to OpenGL 4.5 depending on your card.

Multiple precompiled driver versions are available for [[DebianBullseye|Debian 11 "Bullseye"]]:
 * [[#bullseye-470|Version 470.103.01]] ([[https://us.download.nvidia.com/XFree86/Linux-x86_64/470.103.01/README/supportedchips.html|supported devices]])
  * Supports Kepler, Maxwell, Pascal, Turing, and all current Ampere GPUs. Supports Vulkan 1.2 and OpenGL 4.6.
 * [[#bullseye-460|Version 460.91.03]] ([[https://us.download.nvidia.com/XFree86/Linux-x86_64/460.91.03/README/supportedchips.html|supported devices]])
  * Supports Kepler, Maxwell, Pascal, Turing, and all current Ampere GPUs. Supports Vulkan 1.2 and OpenGL 4.6.
 * [[#bullseye-390|Version 390.144]] ([[https://us.download.nvidia.com/XFree86/Linux-x86_64/390.144/README/supportedchips.html|supported devices]])
  * Supports Fermi, Kepler, Maxwell, and most Pascal GPUs. Supports Vulkan 1.0 on Kepler and newer, supports up to OpenGL 4.5 depending on your card.
  
Multiple precompiled driver versions are available for [[DebianBuster|Debian 10 "Buster"]]:

 * [[#buster-460|Version 460.73.01]] ([[https://us.download.nvidia.com/XFree86/Linux-x86_64/460.73.01/README/supportedchips.html|supported devices]])
  * Supports Kepler, Maxwell, Pascal, Turing, and all current Ampere GPUs. Supports Vulkan 1.2 and OpenGL 4.6.
  * Note that 460.73.01 is only available in buster-backports.
 * [[#buster-418|Version 418.197.02]] ([[https://us.download.nvidia.com/XFree86/Linux-x86_64/418.113/README/supportedchips.html|supported devices]])
  * Supports Kepler, Maxwell, Pascal, and most Turing GPUs. Supports Vulkan 1.1 and OpenGL 4.6.
 * [[#buster-390|Version 390.143]] ([[https://us.download.nvidia.com/XFree86/Linux-x86_64/390.143/README/supportedchips.html|supported devices]])
  * Supports Fermi, Kepler, Maxwell, and most Pascal GPUs. Supports Vulkan 1.0 on Kepler and newer, supports up to OpenGL 4.5 depending on your card.
 * [[#buster-340|Version 340.108 (legacy GPUs)]] ([[https://us.download.nvidia.com/XFree86/Linux-x86_64/340.108/README/supportedchips.html|supported devices]])
  * Older legacy driver, for !GeForce 8 series through !GeForce 300 series. No Vulkan support, supports up to OpenGL 3.3 depending on your card.

Multiple precompiled driver versions are available for [[DebianStretch|Debian 9 "Stretch"]]:

 * [[#stretch-418|Version 418.152]] ([[https://us.download.nvidia.com/XFree86/Linux-x86_64/418.113/README/supportedchips.html|supported devices]])
  * Supports Kepler, Maxwell, Pascal, and most Turing GPUs. Supports Vulkan 1.1 and OpenGL 4.6.
  * Note that 418.152 is only available in stretch-backports.
 * [[#stretch-390|Version 390.138]] ([[https://us.download.nvidia.com/XFree86/Linux-x86_64/390.138/README/supportedchips.html|supported devices]])
  * Supports Fermi, Kepler, Maxwell, and most Pascal GPUs. Supports Vulkan 1.0 on Kepler and newer, supports up to OpenGL 4.5 depending on your card.
 * [[#stretch-340xx|Version 340.108 (legacy GPUs)]] ([[https://us.download.nvidia.com/XFree86/Linux-x86_64/340.108/README/supportedchips.html|supported devices]])
  * Older legacy driver, for !GeForce 8 series through !GeForce 300 series. No Vulkan support, supports up to OpenGL 3.3 depending on your card.
 * [[#stretch-304xx|Version 304.137 (legacy GPUs)]] ([[https://us.download.nvidia.com/XFree86/Linux-x86_64/304.137/README/supportedchips.html|supported devices]])
  * Even older legacy driver, for !GeForce 6 series and !GeForce 7 series. Only supports OpenGL 2.1.

All driver versions up to, and including, the 418-series, are only available for the x86, x86-64, and 32-bit ARMv7 architectures (Debian [[i386]], [[DebianAMD64|AMD64]], and [[ArmHardFloatPort|ARMHF]] ports respectively).

The 450-series and newer has dropped support for 32-bit architectures, now only supporting x86-64 and ARMv8 (Debian [[DebianAMD64|AMD64]] and [[Arm64Port|ARM64]] ports respectively).
----
=== Prerequisites ===

==== Kernel headers ====

Before installing the drivers, you '''must''' obtain the proper kernel headers for the NVIDIA driver to build with.

For a typical 64-bit system using the default kernel, you can simply run:
{{{
# apt install linux-headers-amd64
}}}

For 32-bit systems with the non-PAE kernel, you'd instead install:
{{{
# apt install linux-headers-686
}}}
Or, for 32-bit systems with the PAE kernel:
{{{
# apt install linux-headers-686-pae
}}}
If you're using the kernel from [[Backports|Debian Backports]], you must run the same command but with the {{{-t}}} flag followed by the name of your backports source. For instance, if you're using backports on a 64-bit Debian 10 system, you might run:
{{{
# apt install -t buster-backports linux-headers-amd64
}}}

----

==== Kernel ====

In some cases, if you're aiming to install the bleeding-edge version of the NVIDIA driver from Debian Backports, you may
also need to install the kernel from backports to match it. For Debian 10, you might do this with:
{{{
# apt install -t buster-backports linux-image-amd64
}}}
Exchange "buster-backports" with your own version's backports repository as necessary.

----

=== Installation ===
==== Debian Unstable "Sid" ====

<<Anchor(sid-470)>>
===== Version 470.103.01 =====
For support of !GeForce 600 series and newer GPUs ([[https://us.download.nvidia.com/XFree86/Linux-x86_64/470.103.01/README/supportedchips.html|supported devices]]). For older devices, see [[#sid-390|Version 390 (legacy GPUs]]).

 1. Add "contrib" and "non-free" components to {{{/etc/apt/sources.list}}}, for example: {{{
# Debian Sid
deb http://deb.debian.org/debian/ sid main contrib non-free
}}}
 1. Update the list of available packages, then we can install the DebianPkg:nvidia-driver package, plus the necessary firmware: {{{
# apt update
# apt install nvidia-driver firmware-misc-nonfree
}}}
 DKMS will build the {{{nvidia}}} module for your system, via the DebianPkg:nvidia-kernel-dkms package.
  * ''Optional'': if you have SecureBoot enabled, you need to sign the resulting modules. Detailed instructions are available [[SecureBoot#Using_your_key_to_sign_modules|here]].
 1. Restart your system to load the new driver.

<<Anchor(sid-390)>>
===== Version 390.144 =====
For support of !GeForce 400 series and newer GPUs ([[https://us.download.nvidia.com/XFree86/Linux-x86/390.144/README/supportedchips.html|supported devices]]).

 1. Add "contrib" and "non-free" components to {{{/etc/apt/sources.list}}}, for example: {{{
# Debian Sid
deb http://deb.debian.org/debian/ sid main contrib non-free
}}}
 1. Update the list of available packages, then we can install the DebianPkg:nvidia-legacy-390xx-driver package, plus the necessary firmware: {{{
# apt update
# apt install nvidia-legacy-390xx-driver firmware-misc-nonfree
}}}
 DKMS will build the {{{nvidia}}} module for your system, via the DebianPkg:nvidia-legacy-390xx-kernel-dkms package.
  * ''Optional'' : if you have SecureBoot enabled, you need to sign the resulting modules. Detailed instructions are available [[SecureBoot#Using_your_key_to_sign_modules|here]].
 1. Restart your system to load the new driver.

<<Anchor(sid-340)>>
===== Version 340.108 =====
For support of !GeForce 8 series through !GeForce 300 series GPUs([[https://us.download.nvidia.com/XFree86/Linux-x86/340.108/README/supportedchips.html|supported devices]]).

'''Use of the 340-series driver is strongly discouraged.''' It is not included in stable releases of Debian anymore, has serious unfixable security vulnerabilities, and may not be updated for new kernels in a timely manner. You are highly recommended to use the built-in Nouveau driver if security is a priority.

 1. Add "contrib" and "non-free" components to {{{/etc/apt/sources.list}}}, for example: {{{
# Debian Sid
deb http://deb.debian.org/debian/ sid main contrib non-free
}}}
 1. Update the list of available packages, then we can install the DebianPkg:nvidia-legacy-340xx-driver package, plus the necessary firmware: {{{
# apt update
# apt install nvidia-legacy-340xx-driver firmware-misc-nonfree
}}}
 DKMS will build the {{{nvidia}}} module for your system, via the DebianPkg:nvidia-legacy-340xx-kernel-dkms package.
  * ''Optional'' : if you have SecureBoot enabled, you need to sign the resulting modules. Detailed instructions are available [[SecureBoot#Using_your_key_to_sign_modules|here]].
 1. Restart your system to load the new driver.

----

==== Debian 12 "Bookworm" ====

<<Anchor(bookworm-470)>>
===== Version 470.103.01 =====
For support of !GeForce 600 series and newer GPUs ([[https://us.download.nvidia.com/XFree86/Linux-x86_64/470.103.01/README/supportedchips.html|supported devices]]). For older devices, see [[#bookworm-390|Version 390 (legacy GPUs]]).

 1. Add "contrib" and "non-free" components to {{{/etc/apt/sources.list}}}, for example: {{{
# Debian Bookworm
deb http://deb.debian.org/debian/ bookworm main contrib non-free
}}}
 1. Update the list of available packages, then we can install the DebianPkg:nvidia-driver package, plus the necessary firmware: {{{
# apt update
# apt install nvidia-driver firmware-misc-nonfree
}}}
 DKMS will build the {{{nvidia}}} module for your system, via the DebianPkg:nvidia-kernel-dkms package.
  * ''Optional'' : if you have SecureBoot enabled, you need to sign the resulting modules. Detailed instructions are available [[SecureBoot#Using_your_key_to_sign_modules|here]].
 1. Restart your system to load the new driver.

<<Anchor(bookworm-390)>>
===== Version 390.144 =====
For support of !GeForce 400 series and newer GPUs ([[https://us.download.nvidia.com/XFree86/Linux-x86/390.144/README/supportedchips.html|supported devices]]).

 1. Add "contrib" and "non-free" components to {{{/etc/apt/sources.list}}}, for example: {{{
# Debian Bookworm
deb http://deb.debian.org/debian/ bookworm main contrib non-free
}}}
 1. Update the list of available packages, then we can install the DebianPkg:nvidia-legacy-390xx-driver package, plus the necessary firmware: {{{
# apt update
# apt install nvidia-legacy-390xx-driver firmware-misc-nonfree
}}}
 DKMS will build the {{{nvidia}}} module for your system, via the DebianPkg:nvidia-legacy-390xx-kernel-dkms package.
  * ''Optional'' : if you have SecureBoot enabled, you need to sign the resulting modules. Detailed instructions are available [[SecureBoot#Using_your_key_to_sign_modules|here]].
 1. Restart your system to load the new driver.

----

==== Debian 11 "Bullseye" ====
<<Anchor(bullseye-470)>>
===== Version 470.103.01 =====
For support of !GeForce 600 series and newer GPUs ([[https://us.download.nvidia.com/XFree86/Linux-x86_64/470.103.01/README/supportedchips.html|supported devices]]). For older devices, see [[#bullseye-390|Version 390 (legacy GPUs]]).


 1. Add "contrib" and "non-free" components to {{{/etc/apt/sources.list}}}, for example: {{{
# Debian Bullseye
deb http://deb.debian.org/debian/ bullseye main contrib non-free
}}}

 1. Add bullseye-backports as an additional new line to your /etc/apt/sources.list, for example: {{{
# bullseye-backports
deb http://deb.debian.org/debian bullseye-backports main contrib non-free
}}}

 1. Update the list of available packages, then we can install the DebianPkg:nvidia-driver package, plus the necessary firmware, from the backports repository:{{{
# apt update
# apt install -t bullseye-backports nvidia-driver firmware-misc-nonfree
}}}
 DKMS will build the {{{nvidia}}} module for your system, via the DebianPkg:nvidia-kernel-dkms package.
  * ''Optional'' : if you have SecureBoot enabled, you need to sign the resulting modules. Detailed instructions are available [[SecureBoot#Using_your_key_to_sign_modules|here]].
 1. Reboot your system to load the updated driver.

<<Anchor(bullseye-460)>>
===== Version 460.91.03 =====
For support of !GeForce 600 series and newer GPUs ([[https://us.download.nvidia.com/XFree86/Linux-x86_64/460.91.03/README/supportedchips.html|supported devices]]). For older devices, see [[#bullseye-390|Version 390 (legacy GPUs]]).

 1. Add "contrib" and "non-free" components to {{{/etc/apt/sources.list}}}, for example: {{{
# Debian 11 "Bullseye"
deb http://deb.debian.org/debian/ bullseye main contrib non-free
}}}
 1. Update the list of available packages, then we can install the DebianPkg:nvidia-driver package, plus the necessary firmware: {{{
# apt update
# apt install nvidia-driver firmware-misc-nonfree
}}}
 DKMS will build the {{{nvidia}}} module for your system, via the DebianPkg:nvidia-kernel-dkms package.
  * ''Optional'' : if you have SecureBoot enabled, you need to sign the resulting modules. Detailed instructions are available [[SecureBoot#Using_your_key_to_sign_modules|here]].
 1. Restart your system to load the new driver.

<<Anchor(bullseye-390)>>
===== Version 390.144 =====
For support of !GeForce 400 series and newer GPUs ([[https://us.download.nvidia.com/XFree86/Linux-x86/390.144/README/supportedchips.html|supported devices]]).

 1. Add "contrib" and "non-free" components to {{{/etc/apt/sources.list}}}, for example: {{{
# Debian 11 "Bullseye"
deb http://deb.debian.org/debian/ bullseye main contrib non-free
}}}
 1. Update the list of available packages, then we can install the DebianPkg:nvidia-legacy-390xx-driver package, plus the necessary firmware: {{{
# apt update
# apt install nvidia-legacy-390xx-driver firmware-misc-nonfree
}}}
 DKMS will build the {{{nvidia}}} module for your system, via the DebianPkg:nvidia-legacy-390xx-kernel-dkms package.
  * ''Optional'' : if you have SecureBoot enabled, you need to sign the resulting modules. Detailed instructions are available [[SecureBoot#Using_your_key_to_sign_modules|here]].
 1. Restart your system to load the new driver.

----

==== Debian 10 "Buster" ====

<<Anchor(buster-460)>>
===== Version 460.73.01 (via buster-backports) =====

For support of !GeForce 600 series and newer GPUs ([[https://us.download.nvidia.com/XFree86/Linux-x86_64/460.73.01/README/supportedchips.html|supported devices]]). For older devices, see [[#buster-390|Version 390 (legacy GPUs)]] and [[#buster-340|Version 340 (legacy GPUs)]].

 1. Add buster-backports as an additional new line to your /etc/apt/sources.list, for example: {{{
# buster-backports
deb http://deb.debian.org/debian buster-backports main contrib non-free
}}}

 1. Update the list of available packages, then we can install the DebianPkg:nvidia-driver package, plus the necessary firmware, from the backports repository:{{{
# apt update
# apt install -t buster-backports nvidia-driver firmware-misc-nonfree
}}}
 DKMS will build the {{{nvidia}}} module for your system, via the DebianPkg:nvidia-kernel-dkms package.
  * ''Optional'' : if you have SecureBoot enabled, you need to sign the resulting modules. Detailed instructions are available [[SecureBoot#Using_your_key_to_sign_modules|here]].
 1. Reboot your system to load the updated driver.

<<Anchor(buster-418)>>

===== Version 418.197.02 =====

For support of !GeForce 600 series and newer GPUs ([[https://us.download.nvidia.com/XFree86/Linux-x86_64/418.113/README/supportedchips.html|supported devices]]). For older devices, see [[#buster-390|Version 390 (legacy GPUs)]] and [[#buster-340|Version 340 (legacy GPUs)]].

 1. Add "contrib" and "non-free" components to {{{/etc/apt/sources.list}}}, for example: {{{
# Debian 10 "Buster"
deb http://deb.debian.org/debian/ buster main contrib non-free
}}}
 1. Update the list of available packages, then we can install the DebianPkg:nvidia-driver package, plus the necessary firmware: {{{
# apt update
# apt install nvidia-driver firmware-misc-nonfree
}}}
 DKMS will build the {{{nvidia}}} module for your system, via the DebianPkg:nvidia-kernel-dkms package.
  * ''Optional'' : if you have SecureBoot enabled, you need to sign the resulting modules. Detailed instructions are available [[SecureBoot#Using_your_key_to_sign_modules|here]].
 1. Restart your system to load the new driver.

<<Anchor(buster-390)>>
===== Version 390.138 (legacy GPUs) =====

For support of !GeForce 400 series and newer GPUs ([[https://us.download.nvidia.com/XFree86/Linux-x86/390.138/README/supportedchips.html|supported devices]]).

 1. Add "contrib" and "non-free" components to {{{/etc/apt/sources.list}}}, for example: {{{
# Debian 10 "Buster"
deb http://deb.debian.org/debian/ buster main contrib non-free
}}}
 1. Update the list of available packages, then we can install the DebianPkg:nvidia-legacy-390xx-driver package, plus the necessary firmware:{{{
# apt update
# apt install nvidia-legacy-390xx-driver firmware-misc-nonfree}}}
 DKMS will build the {{{nvidia}}} module for your system, via the DebianPkg:nvidia-legacy-390xx-kernel-dkms package.
  * ''Optional'' : if you have SecureBoot enabled, you need to sign the resulting modules. Detailed instructions are available [[SecureBoot#Using_your_key_to_sign_modules|here]].
 1. Restart your system to load the new driver.

<<Anchor(buster-340)>>
===== Version 340.108 (legacy GPUs) =====

For support of !GeForce 8 series through !GeForce 300 series GPUs. ([[https://us.download.nvidia.com/XFree86/Linux-x86/340.108/README/supportedchips.html|supported devices]]).

 1. Add "contrib" and "non-free" components to {{{/etc/apt/sources.list}}}, for example: {{{
# Debian 10 "Buster"
deb http://deb.debian.org/debian/ buster main contrib non-free
}}}
 1. Update the list of available packages, then we can install the DebianPkg:nvidia-legacy-340xx-driver package:{{{
# apt update
# apt install nvidia-legacy-340xx-driver
}}}
 DKMS will build the {{{nvidia}}} module for your system, via the DebianPkg:nvidia-legacy-340xx-kernel-dkms package.
  * ''Optional'' : if you have SecureBoot enabled, you need to sign the resulting modules. Detailed instructions are available [[SecureBoot#Using_your_key_to_sign_modules|here]].
 1. After, create an [[#configure|Xorg server configuration file]] and then restart your system to enable the nouveau blacklist.
----
==== Debian 9 "Stretch" ====
As of stretch, you don't need nvidia-xconfig anymore, and a xorg.conf file is not needed either in most situations. Also, the 340 series has been forked into its own series of packages to support older cards.

In some situations running `nvidia-xconfig` is still required for screen-locking and suspend/resume to work properly (DebianBug:922679 Xfce/lightdm/light-locker)

<<Anchor(stretch-418)>>
===== Version 418.152 (via stretch-backports) =====

For support of !GeForce 700 series and newer GPUs ([[https://us.download.nvidia.com/XFree86/Linux-x86_64/418.152/README/supportedchips.html|supported devices]]). For older devices, see [[#stretch-340xx|Version 340 (legacy GPUs)]] and [[#stretch-304xx|Version 304 (legacy GPUs)]].

 1. Add stretch-backports as an additional new line to your /etc/apt/sources.list, for example: {{{
# stretch-backports
deb http://deb.debian.org/debian stretch-backports main contrib non-free
}}}

 1. Update the list of available packages, then we can install the DebianPkg:nvidia-driver package, plus the necessary firmware, from the backports repository:{{{
# apt update
# apt install -t stretch-backports nvidia-driver firmware-misc-nonfree
}}}
 DKMS will build the {{{nvidia}}} module for your system, via the DebianPkg:nvidia-kernel-dkms package.
Line 90: Line 378:
<<Anchor(jessie)>>

==== Version 340.96 ====

For support of !GeForce 8xxx
and higher GPUs ([[http://us.download.nvidia.com/XFree86/Linux-x86_64/340.65/README/supportedchips.html|supported devices]]). For older devices, see [[#jessie-304xx|Version 304.125 (legacy GPUs)]].

 1. Add "contrib" and "non-free" components to {{{/etc/apt/sources.list}}}, for example: {{{
# Debian 8 "Jessie"
deb http://httpredir.debian.org/debian/ jessie 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:jessie/nvidia-driver|nvidia-driver]] package. DKMS will build the nvidia module for your system.
 1. Create an [[#confi
gure|Xorg server configuration file]].
<<Anchor(stretch-390)>>
===== Version 390.138 =====

For support of !GeForce
400 series and higher GPUs ([[https://us.download.nvidia.com/XFree86/Linux-x86_64/390.138/README/supportedchips.html|supported devices]]). For older devices, see [[#stretch-340xx|Version 340 (legacy GPUs)]] and [[#stretch-304xx|Version 304 (legacy GPUs)]].

 1. Add "contrib" and "non-free" components to {{{/etc/apt/sources.list}}}, for example: {{{
# Debian 9 "Stretch"
deb http://deb.debian.org/debian/ stretch main contrib non-free
}}}
 1. Update the list of available packages, then we can install the DebianPkg:nvidia-driver package, plus the necessary firmware: {{{
# apt update
# apt install nvidia-driver firmware-misc-nonfree
}}}
DKMS will build the {{{nvidia}}} module for your system, via the DebianPkg:nvidia-kernel-dkms package.
Line 108: Line 394:
<<Anchor(jessie-304xx)>>
==== Version 304.131 (legacy GPUs) ====

For support of !GeForce 6xxx and 7xxx GPUs ([[http://us.download.nvidia.com/XFree86/Linux-x86/304.125/README/supportedchips.html|supported devices]]).

 1. Add "contrib" and "non-free" components to {{{/etc/apt/sources.list}}}, for example: {{{
# Debian 8 "Jessie"
deb http://httpredir.debian.org/debian/ jessie 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-legacy-304xx-kernel-dkms
}}}
 This will also install the recommended [[DebianPkg:jessie/nvidia-legacy-304xx-driver|nvidia-legacy-304xx-driver]] 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.

=== Debian 7 "Wheezy" ===

<<Anchor(wheezy-backports)>>
==== Version 340.96 (via wheezy-backports) ====

For support of !GeForce 8xxx and higher GPUs ([[http://us.download.nvidia.com/XFree86/Linux-x86_64/340.65/README/supportedchips.html|supported devices]]). This is made available from [[Backports|wheezy-backports]].

 1. Add wheezy-backports to your {{{/etc/apt/sources.list}}}, for example: {{{
# wheezy-backports
deb http://httpredir.debian.org/debian/ wheezy-backports main contrib non-free
}}}
 1. Update the list of available packages: {{{
# aptitude update
}}}
 1. Install the appropriate linux-headers package: {{{
# aptitude install linux-headers-$(uname -r|sed 's,[^-]*-[^-]*-,,')
}}}
 1. Install the kernel module package from wheezy-backports: {{{
# aptitude -t wheezy-backports -r install nvidia-kernel-dkms
}}}
 This will also install the recommended [[DebianPkg:wheezy-backports/nvidia-driver|nvidia-driver]] 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.

<<Anchor(wheezy)>>
==== Version 304.125 ====

For support of !GeForce 6xxx and higher GPUs ([[http://us.download.nvidia.com/XFree86/Linux-x86/304.125/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)]].

 1. Add "contrib" and "non-free" components to {{{/etc/apt/sources.list}}}, for example: {{{
# Debian 7 "Wheezy"
deb http://httpredir.debian.org/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.

<<Anchor(wheezy-173xx)>>
==== Version 173.14.35 (legacy GPUs) ====

For support of !GeForce 5xxx / !GeForce FX GPUs ([[http://www.nvidia.com/object/IO_32667.html|supported devices]]).

 1. Add "contrib" and "non-free" components to {{{/etc/apt/sources.list}}}, for example: {{{
# Debian 7 "Wheezy"
deb http://httpredir.debian.org/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.

<<Anchor(wheezy-96xx)>>
==== Version 96.43.23 (legacy GPUs) ====

For support of !GeForce 2, !GeForce 3 and !GeForce 4 GPUs ([[http://www.nvidia.com/object/IO_32667.html|supported devices]]).

 1. Add "contrib" and "non-free" components to {{{/etc/apt/sources.list}}}, for example: {{{
# Debian 7 "Wheezy"
deb http://httpredir.debian.org/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.

<<Anchor(svn)>>
=== Building newer releases from SVN ===

As new upstream versions of the proprietary driver are released, upload might not happen immediately. This might be for various reasons, including waiting for new binary packages to clear the NEW queue, which has to be approved manually by the FTP masters.

Before running the upstream installer, which might cause problems to your installation, you can build and install the packages locally if they are ready on SVN. Check if the version you are interested in is available:

https://anonscm.debian.org/viewvc/pkg-nvidia/packages/nvidia-graphics-drivers/branches/

If it is, install the following: {{{
# apt-get install subversion svn-buildpackage
# apt-get build-dep nvidia-driver
}}}

Then checkout the branch you want and build it locally: {{{
# svn co svn://anonscm.debian.org/pkg-nvidia/packages/nvidia-graphics-drivers/branches/364
# cd 364
# debian/rules get-orig-source
# mkdir ../tarballs
# mv nvidia-graphics-drivers* ../tarballs
# svn-buildpackage --svn-ignore -us -uc -rfakeroot
}}}

and if you need multiarch packages (i.e. i386 on amd64) - required for steam to work: {{{
# svn-buildpackage --svn-ignore --svn-arch=i386 -us -uc -rfakeroot
}}}

NOTE: for the multiarch, for example on amd64 with i386, you must NOT install all the packages from the foreign architecture, but ONLY either libgl1-nvidia-glx-i386 or nvidia-driver-libs-i386 depending on the branch, and their dependencies.

NOTE: to use get-orig-source you'll need tar version 1.29 or higher, if that is not an option (e.g. in jessie) you can modify the {{{debian/rules}}} file by deleting the new {{{tar}}} arguments that doesn't exist in older tar versions ({{{--clamp-mtime}}} and {{{--sort}}}):

{{{
$ svn diff debian/rules
Index: debian/rules
===================================================================
--- debian/rules (revision 6570)
+++ debian/rules (working copy)
@@ -380,8 +380,7 @@
            chmod 0755 $(ORIGDIR.$*)/* ; \
            latestfile=$$(ls -tr $$(find $(ORIGDIR.$*) -type f) | tail -n 1) ; \
            tar cv \
- --clamp-mtime --mtime="./$$latestfile" \
- --sort=name \
+ --mtime="./$$latestfile" \
                --owner=root --group=src \
                $(ORIGDIR.$*) \
                | gzip -n -9 > $(TARBALL.$*) ; \

}}}

This way {{{debian/rules get-orig-source}}} command will work fine in jessie. In case it doesn't work you may try creating the tarball manually following the schema used by an existing one in the Debian archive.

NOTE: if the {{{svn-buildpackage}}} command fails with a message from {{{tar}}} like this:
{{{
tar: /home/foo/tmp/nvidia/build-area/tmp-0.834000333984481: Cannot open: No such file or directory
tar: Error is not recoverable: exiting now
Command ' tar --no-same-owner --no-same-permissions --extract --file /home/foo/tmp/nvidia/tarballs/nvidia-graphics-drivers_367.35.orig-armhf.tar.gz --directory /home/foo/tmp/nvidia/build-area/tmp-0.834000333984481' failed in '/home/foo/tmp/nvidia/367', how to continue now? [Qri?]:
}}}
then create the missing {{{/home/foo/tmp/nvidia/build-area/tmp-0.834000333984481}}} directory (the name changes every time, so create it in another terminal) and press {{{r}}} to retry the command. You will need to create the directory twice. After that, the build should succeed.
<<Anchor(stretch-340xx)>>
===== Version 340.108 (legacy GPUs) =====

For support of !GeForce 8 series through !GeForce 300 series GPUs ([[https://us.download.nvidia.com/XFree86/Linux-x86/340.108/README/supportedchips.html|supported devices]]).

 1. Add "contrib" and "non-free" components to {{{/etc/apt/sources.list}}}, for example: {{{
# Debian 9 "Stretch"
deb http://deb.debian.org/debian/ stretch main contrib non-free
}}}
 1. Update the list of available packages, then we can install the DebianPkg:nvidia-legacy-340xx-driver package: {{{
# apt update
# apt install nvidia-legacy-340xx-driver}}}
 DKMS will build the {{{nvidia}}} module for your system, via the DebianPkg:nvidia-legacy-340xx-kernel-dkms package.

 After, create an [[#configure|Xorg server configuration file]] and then restart your system to enable the nouveau blacklist.

<<Anchor(stretch-304xx)>>
===== Version 304.137 (legacy GPUs) =====

For support of !GeForce 6 series and !GeForce 7 series GPUs ([[https://us.download.nvidia.com/XFree86/Linux-x86/304.137/README/supportedchips.html|supported devices]]).

 1. Add "contrib" and "non-free" components to {{{/etc/apt/sources.list}}}, for example: {{{
# Debian 9 "Stretch"
deb http://deb.debian.org/debian/ stretch main contrib non-free
}}}
 1. Update the list of available packages, then we can install the DebianPkg:nvidia-legacy-304xx-driver package:
{{{
# apt install nvidia-legacy-304xx-driver
}}}
 DKMS will build the {{{nvidia}}} module for your system, via the DebianPkg:nvidia-legacy-304xx-kernel-dkms package.

 After, create an [[#configure|Xorg server configuration file]] and then restart your system to enable the nouveau blacklist.

----

<<Anchor(multiarch-install)>>
=== Installing 32-bit libraries on a 64-bit system ===

In many cases, such as when running proprietary 32-bit games from [[Steam]] or in [[Wine]], you may need 32-bit graphics libraries on your 64-bit system in order for them to function properly. This has been made much easier since [[DebianStretch|Debian 9/Stretch]] and now requires minimal extra work.

Note that the following instructions assume that {{{sudo}}} is configured on your system. If it isn't, either follow the instructions on the [[sudo]] wiki page or omit the {{{sudo}}} and run these commands as root.

After installing the drivers, enable 32-bit multiarch and update your repository listing by running:
{{{
sudo dpkg --add-architecture i386 && sudo apt update
}}}
Afterwards, to install the 32-bit version of the NVIDIA libraries package, run:
{{{
sudo apt install nvidia-driver-libs:i386
}}}
Restarting the relevant applications may be necessary before they function correctly.

'''WARNING:''' If you're forced to use a legacy driver, you will want to instead install one of {{{nvidia-legacy-390xx-driver-libs:i386}}}, {{{nvidia-legacy-340xx-driver-libs:i386}}}, or {{{nvidia-legacy-304xx-driver-libs:i386}}}.
----
== Wayland ==
The NVIDIA driver supports Wayland, with caveats. The 495-series driver
(or newer) is recommended for the best experience, as older versions only
support Wayland through an NVIDIA-specific API which is not supported by
all desktops, and is generally less reliable.

The NVIDIA driver also lacks support for accelerated XWayland
applications in current stable Debian versions.
This means that if you run a Xorg-only application on your NVIDIA Wayland
desktop (often proprietary video games), they will only be able to render
on the CPU without taking advantage of GPU acceleration, leading to
incredibly poor performance. [[https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/587|Patches have been merged to resolve this]], however this support will only be available in [[DebianBookworm|Debian 12/Bookworm]].

In terms of specific desktop support, GNOME supports NVIDIA Wayland sessions
in both Debian 10 and Debian 11, though they call their support "preliminary".
KDE Plasma supports NVIDIA Wayland sessions starting with Debian 11,
though it requires some extra hoops to enable, and generally is not recommended.
Refer to the Wayland section of the Debian KDE wiki page for up-to-date information:
https://wiki.debian.org/KDE#Wayland.2C_touchscreens.2C_autorotation.2C_hi-DPI

In Debian 12 (currently Debian Testing), almost all issues should be resolved
and most Wayland sessions should "just work" with the 495-series driver,
however some major issues remain with KDE Plasma. These will require merging
KDE's Qt 5 patch collection to fix: https://salsa.debian.org/qt-kde-team/qt/qtwayland/-/merge_requests/5

----

== Tesla Drivers ==

The NVIDIA line-up of programmable "Tesla" devices, used primarily for simulations and large-scale calculations, also require separate driver packages to function correctly compared to the consumer-grade !GeForce GPUs that are instead targeted for desktop and gaming usage.

In [[DebianBuster|Debian 10/Buster]], the default DebianPkg:nvidia-driver package is based on the Tesla release. This was done in order to resolve several critical security issues, but it means that there is no need to install the separate package for Tesla devices to work. If you need a newer release, the 450-series driver is available in backports via the DebianPkg:nvidia-tesla-450-driver package.

In [[DebianBullseye|Debian 11/Bullseye]], the major 418, 440, and 450 releases of the Tesla driver are available and distinct from the default driver. They can be found in the DebianPkg:nvidia-tesla-418-driver, DebianPkg:nvidia-tesla-440-driver, and DebianPkg:nvidia-tesla-450-driver packages respectively.

The 32-bit libraries can be obtained by installing {{{nvidia-tesla-418-driver-libs:i386}}}, {{{nvidia-tesla-440-driver:i386}}}, or {{{nvidia-tesla-450-driver:i386}}} based on the version of your driver. [[Multiarch/HOWTO|Multiarch]] must be enabled.

----
Line 263: Line 489:
As the nvidia driver is not autodetected by [[Xorg]], a configuration file is required to be supplied. However, the configuration described below should '''not''' be applied to Nvidia Optimus systems; on such systems, the primary X display is driven by your Intel GPU, which is autodetected by X. See [[Bumblebee]] for more details on how to configure an Optimus system. As the NVIDIA driver is not autodetected by [[Xorg]], a configuration file is required to be supplied. Modern Debian packages for the NVIDIA driver '''should not require you to do anything listed here''' as they handle this automatically during installation, but if you run into issues, or are using a much older version of Debian, you may try going through these steps.
Line 281: Line 507:
# mkdir /etc/X11/xorg.conf.d # mkdir -p /etc/X11/xorg.conf.d
Line 285: Line 511:
Please note that this configuration will break Xorg on Optimus systems.  For such hardware, see [[Bumblebee]] instead. Please note that this configuration will break Xorg on Optimus systems. For such hardware, see [[NVIDIA Optimus]] instead.
Line 290: Line 516:
----
== CUDA ==

=== Debian Unstable "Sid" ===

CUDA 11.4.3 is available from the non-free repository:
{{{
# apt install nvidia-cuda-dev nvidia-cuda-toolkit
}}}
This installs {{{nvcc}}} and friends. The visual profiler is in a separate package named DebianPkg:nvidia-visual-profiler.

=== Debian 12 "Bookworm" ===

CUDA 11.4.3 is available from the non-free repository:
{{{
# apt install nvidia-cuda-dev nvidia-cuda-toolkit
}}}
This installs {{{nvcc}}} and friends. The visual profiler is in a separate package named DebianPkg:nvidia-visual-profiler.


=== Debian 11 "Bullseye" ===

CUDA 11.2.2 is available from the non-free repository:
{{{
# apt install nvidia-cuda-dev nvidia-cuda-toolkit
}}}
This installs {{{nvcc}}} and friends. The visual profiler is in a separate package named DebianPkg:nvidia-visual-profiler.

=== Debian 10 "Buster" ===

CUDA 9.2.148 is available from the non-free repository:
{{{
# apt install nvidia-cuda-dev nvidia-cuda-toolkit
}}}
And, if [[Backports]] are enabled, CUDA 11.2.1 is available similarly:
{{{
# apt -t buster-backports install nvidia-cuda-dev nvidia-cuda-toolkit
}}}
This installs {{{nvcc}}} and friends. The visual profiler is in a separate package named DebianPkg:nvidia-visual-profiler.

=== Debian 9 "Stretch" ===

CUDA 8.0.44 is available from the non-free repository:

{{{
# apt install nvidia-cuda-dev nvidia-cuda-toolkit
}}}

And, if [[Backports]] are enabled, CUDA 9.1.85 is available similarly:
{{{
# apt -t stretch-backports install nvidia-cuda-dev nvidia-cuda-toolkit
}}}

This installs {{{nvcc}}} and friends. The visual profiler is in a separate package named DebianPkg:nvidia-visual-profiler.

CUDA 8 only supports gcc 5.3.1, which is not available for Stretch. To compile you need to add `-ccbin clang-3.8` to the nvcc command line.

The Debian CUDA packages unfortunately do not include the Toolkit samples. To install these yourself you need to download the "Ubuntu 16.04" `.run` install file for CUDA 8 from https://developer.nvidia.com/cuda-downloads. Execute the `.run` file and (after accepting the license and agreeing to run on a non-supported system) skip the driver and toolkit installation and just select "Samples". Note before this step you must
{{{
export PERL5LIB=.
}}}
To compile the samples, you first need to set
{{{
export HOST_COMPILER=clang++-3.8
}}}

----
Line 292: Line 585:
=== Build failures ===
The NVIDIA driver can fail to build for several potential reasons.

1. You've installed a kernel from backports without installing
the NVIDIA driver from backports. This can, in some cases, mean
that the kernel is too new for the driver version you're attempting to use.
Check this by viewing the package description for the NVIDIA driver where
it will mention something along the lines of, "Building the kernel module
has been tested up to Linux X.X" to figure out what's supported.

2. Particularly if you're on Debian Testing or Debian Unstable,
the driver might not support your kernel yet. Often, new versions
of the Linux kernel will explicitly require an update to the driver
in order to be supported, so if the kernel package updates before
the driver has a chance to be patched for it, you won't be able to use
the NVIDIA driver. Solutions for this, from most to least recommended,
are temporarily using an older kernel until the driver is updated,
installing a newer version of the driver from Debian Experimental if
one is available that supports your kernel version, or finding a patch
for the build failure online that can be added to DKMS. The last two
options are for advanced users
'''and may break your system or, in the
case of adding a third-party patch, introduce security issues, forcing you to potentially reinstall completely or spend hours recovering your system. Caveat emptor.'''

3. Legacy versions of the NVIDIA driver may not always support the latest kernel.
For instance, the 304xx series driver, though available in the Debian Unstable
repository, does not support Linux 5.0 or newer. As necessary, you might consider
using an older Debian version, or using Nouveau instead. Nouveau has decent
performance with GPUs that are old enough to no longer be supported by the
proprietary driver.

=== Driver stops working after upgrading Debian ===
When going between two major Debian releases (e.g., upgrading
from Debian 9/Stretch to Debian 10/Buster), it's possible that the
driver will stop functioning despite the build succeeding and no other
issues being easily visible. This is most often caused by the
DebianPkg:nvidia-driver package updating to a newer major release that
no longer supports your hardware, as NVIDIA regularly drops support for
older hardware generations. You will need to uninstall all your existing
NVIDIA packages (refer to the section below for instructions on how to do so),
and instead install the most recent legacy driver that still supports your GPU.

=== GPU isn't functional, even with a compatible driver version installed ===
If you have an extremely modern NVIDIA GPU that was manufactured after the release of your
Debian version, it may not work even after installing the newest backported driver
that claims to support your card. If so, you likely need to upgrade the non-free firmware
package on your system as well by installing the DebianPkg:firmware-misc-nonfree package
from backports. For instance, on a Debian 10 system with backports enabled:
{{{
# apt install -t buster-backports firmware-misc-nonfree
}}}
After rebooting, the driver should be able to load the appropriate firmware.

=== Miscellaneous ===
Line 302: Line 648:
}}} to the {{{Device}}} section. }}} to the {{{Device}}} section. In some case (eg. !GeForce GT 650M Mac Edition) it may cause screen flickering during boot time (just after grub screen), and system will not boot. In this case you should use instead add the following: {{{
setpci -v -H1 -s 00:01.00 BRIDGE_CONTROL=0
}}} to the file: {{{/etc/rc.local}}}
 * You can check whether or not the kernel module for the NVIDIA driver has been loaded, in addition to what version is currently loaded, by running {{{/sbin/modinfo -F version nvidia-current}}}
Line 305: Line 654:
----

== Uninstallation ==
If you run into issues with the drivers, switch to a different card, or simply want to use the open-source Nouveau drivers instead, uninstallation is made easy with recent versions of the drivers.

Also note that if issues with the driver prevent you from accessing a desktop, you can access a full-screen TTY with Ctrl-Alt-F3 (or almost any of the "F" keys).

You can remove all packages on your system with {{{nvidia}}} in the name by running:
{{{
# apt purge "*nvidia*"
}}}
And then reboot the system with:
{{{
systemctl reboot
}}}
This should leave you with a functioning system in '''almost all cases'''. If it seems to still be having issues, you may also try running:
{{{
# apt install --reinstall xserver-xorg-core xserver-xorg-video-nouveau
}}}
Or:
{{{
# X -configure
}}}
Line 309: Line 681:
 * [[/Optimus]]  * [[NVIDIA Optimus]]
Line 313: Line 685:
CategoryProprietarySoftware
CategoryProprietarySoftware CategoryHardware CategoryVideo

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.

Commands in this article prefixed with a # indicate they must be run as root. Replace this character with sudo or switch user to root in your terminal beforehand as necessary.

NOTE: For Apple systems, follow these steps first to prevent a black screen after installing the drivers: https://askubuntu.com/a/613573/134848

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 | egrep -i "3d|display|vga"
    07:00.0 VGA compatible controller [0300]: NVIDIA Corporation GM206 [GeForce GTX 960] [10de:1401] (rev a1)

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

Note: if this lspci command returns more than one line of output, you have an Optimus (hybrid) graphics chipset. After you install the necessary driver package, you'll still need to choose one of the methods on the NVIDIA Optimus page in order to activate and make use of your NVIDIA card.

nvidia-detect

The nvidia-detect script (found in the nvidia-detect package in the non-free section) can also be used to identify the GPU and the recommended driver package to install:

  • $ nvidia-detect 
    Detected NVIDIA GPUs:
    07:00.0 VGA compatible controller [0300]: NVIDIA Corporation GM206 [GeForce GTX 960] [10de:1401] (rev a1)
    
    Checking card:  NVIDIA Corporation GM206 [GeForce GTX 960] (rev a1)
    Your card is supported by all driver versions.
    Your card is also supported by the Tesla 440 drivers series.
    Your card is also supported by the Tesla 418 drivers series.
    It is recommended to install the
        nvidia-driver
    package.


Desktop Drivers

The proprietary "NVIDIA Accelerated Linux Graphics Driver" provides optimized hardware acceleration of OpenGL and Vulkan applications through either Xorg or Wayland. It is a binary-only driver requiring a Linux kernel module for its use.

Multiple precompiled driver versions are available for Debian Unstable "Sid":

  • Version 470.103.00 (supported devices)

    • Supports Kepler, Maxwell, Pascal, Turing, and all current Ampere GPUs. Supports Vulkan 1.2 and OpenGL 4.6.
  • Version 390.144 (supported devices)

    • Supports Fermi, Kepler, Maxwell, and most Pascal GPUs. Supports Vulkan 1.0 on Kepler and newer, supports up to OpenGL 4.5 depending on your card.
  • Version 340.108 (legacy GPUs) (supported devices)

    • Older legacy driver, for GeForce 8 series through GeForce 300 series. No Vulkan support, supports up to OpenGL 3.3 depending on your card.

    • Use of the 340-series driver is strongly discouraged. It is not included in stable releases of Debian anymore, has serious unfixable security vulnerabilities, and may not be updated for new kernels in a timely manner. You are highly recommended to use the built-in Nouveau driver if security is a priority.

Multiple precompiled driver versions are available for Debian 12 "Bookworm":

Multiple precompiled driver versions are available for Debian 11 "Bullseye":

Multiple precompiled driver versions are available for Debian 10 "Buster":

Multiple precompiled driver versions are available for Debian 9 "Stretch":

All driver versions up to, and including, the 418-series, are only available for the x86, x86-64, and 32-bit ARMv7 architectures (Debian i386, AMD64, and ARMHF ports respectively).

The 450-series and newer has dropped support for 32-bit architectures, now only supporting x86-64 and ARMv8 (Debian AMD64 and ARM64 ports respectively).


Prerequisites

Kernel headers

Before installing the drivers, you must obtain the proper kernel headers for the NVIDIA driver to build with.

For a typical 64-bit system using the default kernel, you can simply run:

# apt install linux-headers-amd64

For 32-bit systems with the non-PAE kernel, you'd instead install:

# apt install linux-headers-686

Or, for 32-bit systems with the PAE kernel:

# apt install linux-headers-686-pae

If you're using the kernel from Debian Backports, you must run the same command but with the -t flag followed by the name of your backports source. For instance, if you're using backports on a 64-bit Debian 10 system, you might run:

# apt install -t buster-backports linux-headers-amd64


Kernel

In some cases, if you're aiming to install the bleeding-edge version of the NVIDIA driver from Debian Backports, you may also need to install the kernel from backports to match it. For Debian 10, you might do this with:

# apt install -t buster-backports linux-image-amd64

Exchange "buster-backports" with your own version's backports repository as necessary.


Installation

Debian Unstable "Sid"

Version 470.103.01

For support of GeForce 600 series and newer GPUs (supported devices). For older devices, see Version 390 (legacy GPUs).

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

    # Debian Sid
    deb http://deb.debian.org/debian/ sid main contrib non-free
  2. Update the list of available packages, then we can install the nvidia-driver package, plus the necessary firmware:

    # apt update
    # apt install nvidia-driver firmware-misc-nonfree

    DKMS will build the nvidia module for your system, via the nvidia-kernel-dkms package.

    • Optional: if you have SecureBoot enabled, you need to sign the resulting modules. Detailed instructions are available here.

  3. Restart your system to load the new driver.

Version 390.144

For support of GeForce 400 series and newer GPUs (supported devices).

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

    # Debian Sid
    deb http://deb.debian.org/debian/ sid main contrib non-free
  2. Update the list of available packages, then we can install the nvidia-legacy-390xx-driver package, plus the necessary firmware:

    # apt update
    # apt install nvidia-legacy-390xx-driver firmware-misc-nonfree

    DKMS will build the nvidia module for your system, via the nvidia-legacy-390xx-kernel-dkms package.

    • Optional : if you have SecureBoot enabled, you need to sign the resulting modules. Detailed instructions are available here.

  3. Restart your system to load the new driver.

Version 340.108

For support of GeForce 8 series through GeForce 300 series GPUs(supported devices).

Use of the 340-series driver is strongly discouraged. It is not included in stable releases of Debian anymore, has serious unfixable security vulnerabilities, and may not be updated for new kernels in a timely manner. You are highly recommended to use the built-in Nouveau driver if security is a priority.

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

    # Debian Sid
    deb http://deb.debian.org/debian/ sid main contrib non-free
  2. Update the list of available packages, then we can install the nvidia-legacy-340xx-driver package, plus the necessary firmware:

    # apt update
    # apt install nvidia-legacy-340xx-driver firmware-misc-nonfree

    DKMS will build the nvidia module for your system, via the nvidia-legacy-340xx-kernel-dkms package.

    • Optional : if you have SecureBoot enabled, you need to sign the resulting modules. Detailed instructions are available here.

  3. Restart your system to load the new driver.


Debian 12 "Bookworm"

Version 470.103.01

For support of GeForce 600 series and newer GPUs (supported devices). For older devices, see Version 390 (legacy GPUs).

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

    # Debian Bookworm
    deb http://deb.debian.org/debian/ bookworm main contrib non-free
  2. Update the list of available packages, then we can install the nvidia-driver package, plus the necessary firmware:

    # apt update
    # apt install nvidia-driver firmware-misc-nonfree

    DKMS will build the nvidia module for your system, via the nvidia-kernel-dkms package.

    • Optional : if you have SecureBoot enabled, you need to sign the resulting modules. Detailed instructions are available here.

  3. Restart your system to load the new driver.

Version 390.144

For support of GeForce 400 series and newer GPUs (supported devices).

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

    # Debian Bookworm
    deb http://deb.debian.org/debian/ bookworm main contrib non-free
  2. Update the list of available packages, then we can install the nvidia-legacy-390xx-driver package, plus the necessary firmware:

    # apt update
    # apt install nvidia-legacy-390xx-driver firmware-misc-nonfree

    DKMS will build the nvidia module for your system, via the nvidia-legacy-390xx-kernel-dkms package.

    • Optional : if you have SecureBoot enabled, you need to sign the resulting modules. Detailed instructions are available here.

  3. Restart your system to load the new driver.


Debian 11 "Bullseye"

Version 470.103.01

For support of GeForce 600 series and newer GPUs (supported devices). For older devices, see Version 390 (legacy GPUs).

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

    # Debian Bullseye
    deb http://deb.debian.org/debian/ bullseye main contrib non-free
  2. Add bullseye-backports as an additional new line to your /etc/apt/sources.list, for example:

    # bullseye-backports
    deb http://deb.debian.org/debian bullseye-backports main contrib non-free
  3. Update the list of available packages, then we can install the nvidia-driver package, plus the necessary firmware, from the backports repository:

    # apt update
    # apt install -t bullseye-backports nvidia-driver firmware-misc-nonfree

    DKMS will build the nvidia module for your system, via the nvidia-kernel-dkms package.

    • Optional : if you have SecureBoot enabled, you need to sign the resulting modules. Detailed instructions are available here.

  4. Reboot your system to load the updated driver.

Version 460.91.03

For support of GeForce 600 series and newer GPUs (supported devices). For older devices, see Version 390 (legacy GPUs).

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

    # Debian 11 "Bullseye"
    deb http://deb.debian.org/debian/ bullseye main contrib non-free
  2. Update the list of available packages, then we can install the nvidia-driver package, plus the necessary firmware:

    # apt update
    # apt install nvidia-driver firmware-misc-nonfree

    DKMS will build the nvidia module for your system, via the nvidia-kernel-dkms package.

    • Optional : if you have SecureBoot enabled, you need to sign the resulting modules. Detailed instructions are available here.

  3. Restart your system to load the new driver.

Version 390.144

For support of GeForce 400 series and newer GPUs (supported devices).

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

    # Debian 11 "Bullseye"
    deb http://deb.debian.org/debian/ bullseye main contrib non-free
  2. Update the list of available packages, then we can install the nvidia-legacy-390xx-driver package, plus the necessary firmware:

    # apt update
    # apt install nvidia-legacy-390xx-driver firmware-misc-nonfree

    DKMS will build the nvidia module for your system, via the nvidia-legacy-390xx-kernel-dkms package.

    • Optional : if you have SecureBoot enabled, you need to sign the resulting modules. Detailed instructions are available here.

  3. Restart your system to load the new driver.


Debian 10 "Buster"

Version 460.73.01 (via buster-backports)

For support of GeForce 600 series and newer GPUs (supported devices). For older devices, see Version 390 (legacy GPUs) and Version 340 (legacy GPUs).

  1. Add buster-backports as an additional new line to your /etc/apt/sources.list, for example:

    # buster-backports
    deb http://deb.debian.org/debian buster-backports main contrib non-free
  2. Update the list of available packages, then we can install the nvidia-driver package, plus the necessary firmware, from the backports repository:

    # apt update
    # apt install -t buster-backports nvidia-driver firmware-misc-nonfree

    DKMS will build the nvidia module for your system, via the nvidia-kernel-dkms package.

    • Optional : if you have SecureBoot enabled, you need to sign the resulting modules. Detailed instructions are available here.

  3. Reboot your system to load the updated driver.

Version 418.197.02

For support of GeForce 600 series and newer GPUs (supported devices). For older devices, see Version 390 (legacy GPUs) and Version 340 (legacy GPUs).

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

    # Debian 10 "Buster"
    deb http://deb.debian.org/debian/ buster main contrib non-free
  2. Update the list of available packages, then we can install the nvidia-driver package, plus the necessary firmware:

    # apt update
    # apt install nvidia-driver firmware-misc-nonfree

    DKMS will build the nvidia module for your system, via the nvidia-kernel-dkms package.

    • Optional : if you have SecureBoot enabled, you need to sign the resulting modules. Detailed instructions are available here.

  3. Restart your system to load the new driver.

Version 390.138 (legacy GPUs)

For support of GeForce 400 series and newer GPUs (supported devices).

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

    # Debian 10 "Buster"
    deb http://deb.debian.org/debian/ buster main contrib non-free
  2. Update the list of available packages, then we can install the nvidia-legacy-390xx-driver package, plus the necessary firmware:

    # apt update
    # apt install nvidia-legacy-390xx-driver firmware-misc-nonfree

    DKMS will build the nvidia module for your system, via the nvidia-legacy-390xx-kernel-dkms package.

    • Optional : if you have SecureBoot enabled, you need to sign the resulting modules. Detailed instructions are available here.

  3. Restart your system to load the new driver.

Version 340.108 (legacy GPUs)

For support of GeForce 8 series through GeForce 300 series GPUs. (supported devices).

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

    # Debian 10 "Buster"
    deb http://deb.debian.org/debian/ buster main contrib non-free
  2. Update the list of available packages, then we can install the nvidia-legacy-340xx-driver package:

    # apt update
    # apt install nvidia-legacy-340xx-driver

    DKMS will build the nvidia module for your system, via the nvidia-legacy-340xx-kernel-dkms package.

    • Optional : if you have SecureBoot enabled, you need to sign the resulting modules. Detailed instructions are available here.

  3. After, create an Xorg server configuration file and then restart your system to enable the nouveau blacklist.


Debian 9 "Stretch"

As of stretch, you don't need nvidia-xconfig anymore, and a xorg.conf file is not needed either in most situations. Also, the 340 series has been forked into its own series of packages to support older cards.

In some situations running nvidia-xconfig is still required for screen-locking and suspend/resume to work properly (922679 Xfce/lightdm/light-locker)

Version 418.152 (via stretch-backports)

For support of GeForce 700 series and newer GPUs (supported devices). For older devices, see Version 340 (legacy GPUs) and Version 304 (legacy GPUs).

  1. Add stretch-backports as an additional new line to your /etc/apt/sources.list, for example:

    # stretch-backports
    deb http://deb.debian.org/debian stretch-backports main contrib non-free
  2. Update the list of available packages, then we can install the nvidia-driver package, plus the necessary firmware, from the backports repository:

    # apt update
    # apt install -t stretch-backports nvidia-driver firmware-misc-nonfree

    DKMS will build the nvidia module for your system, via the nvidia-kernel-dkms package.

  3. Restart your system to enable the nouveau blacklist.

Version 390.138

For support of GeForce 400 series and higher GPUs (supported devices). For older devices, see Version 340 (legacy GPUs) and Version 304 (legacy GPUs).

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

    # Debian 9 "Stretch"
    deb http://deb.debian.org/debian/ stretch main contrib non-free
  2. Update the list of available packages, then we can install the nvidia-driver package, plus the necessary firmware:

    # apt update
    # apt install nvidia-driver firmware-misc-nonfree

    DKMS will build the nvidia module for your system, via the nvidia-kernel-dkms package.

  3. Restart your system to enable the nouveau blacklist.

Version 340.108 (legacy GPUs)

For support of GeForce 8 series through GeForce 300 series GPUs (supported devices).

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

    # Debian 9 "Stretch"
    deb http://deb.debian.org/debian/ stretch main contrib non-free
  2. Update the list of available packages, then we can install the nvidia-legacy-340xx-driver package:

    # apt update
    # apt install nvidia-legacy-340xx-driver

    DKMS will build the nvidia module for your system, via the nvidia-legacy-340xx-kernel-dkms package.

    After, create an Xorg server configuration file and then restart your system to enable the nouveau blacklist.

Version 304.137 (legacy GPUs)

For support of GeForce 6 series and GeForce 7 series GPUs (supported devices).

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

    # Debian 9 "Stretch"
    deb http://deb.debian.org/debian/ stretch main contrib non-free
  2. Update the list of available packages, then we can install the nvidia-legacy-304xx-driver package:

# apt install nvidia-legacy-304xx-driver


Installing 32-bit libraries on a 64-bit system

In many cases, such as when running proprietary 32-bit games from Steam or in Wine, you may need 32-bit graphics libraries on your 64-bit system in order for them to function properly. This has been made much easier since Debian 9/Stretch and now requires minimal extra work.

Note that the following instructions assume that sudo is configured on your system. If it isn't, either follow the instructions on the sudo wiki page or omit the sudo and run these commands as root.

After installing the drivers, enable 32-bit multiarch and update your repository listing by running:

sudo dpkg --add-architecture i386 && sudo apt update

Afterwards, to install the 32-bit version of the NVIDIA libraries package, run:

sudo apt install nvidia-driver-libs:i386

Restarting the relevant applications may be necessary before they function correctly.

WARNING: If you're forced to use a legacy driver, you will want to instead install one of nvidia-legacy-390xx-driver-libs:i386, nvidia-legacy-340xx-driver-libs:i386, or nvidia-legacy-304xx-driver-libs:i386.


Wayland

The NVIDIA driver supports Wayland, with caveats. The 495-series driver (or newer) is recommended for the best experience, as older versions only support Wayland through an NVIDIA-specific API which is not supported by all desktops, and is generally less reliable.

The NVIDIA driver also lacks support for accelerated XWayland applications in current stable Debian versions. This means that if you run a Xorg-only application on your NVIDIA Wayland desktop (often proprietary video games), they will only be able to render on the CPU without taking advantage of GPU acceleration, leading to incredibly poor performance. Patches have been merged to resolve this, however this support will only be available in Debian 12/Bookworm.

In terms of specific desktop support, GNOME supports NVIDIA Wayland sessions in both Debian 10 and Debian 11, though they call their support "preliminary". KDE Plasma supports NVIDIA Wayland sessions starting with Debian 11, though it requires some extra hoops to enable, and generally is not recommended. Refer to the Wayland section of the Debian KDE wiki page for up-to-date information: https://wiki.debian.org/KDE#Wayland.2C_touchscreens.2C_autorotation.2C_hi-DPI

In Debian 12 (currently Debian Testing), almost all issues should be resolved and most Wayland sessions should "just work" with the 495-series driver, however some major issues remain with KDE Plasma. These will require merging KDE's Qt 5 patch collection to fix: https://salsa.debian.org/qt-kde-team/qt/qtwayland/-/merge_requests/5


Tesla Drivers

The NVIDIA line-up of programmable "Tesla" devices, used primarily for simulations and large-scale calculations, also require separate driver packages to function correctly compared to the consumer-grade GeForce GPUs that are instead targeted for desktop and gaming usage.

In Debian 10/Buster, the default nvidia-driver package is based on the Tesla release. This was done in order to resolve several critical security issues, but it means that there is no need to install the separate package for Tesla devices to work. If you need a newer release, the 450-series driver is available in backports via the nvidia-tesla-450-driver package.

In Debian 11/Bullseye, the major 418, 440, and 450 releases of the Tesla driver are available and distinct from the default driver. They can be found in the nvidia-tesla-418-driver, nvidia-tesla-440-driver, and nvidia-tesla-450-driver packages respectively.

The 32-bit libraries can be obtained by installing nvidia-tesla-418-driver-libs:i386, nvidia-tesla-440-driver:i386, or nvidia-tesla-450-driver:i386 based on the version of your driver. Multiarch must be enabled.


Configuration

As the NVIDIA driver is not autodetected by Xorg, a configuration file is required to be supplied. Modern Debian packages for the NVIDIA driver should not require you to do anything listed here as they handle this automatically during installation, but if you run into issues, or are using a much older version of Debian, you may try going through these steps.

Automatic

Install the nvidia-xconfig package, then run it with sudo. It will automatically generate a Xorg configuration file at /etc/X11/xorg.conf.

Manual

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 -p /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

Please note that this configuration will break Xorg on Optimus systems. For such hardware, see NVIDIA Optimus instead.

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

Additional configuration information is available.


CUDA

Debian Unstable "Sid"

CUDA 11.4.3 is available from the non-free repository:

# apt install nvidia-cuda-dev nvidia-cuda-toolkit

This installs nvcc and friends. The visual profiler is in a separate package named nvidia-visual-profiler.

Debian 12 "Bookworm"

CUDA 11.4.3 is available from the non-free repository:

# apt install nvidia-cuda-dev nvidia-cuda-toolkit

This installs nvcc and friends. The visual profiler is in a separate package named nvidia-visual-profiler.

Debian 11 "Bullseye"

CUDA 11.2.2 is available from the non-free repository:

# apt install nvidia-cuda-dev nvidia-cuda-toolkit

This installs nvcc and friends. The visual profiler is in a separate package named nvidia-visual-profiler.

Debian 10 "Buster"

CUDA 9.2.148 is available from the non-free repository:

# apt install nvidia-cuda-dev nvidia-cuda-toolkit

And, if Backports are enabled, CUDA 11.2.1 is available similarly:

# apt -t buster-backports install nvidia-cuda-dev nvidia-cuda-toolkit

This installs nvcc and friends. The visual profiler is in a separate package named nvidia-visual-profiler.

Debian 9 "Stretch"

CUDA 8.0.44 is available from the non-free repository:

# apt install nvidia-cuda-dev nvidia-cuda-toolkit 

And, if Backports are enabled, CUDA 9.1.85 is available similarly:

# apt -t stretch-backports install nvidia-cuda-dev nvidia-cuda-toolkit

This installs nvcc and friends. The visual profiler is in a separate package named nvidia-visual-profiler.

CUDA 8 only supports gcc 5.3.1, which is not available for Stretch. To compile you need to add -ccbin clang-3.8 to the nvcc command line.

The Debian CUDA packages unfortunately do not include the Toolkit samples. To install these yourself you need to download the "Ubuntu 16.04" .run install file for CUDA 8 from https://developer.nvidia.com/cuda-downloads. Execute the .run file and (after accepting the license and agreeing to run on a non-supported system) skip the driver and toolkit installation and just select "Samples". Note before this step you must

export PERL5LIB=. 

To compile the samples, you first need to set

export HOST_COMPILER=clang++-3.8


Troubleshooting

Build failures

The NVIDIA driver can fail to build for several potential reasons.

1. You've installed a kernel from backports without installing the NVIDIA driver from backports. This can, in some cases, mean that the kernel is too new for the driver version you're attempting to use. Check this by viewing the package description for the NVIDIA driver where it will mention something along the lines of, "Building the kernel module has been tested up to Linux X.X" to figure out what's supported.

2. Particularly if you're on Debian Testing or Debian Unstable, the driver might not support your kernel yet. Often, new versions of the Linux kernel will explicitly require an update to the driver in order to be supported, so if the kernel package updates before the driver has a chance to be patched for it, you won't be able to use the NVIDIA driver. Solutions for this, from most to least recommended, are temporarily using an older kernel until the driver is updated, installing a newer version of the driver from Debian Experimental if one is available that supports your kernel version, or finding a patch for the build failure online that can be added to DKMS. The last two options are for advanced users and may break your system or, in the case of adding a third-party patch, introduce security issues, forcing you to potentially reinstall completely or spend hours recovering your system. Caveat emptor.

3. Legacy versions of the NVIDIA driver may not always support the latest kernel. For instance, the 304xx series driver, though available in the Debian Unstable repository, does not support Linux 5.0 or newer. As necessary, you might consider using an older Debian version, or using Nouveau instead. Nouveau has decent performance with GPUs that are old enough to no longer be supported by the proprietary driver.

Driver stops working after upgrading Debian

When going between two major Debian releases (e.g., upgrading from Debian 9/Stretch to Debian 10/Buster), it's possible that the driver will stop functioning despite the build succeeding and no other issues being easily visible. This is most often caused by the nvidia-driver package updating to a newer major release that no longer supports your hardware, as NVIDIA regularly drops support for older hardware generations. You will need to uninstall all your existing NVIDIA packages (refer to the section below for instructions on how to do so), and instead install the most recent legacy driver that still supports your GPU.

GPU isn't functional, even with a compatible driver version installed

If you have an extremely modern NVIDIA GPU that was manufactured after the release of your Debian version, it may not work even after installing the newest backported driver that claims to support your card. If so, you likely need to upgrade the non-free firmware package on your system as well by installing the firmware-misc-nonfree package from backports. For instance, on a Debian 10 system with backports enabled:

# apt install -t buster-backports firmware-misc-nonfree

After rebooting, the driver should be able to load the appropriate firmware.

Miscellaneous

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

    • 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.
  • If you can't change the screen brightness, open your Xorg configuration file (/etc/X11/xorg.conf or /etc/X11/xorg.conf.d/20-nvidia.conf depending on which method you used) and add

        Option         "RegistryDwords" "EnableBrightnessControl=1;"

    to the Device section. In some case (eg. GeForce GT 650M Mac Edition) it may cause screen flickering during boot time (just after grub screen), and system will not boot. In this case you should use instead add the following:

    setpci -v -H1 -s 00:01.00 BRIDGE_CONTROL=0

    to the file: /etc/rc.local

  • You can check whether or not the kernel module for the NVIDIA driver has been loaded, in addition to what version is currently loaded, by running /sbin/modinfo -F version nvidia-current

  • Additional troubleshooting information is available.


Uninstallation

If you run into issues with the drivers, switch to a different card, or simply want to use the open-source Nouveau drivers instead, uninstallation is made easy with recent versions of the drivers.

Also note that if issues with the driver prevent you from accessing a desktop, you can access a full-screen TTY with Ctrl-Alt-F3 (or almost any of the "F" keys).

You can remove all packages on your system with nvidia in the name by running:

# apt purge "*nvidia*"

And then reboot the system with:

systemctl reboot

This should leave you with a functioning system in almost all cases. If it seems to still be having issues, you may also try running:

# apt install --reinstall xserver-xorg-core xserver-xorg-video-nouveau

Or:

# X -configure

See Also


CategoryProprietarySoftware CategoryHardware CategoryVideo