Debian / nvidia/ kernel

james80

Member
Joined
Jan 17, 2021
Messages
44
Reaction score
5
Credits
332
Hi,

using trixie, and I installed nvidia driver without issue when I was on that kernel ; 6.12.10-amd64

but since yesterday the kernel has been updated to 6.12.11-amd64, and now when I rebooted my system, I boot into tty session, don't have my DE, do you know how to proceed?

thanks

EDIT: I have to keep the older kernel, 6.12.10 for always or what?
:D
 


It depends on how you installed Nvidia driver? from Debian's repo or from Nvidia site?
 
It depends on how you installed Nvidia driver? from Debian's repo or from Nvidia site?
from .run (nvidia website) I tried from Debian's repo but it was not working properly. Now it is working well...except with the new kernel update
 
from .run (nvidia website) I tried from Debian's repo but it was not working properly. Now it is working well...except with the new kernel update
Problem is that when you use driver from Nvidia site you need to reinstall it each time there is kernel upgrade.

The exact procedure is this:
1. When kernel gets upgraded, you must not reboot or shut down system as this will make access to desktop impossible
2. Instead after kernel upgrade you immediately run the following command:

Bash:
sudo systemctl set-default multi-user.target

Step 2 is to make sure you have Nvidia driver (the *.run file) downloaded and saved somewhere, e.g. Downloads directory.

After this command is run and you have the driver installer, if you reboot system it will boot into text mode.
At that point you must reinstall the driver in text mode so that the module gets inserted into the new kernel's initramfs
Once you reinstall the driver you run:

Bash:
sudo systemctl set-default graphical.target
And reboot system.

There are further steps but this is minimal.

---

But you can't do this now because you already rebooted and now have lost access to desktop.

What you can try, but is unlikely to work is during boot in grub menu select old kernel and boot from it.
If you're able to boot from old kernel into desktop let me know.
 
Problem is that when you use driver from Nvidia site you need to reinstall it each time there is kernel upgrade.

The exact procedure is this:
1. When kernel gets upgraded, you must not reboot or shut down system as this will make access to desktop impossible
2. Instead after kernel upgrade you immediately run the following command:

Bash:
sudo systemctl set-default multi-user.target

Step 2 is to make sure you have Nvidia driver (the *.run file) downloaded and saved somewhere, e.g. Downloads directory.

After this command is run and you have the driver installer, if you reboot system it will boot into text mode.
At that point you must reinstall the driver in text mode so that the module gets inserted into the new kernel's initramfs
Once you reinstall the driver you run:

Bash:
sudo systemctl set-default graphical.target
And reboot system.

There are further steps but this is minimal.

---

But you can't do this now because you already rebooted and now have lost access to desktop.

What you can try, but is unlikely to work is during boot in grub menu select old kernel and boot from it.
If you're able to boot from old kernel into desktop let me know.
thanks, so now, I rebooted once, so I can do it anyway?
 
thanks, so now, I rebooted once, so I can do it anyway?
Rebooted how? Do you have access to terminal (text mode)? or have you rebooted from old kernel to desktop?

And do you have the *.run file downloaded?
 
Rebooted how? Do you have access to terminal (text mode)? or have you rebooted from old kernel to desktop?

And do you have the *.run file downloaded?
after the kernel updated with apt update /upgrade, I rebooted. But it was in tty mode, so I rebooted again to chose the older kernel in grub menu. So now I am on my desktop session
 
