Cannot install Nvidia Legacy drivers after kernel update

Hi, So my laptop has a Geforce 820M graphics card. First time I used Nvidia driver archive to find the driver. I used to download 390xx drivers through the fedora repo. After every kernel update I would reinstall it(didn’t know how to versionlock it). But after the last kernel update, the drivers do not recognize the graphics card. So I’ve been using nouveau ever since and my Intel CPU(Having performance issues). I wonder if there’s reason this is happening and what would be the potential fix.



there is an updated akmod package available on rpmfusion.org. Currently it’s available in the *testing repositories only.

https://koji.rpmfusion.org/koji/buildinfo?buildID=29724

akmod-nvidia-390xx-390.157-11.fc40.x86_64.rpm

Mon Aug 19 2024 Nicolas Viéville nicolas.vieville@uphf.fr - 3:390.157-11

  • Add patch for kernel >= 6.10 - RFBZ#7022
  • Fix warning: suggest braces around empty body in an ‘if’ statement
  • Fix warning: old style declaration

if you still have the nvidia drivers installed then you can download the rpm package from the website and install with

sudo dnf upgrade  ./akmod-nvidia-390xx-390.157-11.fc40.x86_64.rpm

or enable the testingrepo for this transaction and let dnf fetch the rpm as usual

sudo dnf upgrade akmod-nvidia-390xx  --enablerepo=rpmfusion-nonfree-updates-testing

I tried this, it worked but after rebooting half of my screen was blank. I could see just my cursor on the blank half. I removed the drivers.

did you wait long enough with the reboot so that the system can create the kernel modules first?

the package name would be kmod-nvidia-$(uname -r) (or kmod-nvidia-390xx-$(uname -r) ?)
and the version should match the installed akmod-nvidia-390xx package
e.g. on my system are available

rpm -qa kmod-nvidia-$(uname -r) akmods-nvidia
akmod-nvidia-560.35.03-1.fc40.x86_64
kmod-nvidia-6.10.6-200.fc40.x86_64-560.35.03-1.fc40.x86_64

you can also list available modules with sudo akmods
and rebuilt if needed with sudo akmods --rebuild
which each kernel update a new kmod-nvidia-(new kernel version) will be created.

rpm -qa kmod-nvidia\*
kmod-nvidia-6.10.5-200.fc40.x86_64-560.35.03-1.fc40.x86_64
kmod-nvidia-6.10.6-200.fc40.x86_64-560.35.03-1.fc40.x86_64

of it still fails, please report this to https://bugzilla.rpmfusion.org/

Sorry seems a bit complicated to me at first glance. I’m doing it like this.

does it seem right?

yes. Let it install and do not reboot.
You should now see new lines written to akmods.log.

tail -f /var/log/akmods/akmods.log

or you can also find compile processes in top.
Wait for a few minutes. After process has finished, rpm -qa kmod-\* should list the newly created kernel modules package.

You can also check with sudo akmods

$ sudo  akmods 
Checking kmods exist for 6.10.6-200.fc40.x86_64            [  OK  ]

Please post terminal output as text, not images. Text allows others to find this topic with web searches, so may help others with similar issues find your post and often leads to quicker solutions per Linus’s Law

It is workings this time now, as you said I just gave it more time to build. The screen froze so I check in TTY if the process was finished or not. after that I restarted gdm and back to login screen. now it seems to have loaded the GPU. But can you tell me how to vesionlock it so the next time the kernel is updated, it doesn’t remove the drivers?

1 Like

❯ tail -f /var/log/akmods/akmods.log
2024/08/25 10:58:24 akmods: ‘/usr/sbin/akmods --force’ as root.
2024/08/25 14:42:37 akmods: Checking kmods exist for 6.10.6-200.fc40.x86_64
2024/08/25 14:42:39 akmods: Building and installing nvidia-390xx-kmod
2024/08/25 14:42:39 akmods: Building RPM using the command ‘/usr/sbin/akmodsbuild --kernels 6.10.6-200.fc40.x86_64 /usr/src/akmods/nvidia-390xx-kmod.latest’
2024/08/25 15:52:08 akmods: Checking kmods exist for 6.10.6-200.fc40.x86_64
2024/08/25 15:52:08 akmods: Building and installing nvidia-390xx-kmod
2024/08/25 15:52:09 akmods: Building RPM using the command ‘/usr/sbin/akmodsbuild --kernels 6.10.6-200.fc40.x86_64 /usr/src/akmods/nvidia-390xx-kmod.latest’
2024/08/25 15:55:24 akmods: Installing newly built rpms
2024/08/25 15:55:25 akmods: DNF detected
2024/08/25 15:59:20 akmods: Successful.

Installing the akmod-nvidia drivers then doing a kernel update later should never remove the drivers although rebooting too quickly can prevent proper installation of the newer drivers.

After doing the kernel update you must wait an adequate time for the new modules to be compiled and installed before rebooting (5 minutes is commonly recommended)

You can check if the new modules are installed with dnf list installed kmod-nvidia* and verify that the one for the newest kernel is shown before rebooting. This ensures that the new modules will be able to load when you reboot.

That is a very poor suggestion when dealing with the 390xx nvidia driver.

ALL nvidia drivers, version 470 and older, will only support the X11 DE. Wayland is not possible with any nvidia driver other than the current version.

