0

I just updated my linux kernel to 5.12 for hardware support and ran into a few bugs. I've squashed most of them, but I can't install the nvidia drivers anymore. I originally used version 460, but when that failed I tried installing 465 and got the same issue. Here's the output of apt install nvidia-driver-465 (after purging all nvidia packages):

Reading package lists... Done
Building dependency tree       
Reading state information... Done
The following additional packages will be installed:
  nvidia-compute-utils-465 nvidia-dkms-465 nvidia-kernel-common-465 nvidia-kernel-source-465 nvidia-prime nvidia-settings nvidia-utils-465
The following NEW packages will be installed:
  nvidia-compute-utils-465 nvidia-dkms-465 nvidia-driver-465 nvidia-kernel-common-465 nvidia-kernel-source-465 nvidia-prime nvidia-settings nvidia-utils-465
0 upgraded, 8 newly installed, 0 to remove and 0 not upgraded.
Need to get 44.6 MB/44.6 MB of archives.
After this operation, 97.2 MB of additional disk space will be used.
Do you want to continue? [Y/n] y
Get:1 http://ppa.launchpad.net/graphics-drivers/ppa/ubuntu bionic/main amd64 nvidia-compute-utils-465 amd64 465.27-0ubuntu0.18.04.2 [105 kB]
Get:2 http://ppa.launchpad.net/graphics-drivers/ppa/ubuntu bionic/main amd64 nvidia-kernel-source-465 amd64 465.27-0ubuntu0.18.04.2 [24.9 MB]
Get:3 http://ppa.launchpad.net/graphics-drivers/ppa/ubuntu bionic/main amd64 nvidia-kernel-common-465 amd64 465.27-0ubuntu0.18.04.2 [17.9 MB]
Get:4 http://ppa.launchpad.net/graphics-drivers/ppa/ubuntu bionic/main amd64 nvidia-dkms-465 amd64 465.27-0ubuntu0.18.04.2 [28.4 kB]
Get:5 http://ppa.launchpad.net/graphics-drivers/ppa/ubuntu bionic/main amd64 nvidia-utils-465 amd64 465.27-0ubuntu0.18.04.2 [367 kB]
Get:6 http://ppa.launchpad.net/graphics-drivers/ppa/ubuntu bionic/main amd64 nvidia-driver-465 amd64 465.27-0ubuntu0.18.04.2 [435 kB]
Get:7 http://ppa.launchpad.net/graphics-drivers/ppa/ubuntu bionic/main amd64 nvidia-settings amd64 460.73.01-0ubuntu0.18.04.1 [880 kB]                                  
Fetched 44.6 MB in 7s (6,062 kB/s)                                                                                                                                      
Selecting previously unselected package nvidia-compute-utils-465.
(Reading database ... 249004 files and directories currently installed.)
Preparing to unpack .../0-nvidia-compute-utils-465_465.27-0ubuntu0.18.04.2_amd64.deb ...
Unpacking nvidia-compute-utils-465 (465.27-0ubuntu0.18.04.2) ...
Selecting previously unselected package nvidia-kernel-source-465.
Preparing to unpack .../1-nvidia-kernel-source-465_465.27-0ubuntu0.18.04.2_amd64.deb ...
Unpacking nvidia-kernel-source-465 (465.27-0ubuntu0.18.04.2) ...
Selecting previously unselected package nvidia-kernel-common-465.
Preparing to unpack .../2-nvidia-kernel-common-465_465.27-0ubuntu0.18.04.2_amd64.deb ...
Unpacking nvidia-kernel-common-465 (465.27-0ubuntu0.18.04.2) ...
Selecting previously unselected package nvidia-dkms-465.
Preparing to unpack .../3-nvidia-dkms-465_465.27-0ubuntu0.18.04.2_amd64.deb ...
Unpacking nvidia-dkms-465 (465.27-0ubuntu0.18.04.2) ...
Selecting previously unselected package nvidia-utils-465.
Preparing to unpack .../4-nvidia-utils-465_465.27-0ubuntu0.18.04.2_amd64.deb ...
Unpacking nvidia-utils-465 (465.27-0ubuntu0.18.04.2) ...
Selecting previously unselected package nvidia-driver-465.
Preparing to unpack .../5-nvidia-driver-465_465.27-0ubuntu0.18.04.2_amd64.deb ...
Unpacking nvidia-driver-465 (465.27-0ubuntu0.18.04.2) ...
Selecting previously unselected package nvidia-prime.
Preparing to unpack .../6-nvidia-prime_0.8.16~0.18.04.1_all.deb ...
Unpacking nvidia-prime (0.8.16~0.18.04.1) ...
Selecting previously unselected package nvidia-settings.
Preparing to unpack .../7-nvidia-settings_460.73.01-0ubuntu0.18.04.1_amd64.deb ...
Unpacking nvidia-settings (460.73.01-0ubuntu0.18.04.1) ...
Setting up nvidia-prime (0.8.16~0.18.04.1) ...
Setting up nvidia-utils-465 (465.27-0ubuntu0.18.04.2) ...
Setting up nvidia-kernel-common-465 (465.27-0ubuntu0.18.04.2) ...
update-initramfs: deferring update (trigger activated)
Created symlink /etc/systemd/system/systemd-hibernate.service.requires/nvidia-hibernate.service → /lib/systemd/system/nvidia-hibernate.service.
Created symlink /etc/systemd/system/systemd-suspend.service.requires/nvidia-resume.service → /lib/systemd/system/nvidia-resume.service.
Created symlink /etc/systemd/system/systemd-hibernate.service.requires/nvidia-resume.service → /lib/systemd/system/nvidia-resume.service.
Created symlink /etc/systemd/system/systemd-suspend.service.requires/nvidia-suspend.service → /lib/systemd/system/nvidia-suspend.service.
Setting up nvidia-settings (460.73.01-0ubuntu0.18.04.1) ...
Setting up nvidia-compute-utils-465 (465.27-0ubuntu0.18.04.2) ...
Warning: The home directory /nonexistent you specified can not be accessed: No such file or directory
Adding system user `nvidia-persistenced' (UID 122) ...
Adding new group `nvidia-persistenced' (GID 129) ...
Adding new user `nvidia-persistenced' (UID 122) with group `nvidia-persistenced' ...
Not creating home directory `/nonexistent'.
Setting up nvidia-kernel-source-465 (465.27-0ubuntu0.18.04.2) ...
Setting up nvidia-dkms-465 (465.27-0ubuntu0.18.04.2) ...
update-initramfs: deferring update (trigger activated)
INFO:Enable nvidia
DEBUG:Parsing /usr/share/ubuntu-drivers-common/quirks/dell_latitude
DEBUG:Parsing /usr/share/ubuntu-drivers-common/quirks/put_your_quirks_here
DEBUG:Parsing /usr/share/ubuntu-drivers-common/quirks/lenovo_thinkpad
Loading new nvidia-465.27 DKMS files...
Building for 5.12.4-051204-generic
Building for architecture x86_64
Building initial module for 5.12.4-051204-generic
Error! Bad return status for module build on kernel: 5.12.4-051204-generic (x86_64)
Consult /var/lib/dkms/nvidia/465.27/build/make.log for more information.
Setting up nvidia-driver-465 (465.27-0ubuntu0.18.04.2) ...
Processing triggers for desktop-file-utils (0.23-1ubuntu3.18.04.2+elementary2~ubuntu5.0.1) ...
Processing triggers for bamfdaemon (0.5.3+18.04.20180207.2-0ubuntu1) ...
Rebuilding /usr/share/applications/bamf-2.index...
Processing triggers for libc-bin (2.27-3ubuntu1.4) ...
Processing triggers for man-db (2.8.3-2ubuntu0.1) ...
Processing triggers for gnome-menus (3.13.3-11ubuntu1.1) ...
Processing triggers for mime-support (3.60ubuntu1) ...
Processing triggers for initramfs-tools (0.130ubuntu3.12) ...
update-initramfs: Generating /boot/initrd.img-5.12.4-051204-generic

The make log it references contains the following:

DKMS make.log for nvidia-465.27 for kernel 5.12.4-051204-generic (x86_64)
Wed May 19 01:44:22 EDT 2021
make[1]: Entering directory '/usr/src/linux-headers-5.12.4-051204-generic'
make[1]: Makefile: No such file or directory
make[1]: *** No rule to make target 'Makefile'.  Stop.
make[1]: Leaving directory '/usr/src/linux-headers-5.12.4-051204-generic'
Makefile:80: recipe for target 'modules' failed
make: *** [modules] Error 2

Some additional commands that might help:

dmsg | grep nvidia and lsmod | grep nvidia both return nothing.

$ modprobe nvidia gives: modprobe: FATAL: Module nvidia not found in directory /lib/modules/5.12.4-051204-generic

Please let me know if there's anything else I can run that would shine more light on where the issue is. Thanks!

Edit: I ended up building kernel 5.11 from source, which has worked perfectly. I won't be able to test any solutions, but I'll leave the question open in case anyone in the future runs into something similar.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.