Score:0

nvidia modules failing when installing linux-image-5.4.0-96-generic

ru flag

After installing the most recent kernels my system can no longer start the nvidia daemon. A closer inspection shows that NVIDIA modules are missing for linux-image-5.4.0-96-generic:

sudo apt-get install --reinstall linux-image-generic linux-image-5.4.0-96-generic linux-headers-5.4.0-96-generic
Reading package lists... Done
Building dependency tree       
Reading state information... Done
The following packages were automatically installed and are no longer required:
  android-studio-4.1 cuda-command-line-tools-10-2 cuda-compiler-10-2 cuda-cudart-10-2 cuda-cudart-dev-10-2 cuda-cufft-10-2 cuda-cufft-dev-10-2 cuda-cupti-10-2 cuda-cupti-dev-10-2 cuda-curand-10-2
  cuda-curand-dev-10-2 cuda-cusolver-10-2 cuda-cusolver-dev-10-2 cuda-cusparse-10-2 cuda-cusparse-dev-10-2 cuda-documentation-10-2 cuda-driver-dev-10-2 cuda-libraries-10-2 cuda-libraries-dev-10-2
  cuda-memcheck-10-2 cuda-misc-headers-10-2 cuda-npp-10-2 cuda-npp-dev-10-2 cuda-nsight-10-2 cuda-nsight-compute-10-2 cuda-nsight-systems-10-2 cuda-nvcc-10-2 cuda-nvgraph-10-2 cuda-nvgraph-dev-10-2
  cuda-nvjpeg-10-2 cuda-nvjpeg-dev-10-2 cuda-nvml-dev-10-2 cuda-nvprof-10-2 cuda-nvprune-10-2 cuda-nvrtc-10-2 cuda-nvrtc-dev-10-2 cuda-nvtx-10-2 cuda-nvvp-10-2 cuda-samples-10-2 cuda-sanitizer-api-10-2
  cuda-toolkit-10-2 cuda-tools-10-2 cuda-visual-tools-10-2 golang-1.15-go golang-1.15-src golang-1.16-go golang-1.16-src lib32gcc1 libcublas-dev libcublas10 libllvm10:i386 libllvm11 libllvm11:i386
  libmysofa0 libplacebo18 libuv1-dev libxdamage1:i386 nsight-compute-2019.5.0 nsight-systems-2019.5.2 nvidia-modprobe shim
Use 'sudo apt autoremove' to remove them.
0 upgraded, 0 newly installed, 3 reinstalled, 0 to remove and 2 not upgraded.
Need to get 0 B/11.9 MB of archives.
After this operation, 0 B of additional disk space will be used.
(Reading database ... 438750 files and directories currently installed.)
Preparing to unpack .../linux-headers-5.4.0-96-generic_5.4.0-96.109_amd64.deb ...
Unpacking linux-headers-5.4.0-96-generic (5.4.0-96.109) over (5.4.0-96.109) ...
Preparing to unpack .../linux-image-5.4.0-96-generic_5.4.0-96.109_amd64.deb ...
Unpacking linux-image-5.4.0-96-generic (5.4.0-96.109) over (5.4.0-96.109) ...
Preparing to unpack .../linux-image-generic_5.4.0.96.100_amd64.deb ...
Unpacking linux-image-generic (5.4.0.96.100) over (5.4.0.96.100) ...
Setting up linux-headers-5.4.0-96-generic (5.4.0-96.109) ...
/etc/kernel/header_postinst.d/dkms:
 * dkms: running auto installation service for kernel 5.4.0-96-generic
   ...done.
Setting up linux-image-5.4.0-96-generic (5.4.0-96.109) ...
depmod: ERROR: failed to load symbols from /lib/modules/5.4.0-96-generic/updates/dkms/nvidia-modeset.ko: Invalid argument
depmod: ERROR: failed to load symbols from /lib/modules/5.4.0-96-generic/updates/dkms/nvidia-drm.ko: Invalid argument
depmod: ERROR: failed to load symbols from /lib/modules/5.4.0-96-generic/updates/dkms/nvidia-uvm.ko: Invalid argument
depmod: ERROR: failed to load symbols from /lib/modules/5.4.0-96-generic/updates/dkms/nvidia.ko: Invalid argument
Setting up linux-image-generic (5.4.0.96.100) ...
Processing triggers for linux-image-5.4.0-96-generic (5.4.0-96.109) ...
/etc/kernel/postinst.d/dkms:
 * dkms: running auto installation service for kernel 5.4.0-96-generic
   ...done.
