pop-os / pop

A project for managing all Pop!_OS sources
https://system76.com/pop
2.48k stars 87 forks source link

NVIDIA driver 390 does not install or build with kernel 5.11.0 #1639

Open PanderMusubi opened 3 years ago

PanderMusubi commented 3 years ago

Distribution (run cat /etc/os-release):

NAME="Pop!_OS"
VERSION="20.10"
ID=pop
ID_LIKE="ubuntu debian"
PRETTY_NAME="Pop!_OS 20.10"
VERSION_ID="20.10"
HOME_URL="https://pop.system76.com"
SUPPORT_URL="https://support.system76.com"
BUG_REPORT_URL="https://github.com/pop-os/pop/issues"
PRIVACY_POLICY_URL="https://system76.com/privacy"
VERSION_CODENAME=groovy
UBUNTU_CODENAME=groovy
LOGO=distributor-logo-pop-os

Related Application and/or Package Version (run apt policy $PACKAGE NAME):

nvidia-driver-390 and nvidia-dkms-390

Issue/Bug Description:

Loading new nvidia-390.141 DKMS files...
Building for 5.11.0-7612-generic
Building for architecture x86_64
Building initial module for 5.11.0-7612-generic
ERROR (dkms apport): kernel package linux-headers-5.11.0-7612-generic is not supported
Error! Bad return status for module build on kernel: 5.11.0-7612-generic (x86_64)
Consult /var/lib/dkms/nvidia/390.141/build/make.log for more information.
dpkg: error processing package nvidia-dkms-390 (--configure):
 installed nvidia-dkms-390 package post-installation script subprocess returned error exit status 10
dpkg: dependency problems prevent configuration of nvidia-driver-390:
 nvidia-driver-390 depends on nvidia-dkms-390 (<= 390.141-1); however:
  Package nvidia-dkms-390 is not configured yet.
 nvidia-driver-390 depends on nvidia-dkms-390 (>= 390.141); however:
  Package nvidia-dkms-390 is not configured yet.

dpkg: error processing package nvidia-driver-390 (--configure):
 dependency problems - leaving unconfigured
No apport report written because the error message indicates its a followup error from a previous failure.

From /var/lib/dkms/nvidia/390.141/build/make.log:

DKMS make.log for nvidia-390.141 for kernel 5.11.0-7612-generic (x86_64)
Sun Apr 11 01:59:21 PM CEST 2021
make[1]: Entering directory '/usr/src/linux-headers-5.11.0-7612-generic'
test -e include/generated/autoconf.h -a -e include/config/auto.conf || (        \
echo >&2;                           \
echo >&2 "  ERROR: Kernel configuration is invalid.";       \
echo >&2 "         include/generated/autoconf.h or include/config/auto.conf are missing.";\
echo >&2 "         Run 'make oldconfig && make prepare' on kernel src to fix it.";  \
echo >&2 ;                          \
/bin/false)
make -f ./scripts/Makefile.build obj=/var/lib/dkms/nvidia/390.141/build \
single-build= \
need-builtin=1 need-modorder=1
scripts/Makefile.lib:8: 'always' is deprecated. Please use 'always-y' instead
  ln -sf /var/lib/dkms/nvidia/390.141/build/nvidia/nv-kernel.o_binary /var/lib/dkms/nvidia/390.141/build/nvidia/nv-kernel.o
  ln -sf /var/lib/dkms/nvidia/390.141/build/nvidia-modeset/nv-modeset-kernel.o_binary /var/lib/dkms/nvidia/390.141/build/nvidia-modeset/nv-modeset-kernel.o
...
In file included from /var/lib/dkms/nvidia/390.141/build/nvidia/nv-instance.c:13:
/var/lib/dkms/nvidia/390.141/build/common/inc/nv-linux.h:118:10: fatal error: asm/kmap_types.h: No such file or directory
  118 | #include <asm/kmap_types.h>         /* page table entry lookup          */
      |          ^~~~~~~~~~~~~~~~~~