You always need do give the system time to finish building the modules for the new kernel. A dnf versionlock will not help here.

Either check with rpm for a new kmod-nvidia package,
or check the akmods.log file etc.

check the the output of rpm -qa kmod-nvidia\* now
with the next kernel update a 2nd package will be build for the new kernel. etc.

But sometime after a major kernel update I’m prompted that removing old kernel packages would remove the nvidia drivers

When you have the normal 3 kernels installed and the drivers available for all kernels then removing the oldest kernel for installing a new one will always remove the dependent packages. In this case it is the nvidia driver that is specifically related to the kernel being removed and NOT the entire driver package.

Simply look at the name (version) of the kernel being removed and the name of the kmod-nvidia-(kernel version) package being removed and you would be able to see they are related.

Removing that old and no longer needed driver package is 100% normal.

2 Likes

May I suggest that if that happens you’ll open a new topic so we can look at it?

A kernel upgrade should not request the removal of the xorg-x11-drv-nvidia* packages, unless there is something wrong with the dependencies.

What will be removed is the kmod-nvidia package for the old kernel.

can you please post the outputs of these commands
rpm -qa kernel\*
rpm -qa xorg-x11-drv-nvidia\* kmod-nvidia\*
rpm -qa nvidia\*

copy and paste as preformatted text " </> ".

❯ rpm -qa kernel\*
kernel-srpm-macros-1.0-23.fc40.noarch
kernel-headers-6.10.3-200.fc40.x86_64
kernel-modules-core-6.10.4-200.fc40.x86_64
kernel-core-6.10.4-200.fc40.x86_64
kernel-modules-6.10.4-200.fc40.x86_64
kernel-devel-6.10.4-200.fc40.x86_64
kernel-6.10.4-200.fc40.x86_64
kernel-modules-extra-6.10.4-200.fc40.x86_64
kernel-modules-core-6.10.5-200.fc40.x86_64
kernel-core-6.10.5-200.fc40.x86_64
kernel-modules-6.10.5-200.fc40.x86_64
kernel-devel-6.10.5-200.fc40.x86_64
kernel-6.10.5-200.fc40.x86_64
kernel-modules-extra-6.10.5-200.fc40.x86_64
kernel-modules-core-6.10.6-200.fc40.x86_64
kernel-core-6.10.6-200.fc40.x86_64
kernel-modules-6.10.6-200.fc40.x86_64
kernel-devel-6.10.6-200.fc40.x86_64
kernel-devel-matched-6.10.6-200.fc40.x86_64
kernel-6.10.6-200.fc40.x86_64
kernel-modules-extra-6.10.6-200.fc40.x86_64

❯ rpm -qa xorg-x11-drv-nvidia\* kmod-nvidia\*
xorg-x11-drv-nvidia-390xx-kmodsrc-390.157-4.fc40.x86_64
xorg-x11-drv-nvidia-390xx-libs-390.157-4.fc40.i686
xorg-x11-drv-nvidia-390xx-libs-390.157-4.fc40.x86_64
xorg-x11-drv-nvidia-390xx-390.157-4.fc40.x86_64
kmod-nvidia-390xx-6.10.6-200.fc40.x86_64-390.157-11.fc40.x86_64

❯ rpm -qa nvidia\*
nvidia-settings-390xx-390.157-3.fc40.x86_64

Let’s see what dnf will want to remove when we try to erase the oldest kernel. Copy the output and deny the transaction.

sudo dnf remove kernel-core-6.10.4-200.fc40.x86_64 kernel-devel-6.10.4-200.fc40.x86_64

❯ sudo dnf remove kernel-core-6.10.4-200.fc40.x86_64 kernel-devel-6.10.4-200.fc40.x86_64
[sudo] password for pandathepie: 
Dependencies resolved.
================================================================================
 Package                   Arch        Version              Repository     Size
================================================================================
Removing:
 kernel-core               x86_64      6.10.4-200.fc40      @updates       69 M
 kernel-devel              x86_64      6.10.4-200.fc40      @updates       71 M
Removing dependent packages:
 kernel                    x86_64      6.10.4-200.fc40      @updates        0  
 kernel-modules            x86_64      6.10.4-200.fc40      @updates       62 M
 kernel-modules-core       x86_64      6.10.4-200.fc40      @updates       36 M
 kernel-modules-extra      x86_64      6.10.4-200.fc40      @updates      2.7 M

Transaction Summary
================================================================================
Remove  6 Packages

Freed space: 241 M
Is this ok [y/N]: 

This time it doesn’t. Maybe I’m wrong. I’ll make another topic when this happens to me. can’t recreate it right now

this looks good. The only package missing on this list is the kmod-nvidia package for this specific kernel version, because the system did not create any. Only for the newest kernel.

There is no matching kmod-nvidia package for the 6.10.4 kernel so it did not try and remove it.
You can test my statement that it only removes the matching kmod-nvidia package by first creating that package.
sudo akmods --kernels 6.10.4-200.fc40.x86_64 which should create the matching kmod-nvidia package for the indicated kernel.

Verify the package was created and installed with dnf list installed kmod-nvidia*

Then repeat the test of removal with sudo dnf remove kernel*6.10.4* and look for the kmod-nvidia package it wants to remove. Again, do not actually remove it, but the only nvidia package shown should be the kmod-nvidia package matching the 6.10.4 kernel