How to install Nvidia drivers on Debian 11 (Bullseye) guide???

Desktop Environments and Multimedia
Message
Author
jscoys
Posts: 13
Joined: 2021-11-22 21:16
Has thanked: 2 times
Been thanked: 1 time

How to install Nvidia drivers on Debian 11 (Bullseye) guide???

#1 Post by jscoys »

Hello,

I'm trying to install Nvidia drivers for my Geforce 1060 on a Debian 11 (Bullseye), but no success so far...

Some people says you need the CUDA package, others says you need the CUDA Toolkit package (https://developer.nvidia.com/cuda-downl ... eb_network)...

When following the Tutorial from Nvidia itself (https://wiki.debian.org/NvidiaGraphicsD ... _460.91.03) I end up with a compilation error...

Running this command gives me this result:
nvidia-smi
NVIDIA-SMI has failed because it couldn't communicate with the NVIDIA driver. Make sure that the latest NVIDIA driver is installed and running.

Please does someone has a tutorial somewhere that is really working? A script (sh) maybe?

uname -r
5.14.0-0.bpo.2-amd64

Thx in advance!

mm3100
Posts: 318
Joined: 2020-10-21 21:39
Has thanked: 6 times
Been thanked: 12 times

Re: How to install Nvidia drivers on Debian 11 (Bullseye) guide???

#2 Post by mm3100 »

Did you check Debian wiki for that subject?
https://wiki.debian.org/NvidiaGraphicsDrivers

User avatar
sunrat
Global Moderator
Global Moderator
Posts: 4489
Joined: 2006-08-29 09:12
Location: Melbourne, Australia
Has thanked: 38 times
Been thanked: 110 times

Re: How to install Nvidia drivers on Debian 11 (Bullseye) guide???

#3 Post by sunrat »

The current nvidia-driver package in Bullseye does not support kernel 5.14 yet. Hopefully a newer driver will be ported to backports sometime soon. I'm waiting for it myself. Your best option is to use the default 5.10 kernel until then.
If you are really impatient or desperate you could use sgfxi but that makes it more complicated to install the driver from Debian repo when it does become available, and we can't guarantee it won't damage your system.
“ computer users can be divided into 2 categories:
Those who have lost data
...and those who have not lost data YET ”
Remember to BACKUP!

jscoys
Posts: 13
Joined: 2021-11-22 21:16
Has thanked: 2 times
Been thanked: 1 time

Re: How to install Nvidia drivers on Debian 11 (Bullseye) guide???

#4 Post by jscoys »

Thank you man, I appreciate. By curiosity how much have you been waiting for this to be available already?

User avatar
sunrat
Global Moderator
Global Moderator
Posts: 4489
Joined: 2006-08-29 09:12
Location: Melbourne, Australia
Has thanked: 38 times
Been thanked: 110 times

Re: How to install Nvidia drivers on Debian 11 (Bullseye) guide???

#5 Post by sunrat »

jscoys wrote: 2021-11-26 20:46 Thank you man, I appreciate. By curiosity how much have you been waiting for this to be available already?
Since 5.14 became available. :|
“ computer users can be divided into 2 categories:
Those who have lost data
...and those who have not lost data YET ”
Remember to BACKUP!

User avatar
@ttila
Posts: 47
Joined: 2017-12-13 16:57
Has thanked: 1 time
Been thanked: 1 time

Re: How to install Nvidia drivers on Debian 11 (Bullseye) guide???

#6 Post by @ttila »

My Bullseye is running the kernel 5.15.3 and Nvidia 470.86 drivers. I get some troubles but reinstalling the nvidia-kernel-dkms package compiled modules for the newer kernel (check always that the directory /lib/modules/5.15.0-1-amd64/updates/dkms contains modules).

User avatar
sunrat
Global Moderator
Global Moderator
Posts: 4489
Joined: 2006-08-29 09:12
Location: Melbourne, Australia
Has thanked: 38 times
Been thanked: 110 times

Re: How to install Nvidia drivers on Debian 11 (Bullseye) guide???

#7 Post by sunrat »

@ttila wrote: 2021-11-27 15:38 My Bullseye is running the kernel 5.15.3 and Nvidia 470.86 drivers. I get some troubles but reinstalling the nvidia-kernel-dkms package compiled modules for the newer kernel (check always that the directory /lib/modules/5.15.0-1-amd64/updates/dkms contains modules).
Neither that kernel nor that version of nvidia drivers are available in Bullseye or backports repository. Did you compile them yourself?
“ computer users can be divided into 2 categories:
Those who have lost data
...and those who have not lost data YET ”
Remember to BACKUP!

User avatar
@ttila
Posts: 47
Joined: 2017-12-13 16:57
Has thanked: 1 time
Been thanked: 1 time

Re: How to install Nvidia drivers on Debian 11 (Bullseye) guide???

#8 Post by @ttila »

sunrat wrote: 2021-11-27 22:01
@ttila wrote: 2021-11-27 15:38 My Bullseye is running the kernel 5.15.3 and Nvidia 470.86 drivers. I get some troubles but reinstalling the nvidia-kernel-dkms package compiled modules for the newer kernel (check always that the directory /lib/modules/5.15.0-1-amd64/updates/dkms contains modules).
Neither that kernel nor that version of nvidia drivers are available in Bullseye or backports repository. Did you compile them yourself?
Sorry, I'm talking about Debian 12 "Bookworm", "Bullseye" is stuck with the 5.10 kernel and a old nvidia drivers.

jscoys
Posts: 13
Joined: 2021-11-22 21:16
Has thanked: 2 times
Been thanked: 1 time

Re: How to install Nvidia drivers on Debian 11 (Bullseye) guide???

#9 Post by jscoys »

Hey guys thx for your replies, I really appreciate all the information you gave me.

When I do an apt list "*nvidia*" I see just packages with 460 version on it, even with the backport configured in my sources.list. Do you confirm it's the last version available?

My Kernel version is indeed the 5.14.0-0.bpo.2-amd64.

Question for you:
- Can I downgrade to the 5.10 Kernel version? What is the process? Is it long, dangerous?
- Can I upgrade to bookworm and then get the backported 470 version? What is the procedure to do it?

Or should I wait because both solutions above are kind of dangerous finally?

User avatar
sunrat
Global Moderator
Global Moderator
Posts: 4489
Joined: 2006-08-29 09:12
Location: Melbourne, Australia
Has thanked: 38 times
Been thanked: 110 times

Re: How to install Nvidia drivers on Debian 11 (Bullseye) guide???

#10 Post by sunrat »

jscoys wrote: 2021-12-05 01:49When I do an apt list "*nvidia*" I see just packages with 460 version on it, even with the backport configured in my sources.list. Do you confirm it's the last version available?
Yes.
- Can I downgrade to the 5.10 Kernel version? What is the process? Is it long, dangerous?
It should still be installed unless you manually removed it. Do

Code: Select all

apt list --installed linux-image*
If it's not there, do

Code: Select all

apt list linux-image-5.10*
to find the exact name and install it. And unless you have the metapackage linux-image-amd64 from backports, the version from stable should automatically depend on the 5.10 kernel and cause the latest 5.10 to be installed. You will need the kernel headers as well.
- Can I upgrade to bookworm and then get the backported 470 version? What is the procedure to do it?
Testing (Bookworm) is not an upgrade, it is a development version which takes more skilled management than stable. It's not a "backported version", testing is where stable backports come from.
Generally, if you have to ask don't use testing.
Or should I wait because both solutions above are kind of dangerous finally?
Yes.
I'm not sure why you are pursuing this. Nvidia 460.xx drivers for GTX1060 should work fine on the 5.10 kernel.
“ computer users can be divided into 2 categories:
Those who have lost data
...and those who have not lost data YET ”
Remember to BACKUP!

jscoys
Posts: 13
Joined: 2021-11-22 21:16
Has thanked: 2 times
Been thanked: 1 time

Re: How to install Nvidia drivers on Debian 11 (Bullseye) guide???

#11 Post by jscoys »

Hello! Thx again for your help! Well I pursue the installation of Nvidia drivers through this Wiki page: https://wiki.debian.org/NvidiaGraphicsD ... _460.91.03, but I'm not succeeded :-( I've got a lot of compilation errors and nothing works. But you're right! I've got the two Kernel version installed:

Code: Select all

linux-image-5.10.0-9-amd64/stable,now 5.10.70-1 amd64 [installed,automatic]
linux-image-5.14.0-0.bpo.2-amd64/bullseye-backports,now 5.14.9-2~bpo11+1 amd64 [installed,automatic]
linux-image-amd64/bullseye-backports,now 5.14.9-2~bpo11+1 amd64 [installed]
I guess I should specify the drivers to be installed with the 5.10? How can I do that? With Kernel headers?

User avatar
sunrat
Global Moderator
Global Moderator
Posts: 4489
Joined: 2006-08-29 09:12
Location: Melbourne, Australia
Has thanked: 38 times
Been thanked: 110 times

Re: How to install Nvidia drivers on Debian 11 (Bullseye) guide???

#12 Post by sunrat »

I'd guess the build errors are for the 5.14 kernel but not sure if the build for 5.10 would still proceed but it should. Have you booted the 5.10 kernel to see if nvidia drivers are working?
I'm starting to wonder if bullseye-backports will ever see nvidia driver ≥470, it's been a long time. There may be something in toolchain dependencies which can not be satisfied in Bullseye.
I suggest to boot to 5.10 first, purge linux-image-5.14.0-0.bpo.2-amd64 and linux-image-amd64, then reinstall linux-image-amd64 which should then be the Bullseye version and do

Code: Select all

apt update && apt full-upgrade
This will also pull in the new 5.10 kernel which was just released recently. Then reinstall nvidia-driver package if necessary.
“ computer users can be divided into 2 categories:
Those who have lost data
...and those who have not lost data YET ”
Remember to BACKUP!

jscoys
Posts: 13
Joined: 2021-11-22 21:16
Has thanked: 2 times
Been thanked: 1 time

Re: How to install Nvidia drivers on Debian 11 (Bullseye) guide???

#13 Post by jscoys »

Hey sunrat thanks!

Sorry, noob question here...

So if I boot into the 5.10 Kernel I should then be able to install the NVidia 460 drivers. Are all my other modules going to work with this Kernel even if I installed everything when I was using the 5.14?

Also could I come back booting and using the 5.14 after installing under the 5.10 or the Nvidia driver won't work?

jscoys
Posts: 13
Joined: 2021-11-22 21:16
Has thanked: 2 times
Been thanked: 1 time

Re: How to install Nvidia drivers on Debian 11 (Bullseye) guide???

#14 Post by jscoys »

I suggest to boot to 5.10 first, purge linux-image-5.14.0-0.bpo.2-amd64 and linux-image-amd64
Ok so you suggest me to get rid of the 5.14?!

User avatar
sunrat
Global Moderator
Global Moderator
Posts: 4489
Joined: 2006-08-29 09:12
Location: Melbourne, Australia
Has thanked: 38 times
Been thanked: 110 times

Re: How to install Nvidia drivers on Debian 11 (Bullseye) guide???

#15 Post by sunrat »

jscoys wrote: 2021-12-20 17:43
I suggest to boot to 5.10 first, purge linux-image-5.14.0-0.bpo.2-amd64 and linux-image-amd64
Ok so you suggest me to get rid of the 5.14?!
Yes
“ computer users can be divided into 2 categories:
Those who have lost data
...and those who have not lost data YET ”
Remember to BACKUP!

jscoys
Posts: 13
Joined: 2021-11-22 21:16
Has thanked: 2 times
Been thanked: 1 time

Re: How to install Nvidia drivers on Debian 11 (Bullseye) guide???

#16 Post by jscoys »

Thx sunrat, just to be sure I'm not destroying my installation, and also I'm pretty new to Linux world, could you confirm those cmd please:
1) Boot with the 5.10 from Grub menu
2) apt-get remove linux-image-5.10.0-9-amd64
3) apt-get remove linux-image-amd64
4) dpkg --list | grep 5.10.0-9
5) apt-get remove <each modules appearing on results from 4) command
6-7-9...) Is there something else to do? A command to update grub maybe? What about linux-headers? Should I install them after a reboot or immediatly? Is there something I forgot? Thx again for your help.