compilation terminated.
make[2]: *** [scripts/Makefile.build:287: /var/lib/dkms/nvidia/390.141/build/nvidia/nv-instance.o] Error 1
make[2]: *** Waiting for unfinished jobs....
In file included from /var/lib/dkms/nvidia/390.141/build/nvidia/nv.c:13:
/var/lib/dkms/nvidia/390.141/build/common/inc/nv-linux.h:118:10: fatal error: asm/kmap_types.h: No such file or directory
  118 | #include <asm/kmap_types.h>         /* page table entry lookup          */
      |          ^~~~~~~~~~~~~~~~~~
compilation terminated.
In file included from /var/lib/dkms/nvidia/390.141/build/nvidia/nv-frontend.c:13:
/var/lib/dkms/nvidia/390.141/build/common/inc/nv-linux.h:118:10: fatal error: asm/kmap_types.h: No such file or directory
  118 | #include <asm/kmap_types.h>         /* page table entry lookup          */
      |          ^~~~~~~~~~~~~~~~~~
compilation terminated.
make[2]: *** [scripts/Makefile.build:287: /var/lib/dkms/nvidia/390.141/build/nvidia/nv.o] Error 1
make[2]: *** [scripts/Makefile.build:287: /var/lib/dkms/nvidia/390.141/build/nvidia/nv-frontend.o] Error 1
In file included from /var/lib/dkms/nvidia/390.141/build/nvidia/nv-gpu-numa.c:24:
/var/lib/dkms/nvidia/390.141/build/common/inc/nv-linux.h:118:10: fatal error: asm/kmap_types.h: No such file or directory
  118 | #include <asm/kmap_types.h>         /* page table entry lookup          */
      |          ^~~~~~~~~~~~~~~~~~
compilation terminated.
In file included from /var/lib/dkms/nvidia/390.141/build/nvidia/nv-acpi.c:15:
/var/lib/dkms/nvidia/390.141/build/common/inc/nv-linux.h:118:10: fatal error: asm/kmap_types.h: No such file or directory
  118 | #include <asm/kmap_types.h>         /* page table entry lookup          */
      |          ^~~~~~~~~~~~~~~~~~
compilation terminated.
make[2]: *** [scripts/Makefile.build:287: /var/lib/dkms/nvidia/390.141/build/nvidia/nv-gpu-numa.o] Error 1
In file included from /var/lib/dkms/nvidia/390.141/build/nvidia/nv-chrdev.c:15:
/var/lib/dkms/nvidia/390.141/build/common/inc/nv-linux.h:118:10: fatal error: asm/kmap_types.h: No such file or directory
  118 | #include <asm/kmap_types.h>         /* page table entry lookup          */
      |          ^~~~~~~~~~~~~~~~~~
    compilation terminated.    
make[2]: *** [scripts/Makefile.build:287: /var/lib/dkms/nvidia/390.141/build/nvidia/nv-acpi.o] Error 1
make[2]: *** [scripts/Makefile.build:287: /var/lib/dkms/nvidia/390.141/build/nvidia/nv-chrdev.o] Error 1
make[1]: *** [Makefile:1834: /var/lib/dkms/nvidia/390.141/build] Error 2
make[1]: Leaving directory '/usr/src/linux-headers-5.11.0-7612-generic'
make: *** [Makefile:81: modules] Error 2

Steps to reproduce (if you know):

upgrading to latest kernel while nvidia-dkms-390 and nvidia-driver-390 were installed under kernel 5.8.0 or:

Expected behavior:

driver installs correctly and allow usage of screen on normal/high resolutions

Other Notes:

See also https://github.com/pop-os/pop/issues/1443

PanderMusubi commented 3 years ago

Does NVIDIA need to release a new build. According to the latest build, they did some work to make the driver run on 5.8.0 https://www.nvidia.com/en-us/drivers/results/168290/