/etc/kernel/postinst.d/initramfs-tools:
update-initramfs: Generating /boot/initrd.img-5.4.0-96-generic
modinfo: ERROR: could not get modinfo from 'nvidia': Invalid argument
modinfo: ERROR: could not get modinfo from 'nvidia_drm': Invalid argument
modinfo: ERROR: could not get modinfo from 'nvidia_modeset': Invalid argument
modinfo: ERROR: could not get modinfo from 'nvidia_uvm': Invalid argument
depmod: ERROR: failed to load symbols from /var/tmp/mkinitramfs_cIT7Rf/lib/modules/5.4.0-96-generic/updates/dkms/nvidia-modeset.ko: Invalid argument
depmod: ERROR: failed to load symbols from /var/tmp/mkinitramfs_cIT7Rf/lib/modules/5.4.0-96-generic/updates/dkms/nvidia-drm.ko: Invalid argument
depmod: ERROR: failed to load symbols from /var/tmp/mkinitramfs_cIT7Rf/lib/modules/5.4.0-96-generic/updates/dkms/nvidia-uvm.ko: Invalid argument
depmod: ERROR: failed to load symbols from /var/tmp/mkinitramfs_cIT7Rf/lib/modules/5.4.0-96-generic/updates/dkms/nvidia.ko: Invalid argument
/etc/kernel/postinst.d/zz-update-grub:
Sourcing file `/etc/default/grub'
Sourcing file `/etc/default/grub.d/init-select.cfg'
Generating grub configuration file ...
Found linux image: /boot/vmlinuz-5.4.0-1061-oracle
Found initrd image: /boot/initrd.img-5.4.0-1061-oracle
Found linux image: /boot/vmlinuz-5.4.0-96-generic
Found initrd image: /boot/initrd.img-5.4.0-96-generic
Found linux image: /boot/vmlinuz-5.4.0-94-generic
Found initrd image: /boot/initrd.img-5.4.0-94-generic
Adding boot menu entry for UEFI Firmware Settings
done

To get around this I'm currently just running on 5.4.0-94-generic. Is anyone else running into this issue? Should I just wait for the next update?

Additional info per comments

  • I am running Ubuntu 20.04.3.
  • sudo apt-get update and sudo apt-get upgrade are all up-to-date.
  • The latest NVIDIA driver I have installed is nvidia-driver-495.
Pilot6 avatar
cn flag
Are you using Ubuntu? Which release? What are the Nvidia drivers?
in flag
The 5.4 kernel was released some time ago. Which version of Ubuntu are you running?
ru flag
Updated Ubuntu version to the end of question details.
kn flag
Is your ubuntu system updated? Please check for updates and make sure that you're running the **latest** version of ubuntu. Then try again.
in flag
20.04.3 uses the 5.11 kernel. Are you intentionally installing an older kernel? Perhaps I’m misunderstanding the goal of the question …
Pilot6 avatar
cn flag
@matigo 20.04 uses both 5.4 and 5.13 now. It depends on HWE stack.
Score:2
my flag

Hmm... Seems like your dkms files for NVIDIA are corrupted. Try following these steps:

  1. Remove the dkms file for NVIDIA.

    sudo rm -r /var/lib/dkms/nvidia
    
  2. Reinstall dkms to regenerate the file:

    sudo apt install --reinstall dkms
    
  3. Purge the Nvidia drivers:

    sudo apt purge nvidia-*
    
  4. Now, reinstall the recommended drivers using:

    sudo ubuntu-drivers autoinstall 
    

The above will regenerate your dkms.conf file.


  1. Reinstall the kernel packages:

    sudo apt update
    sudo apt-get install --reinstall linux-image-generic linux-image-5.4.0-96-generic linux-headers-5.4.0-96-generic linux-generic
    
  2. Update Grub:

    sudo update-grub
    
  3. Update Initramfs:

    sudo update-initramfs -u
    

That's it!
Good luck!

ru flag
Have to say I was skeptical at first. But this did it!
Someone avatar
my flag
@Cescante Awesome! Glad it's working as expected. Have fun!
user272901 avatar
br flag
For the record, "ubuntu-drivers autoinstall" caused my desktop to go black... ssh'ing remotely showed some kind of 100% CPU lockup happening... couldn't break out of it and had to restore from a backup. Maybe it would be safer to run this from a CLI without the desktop loaded?
mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.