jscoys
Posts: 13
Joined: 2021-11-22 21:16
Has thanked: 2 times
Been thanked: 1 time

Re: How to install Nvidia drivers on Debian 11 (Bullseye) guide???

#17 Post by jscoys »

Just to be sure, I was on the assumption that the "linux-image-amd64" is a kind of "pointer" to the latest kernel installed? So I shouldn't remove it right?

canci
Posts: 2227
Joined: 2006-09-24 11:28
Has thanked: 55 times
Been thanked: 69 times

Re: How to install Nvidia drivers on Debian 11 (Bullseye) guide???

#18 Post by canci »

If you remove it, you won't automatically get the next point release.
🍥

Asus VivoBook X421DA D413DA 1.0
Debian GNU/Linux 11 (bullseye) x86_64 Kernel 5.10
sway on Wayland
AMD Ryzen 7 3700U with Radeon Vega Mobile Gfx (Picasso)
8 GB RAM, 512GB NVMe drive

User avatar
sunrat
Global Moderator
Global Moderator
Posts: 4489
Joined: 2006-08-29 09:12
Location: Melbourne, Australia
Has thanked: 38 times
Been thanked: 110 times

Re: How to install Nvidia drivers on Debian 11 (Bullseye) guide???

#19 Post by sunrat »