PanderMusubi commented 3 years ago

Meanwhile, installing for 5.8.0 no longer works. Workaround is to deinstall all NVIDIA 390 packages, install libglvnd-dev and run NVIDIA-Linux-x86_64-390.141.run from the link above. Do not install for DKMS.

PanderMusubi commented 3 years ago

(And you need e.g. grub-customizer to boot by default from 5.8 as 5.11 cannot be uninstalled.)

PanderMusubi commented 3 years ago

Also reported at NVIDIA as https://forums.developer.nvidia.com/t/driver-390-141-does-not-build-with-kernel-5-11/174816

Spicysauced commented 3 years ago

If youre running this driver because your card is too old to be supported by a newer driver, I guess youre out of luck. The 390 driver is "legacy" from 2018 and wont be officially patched by NVidia anymore. There is this patch you might apply, but I have never done that myself, so I dont know if it works. Be adviced that in general, NVidia likes to drop support for older cards in newer driver releases, as the mechanics how drivers work in Linux plays into their hands. Kernel, driver, X and Mesa (for AMD) have to be "in sync", meaning they have to be compatible to each other. After 5 or so years its easy for Nvidia to say okay, lets drop support, while on Windows card support is much longer and even if not, you could install legacy driver as they arent "linked" to other system components. As an example you could still run a GTX 460 with a driver from 2012 on a fully up to date Windows 10 install, in Linux, this is not possible. Currently it looks like AMD is the way to go for Linux, as their driver is baked into the kernel and almost fully open source.

PanderMusubi commented 3 years ago

Thanks. According to their driver download website the card is not yet legacy. Pinning the machine to boot 5.8.0 makes it still usable.

What is the best way to keeps this supported as long as possible with mininal effort? Report it also at kernel developers or Ububtu maintainers?

Spicysauced commented 3 years ago

Thanks. According to their driver download website the card is not yet legacy. Pinning the machine to boot 5.8.0 makes it still usable.

What is the best way to keeps this supported as long as possible with mininal effort? Report it also at kernel developers or Ububtu maintainers?

Neither. This is an NVidia thing. If they decide to drop support, theres nothing that can be done besides unofficial hacks. Support, also the unofficial one, WILL eventually subside. Options:

PanderMusubi commented 3 years ago

Thanks. Usually I have AMD. This was a donated card that still works fine. Will try at NVIDIA again. Would reduce the amount of ewaste if they build a driver for 5.11. Last time they build this one for 5.8 was in January, so may have some change.

PanderMusubi commented 3 years ago

Note for self: https://forums.developer.nvidia.com/t/driver-390-needs-a-build-for-kernel-5-11/175579

Spicysauced commented 3 years ago

Me again. Check this. The guy has helped many people with older nvidia hardware. I googled again because I couldnt believe theres not way to do it. The site is a little .. cluttered, but provides all info about how to make 390 work with current kernels. Hell its even possible to get an old 8800 GT from 2007 working with kernel 5.11. Kinda amazing.

PanderMusubi commented 3 years ago

Me again too ;-) Thanks, will check it.

Could not resist looking into Ubuntu and guess what, Ubuntu just published a patch on the 14th of April, see https://launchpad.net/ubuntu/+source/nvidia-graphics-drivers-390/390.141-0ubuntu0.20.10.2 If this solves all issues, I still have to test. Info in changelog is very relevant.

PanderMusubi commented 3 years ago

Should this issue be moved to https://github.com/pop-os/nvidia-graphics-drivers/issues ?

akmalkadi commented 2 years ago

Me again. Check this. The guy has helped many people with older nvidia hardware. I googled again because I couldnt believe theres not way to do it. The site is a little .. cluttered, but provides all info about how to make 390 work with current kernels. Hell its even possible to get an old 8800 GT from 2007 working with kernel 5.11. Kinda amazing.

Thanks! This helped me alot to install 390 to my machine for nvidia310