so I rebooted again to chose the older kernel in grub menu. So now I am on my desktop session
OK, use it to be able to recover data if need, to actually reinstall the driver now you have 2 options:
1. One option is to reinstall driver while booted from old kernel (which what you're at now)
2. Second option is to reboot from new kernel that was installed, but this depends on whether you'll able to login in tty mode?

after the kernel updated with apt update /upgrade, I rebooted. But it was in tty mode
Are you able to login with username/password in tty mode, (when booting from new kernel)?
From my experience you shouldn't be able but what you describe it seems like you're able?
 
OK, use it to be able to recover data if need, to actually reinstall the driver now you have 2 options:
1. One option is to reinstall driver while booted from old kernel (which what you're at now)
2. Second option is to reboot from new kernel that was installed, but this depends on whether you'll able to login in tty mode?


Are you able to login with username/password in tty mode, (when booting from new kernel)?
From my experience you shouldn't be able but what you describe it seems like you're able?
Yes I am able
 
OK, use it to be able to recover data if need, to actually reinstall the driver now you have 2 options:
1. One option is to reinstall driver while booted from old kernel (which what you're at now)
2. Second option is to reboot from new kernel that was installed, but this depends on whether you'll able to login in tty mode?


Are you able to login with username/password in tty mode, (when booting from new kernel)?
From my experience you shouldn't be able but what you describe it seems like you're able?
also, dont know if it is related to my situation?
https://www.linux.org/threads/nvidia-driver-with-multiple-kernels.51155/
 
It's related but this method is what you'll do only once you have the new kernel operational.

Yes I am able
First make sure you have downloaded and saved the driver *.run file.
Then reboot again but from new kernel because you'll need to install kernel headers.

When you boot from new kernel into tty do this, (remember steps or use phone or another PC to follow them)
1. login with username/password
2. run commands:

Bash:
sudo apt update
sudo apt install linux-headers-amd64

# Uninstall driver (cd into directory where you have *.run file)
cd /path/to/driver package
sudo ./NVIDIA-Linux-x86_64-x.x.x.run -s --uninstall

# Install the driver
sudo ./NVIDIA-Linux-x86_64-x.x.x.run

Then reboot again to new kernel and it should work:
Bash:
sudo systemctl set-default graphical.target
systemctl reboot
 
Last edited:
It's related but this method is what you'll do only once you have the new kernel operational.


First make sure you have downloaded and saved the driver *.run file.
Then reboot again but from new kernel because you'll need to install kernel headers.

When you boot from new kernel into tty do this, (remember steps or use phone or another PC to follow them)
1. login with username/password
2. run commands:

Bash:
sudo apt update
sudo apt install linux-headers-amd64

# Uninstall driver (cd into directory where you have *.run file)
cd /path/to/driver package
sudo ./NVIDIA-Linux-x86_64-x.x.x.run -s --uninstall

# Install the driver
sudo ./NVIDIA-Linux-x86_64-x.x.x.run

Then reboot again to new kernel and it should work:
Bash:
sudo systemctl set-default graphical.target
systemctl reboot
thanks,

after installation, it booted directly to my DE login screen, don't need to
Code:
systemctl reboot
btw, during installation, nvidia program asks about DKMS for the next kernel updates and as the other time I did, I chose yes but with this problem I've had today, it seems not working properly.
 
btw, during installation, nvidia program asks about DKMS for the next kernel updates and as the other time I did, I chose yes but with this problem I've had today, it seems not working properly.
I'm anti DKMS as you have noticed in that other thread, I prefer do reinstall the driver myself each time.
But if you feel DKMS is what you want go ahead, I however have no experience with it.

now, do I need to do something else?
You're now in the new kernel, with the driver installed and desktop works, if yes then...

The procedure you followed from my previous post uninstalled the driver from old kernel which was required.
Next step is to install the driver to old kernel but while you're booted to new kernel. (the point at which you should be at now)

This procedure requires installation of same driver version that's installed to current kernel

Bash:
# List kernels
dpkg --list | grep linux-image

Depending on output you run the command below, replace x.x.x+bpo-amd64 with version of the old kernel,
if you're unsure what to replace share output of the command above.

Bash:
# Install to offline (old) kernel reported by: dpkg --list | grep linux-image
sudo ./NVIDIA-Linux-x86_64-x.x.x.run -K -k x.x.x+bpo-amd64
This step above is done from terminal in desktop session.
 
should be that one:
Code:
sudo ./NVIDIA-Linux-x86_64-535.230.02.run -K -k linux-image-6.12.10-amd64
Not linux-image, omit that and just place 6.12.10-amd64, therefore:

sudo ./NVIDIA-Linux-x86_64-535.230.02.run -K -k 6.12.10-amd64
 
# Install to offline (old) kernel reported by: dpkg --list | grep linux-image sudo ./NVIDIA-Linux-x86_64-x.x.x.run -K -k x.x.x+bpo-amd64
btw, why I update the older kernel too with nvidia? I could keep that one like this if I have a problem with the other?
just asking
 
btw, why I update the older kernel too with nvidia? I could keep that one like this if I have a problem with the other?
just asking
Yes, if something goes wrong you can always switch to old kernel with desktop session.

Without this second step your old kernel would be totally useless once nvidia driver is reinstalled and no way to recover if needed other than system reinstall.

What's most likely to happen is when you update system you may miss that kernel was upgraded, in that case you can work around from old kernel.
 



Top