jscoys wrote: 2022-01-02 17:58 Thx sunrat, just to be sure I'm not destroying my installation, and also I'm pretty new to Linux world, could you confirm those cmd please:
1) Boot with the 5.10 from Grub menu
2) apt-get remove linux-image-5.10.0-9-amd64
3) apt-get remove linux-image-amd64
4) dpkg --list | grep 5.10.0-9
5) apt-get remove <each modules appearing on results from 4) command
6-7-9...) Is there something else to do? A command to update grub maybe? What about linux-headers? Should I install them after a reboot or immediatly? Is there something I forgot? Thx again for your help.
No, wrong. You need to remove 5.14 and keep 5.10:
1) boot 5.10 from GRUB
Then remove 5.14 kernel and metapackages from backports
2)

Code: Select all

apt purge linux-image-5.14.xx linux-image-amd64 linux-headers-5.14.xxx linux-headers-amd64
(replace the xx with actual version)
And install the stable versions
3)

Code: Select all

apt install linux-image-amd64 linux-headers-amd64
“ computer users can be divided into 2 categories:
Those who have lost data
...and those who have not lost data YET ”
Remember to BACKUP!

jscoys
Posts: 13
Joined: 2021-11-22 21:16
Has thanked: 2 times
Been thanked: 1 time

Re: How to install Nvidia drivers on Debian 11 (Bullseye) guide???

#20 Post by jscoys »

Hello! Thx a lot! I did remove the 5.14 and did a "update-grub2" so it boots automatically with the 5.10!

Now I'm in trouble to get rid completely of the 5.14 because when trying to install the image-amd64 and new headers, it tries to reinstall everything for the 5.14...

Code: Select all

root@server:~# uname -r
5.10.0-9-amd64
root@server:~# apt list --installed linux-image*
Listing... Done
linux-image-5.10.0-9-amd64/stable,now 5.10.70-1 amd64 [installed,automatic]
root@server:~# apt list --installed linux-headers*
Listing... Done
root@server:~# apt install linux-image-amd64 linux-headers-amd64
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
The following additional packages will be installed:
  linux-compiler-gcc-10-x86 linux-headers-5.14.0-0.bpo.2-amd64 linux-headers-5.14.0-0.bpo.2-common linux-image-5.14.0-0.bpo.2-amd64 linux-kbuild-5.14
Suggested packages:
  linux-doc-5.14 debian-kernel-handbook
The following NEW packages will be installed:
  linux-compiler-gcc-10-x86 linux-headers-5.14.0-0.bpo.2-amd64 linux-headers-5.14.0-0.bpo.2-common linux-headers-amd64 linux-image-5.14.0-0.bpo.2-amd64 linux-image-amd64 linux-kbuild-5.14
0 upgraded, 7 newly installed, 0 to remove and 2 not upgraded.
Need to get 73.8 MB/74.2 MB of archives.
After this operation, 436 MB of additional disk space will be used.
Do you want to continue? [Y/n]
Any idea how I indicate to my Debian to install them for the linux-image-5.10.0-9-amd64?!

Post Reply