Having trouble installing CUDA 11.2 on Ubuntu20.04 (kernel 5.11.5). Nvidia driver unsupported?

Hi,

I am having trouble installing CUDA 11.2 according to these instructions and this download.

After following all the Pre-installation Actions, followed by the Package Manager Installtion for Ubuntu (chapter 3.8), I get the following error after running: $ sudo apt-get -y install cuda

INFO:Enable nvidia
DEBUG:Parsing /usr/share/ubuntu-drivers-common/quirks/put_your_quirks_here
DEBUG:Parsing /usr/share/ubuntu-drivers-common/quirks/lenovo_thinkpad
DEBUG:Parsing /usr/share/ubuntu-drivers-common/quirks/dell_latitude
Loading new nvidia-460.32.03 DKMS files...
Building for 5.11.5-051105-generic
Building for architecture x86_64
Building initial module for 5.11.5-051105-generic
ERROR (dkms apport): kernel package linux-headers-5.11.5-051105-generic is not supported
Error! Bad return status for module build on kernel: 5.11.5-051105-generic (x86_64)
Consult /var/lib/dkms/nvidia/460.32.03/build/make.log for more information.
dpkg: error processing package nvidia-dkms-460 (--configure):
 installed nvidia-dkms-460 package post-installation script subprocess returned error exit status 10
Setting up cuda-documentation-11-2 (11.2.154-1) ...
Setting up cuda-cupti-dev-11-2 (11.2.152-1) ...
dpkg: dependency problems prevent configuration of cuda-drivers-460:
 cuda-drivers-460 depends on nvidia-dkms-460 (>= 460.32.03); however:
  Package nvidia-dkms-460 is not configured yet.

dpkg: error processing package cuda-drivers-460 (--configure):
 dependency problems - leaving unconfigured
Setting up cuda-libraries-dev-11-2 (11.2.2-1) ...
No apport report written because the error message indicates its a followup error from a previous failure.
                                                                                                          dpkg: dependency problems prevent configuration of cuda-drivers:
 cuda-drivers depends on cuda-drivers-460 (= 460.32.03-1); however:
  Package cuda-drivers-460 is not configured yet.

dpkg: error processing package cuda-drivers (--configure):
 dependency problems - leaving unconfigured
dpkg: dependency problems prevent configuration of cuda-runtime-11-2:
 cuda-runtime-11-2 depends on cuda-drivers (>= 460.32.03); however:
  Package cuda-drivers is not configured yet.

dpkg: error processing package cuda-runtime-11-2 (--configure):
 dependency problems - leaving unconfigured
dpkg: dependency problems prevent configuration of nvidia-driver-460:
 nvidia-driver-460 depends on nvidia-dkms-460 (= 460.32.03-0ubuntu1); however:
  Package nvidia-dkms-460 is not configured yet.

dpkg: error processing package nvidia-driver-460 (--configure):
 dependency problems - leaving unconfigured
Setting up cuda-command-line-tools-11-2 (11.2.2-1) ...
No apport report written because the error message indicates its a followup error from a previous failure.
                                                                                                          No apport report written because MaxReports is reached already
                            No apport report written because MaxReports is reached already
                                                                                          dpkg: dependency problems prevent configuration of cuda-11-2:
 cuda-11-2 depends on cuda-runtime-11-2 (>= 11.2.2); however:
  Package cuda-runtime-11-2 is not configured yet.

dpkg: error processing package cuda-11-2 (--configure):
 dependency problems - leaving unconfigured
dpkg: dependency problems prevent configuration of cuda-demo-suite-11-2:
 cuda-demo-suite-11-2 depends on cuda-runtime-11-2; however:
  Package cuda-runtime-11-2 is not configured yet.

dpkg: error processing package cuda-demo-suite-11-2 (--configure):
 dependency problems - leaving unconfigured
No apport report written because MaxReports is reached already
                                                              No apport report written because MaxReports is reached already
                                                                                                                            No apport report written because MaxReports is reached already
                                              dpkg: dependency problems prevent configuration of cuda:
 cuda depends on cuda-11-2 (>= 11.2.2); however:
  Package cuda-11-2 is not configured yet.

dpkg: error processing package cuda (--configure):
 dependency problems - leaving unconfigured
Setting up default-jre-headless (2:1.11-72) ...
Setting up openjdk-11-jre-headless:amd64 (11.0.10+9-0ubuntu1~20.04) ...
update-alternatives: using /usr/lib/jvm/java-11-openjdk-amd64/bin/rmid to provide /usr/bin/rmid (rmid) in auto mode
update-alternatives: using /usr/lib/jvm/java-11-openjdk-amd64/bin/java to provide /usr/bin/java (java) in auto mode
update-alternatives: using /usr/lib/jvm/java-11-openjdk-amd64/bin/keytool to provide /usr/bin/keytool (keytool) in auto mode
update-alternatives: using /usr/lib/jvm/java-11-openjdk-amd64/bin/jjs to provide /usr/bin/jjs (jjs) in auto mode
update-alternatives: using /usr/lib/jvm/java-11-openjdk-amd64/bin/pack200 to provide /usr/bin/pack200 (pack200) in auto mode
update-alternatives: using /usr/lib/jvm/java-11-openjdk-amd64/bin/unpack200 to provide /usr/bin/unpack200 (unpack200) in auto mode
update-alternatives: using /usr/lib/jvm/java-11-openjdk-amd64/bin/jfr to provide /usr/bin/jfr (jfr) in auto mode
update-alternatives: using /usr/lib/jvm/java-11-openjdk-amd64/bin/rmiregistry to provide /usr/bin/rmiregistry (rmiregistry) in auto mode
update-alternatives: using /usr/lib/jvm/java-11-openjdk-amd64/lib/jexec to provide /usr/bin/jexec (jexec) in auto mode
Setting up openjdk-11-jre:amd64 (11.0.10+9-0ubuntu1~20.04) ...
Setting up default-jre (2:1.11-72) ...
Setting up ca-certificates-java (20190405ubuntu1) ...
Setting up cuda-nvvp-11-2 (11.2.152-1) ...
Setting up cuda-nsight-11-2 (11.2.152-1) ...
Setting up cuda-visual-tools-11-2 (11.2.2-1) ...
Setting up cuda-tools-11-2 (11.2.2-1) ...
Setting up cuda-toolkit-11-2 (11.2.2-1) ...
Setting alternatives
update-alternatives: using /usr/local/cuda-11.2 to provide /usr/local/cuda (cuda) in auto mode
update-alternatives: using /usr/local/cuda-11.2 to provide /usr/local/cuda-11 (cuda-11) in auto mode
Processing triggers for fontconfig (2.13.1-2ubuntu3) ...
Processing triggers for desktop-file-utils (0.24-1ubuntu3) ...
Processing triggers for mime-support (3.64ubuntu1) ...
Processing triggers for hicolor-icon-theme (0.17-2) ...
Processing triggers for gnome-menus (3.36.0-1ubuntu1) ...
Processing triggers for libc-bin (2.31-0ubuntu9.2) ...
Processing triggers for man-db (2.9.1-1) ...
Processing triggers for ca-certificates (20210119~20.04.1) ...
Updating certificates in /etc/ssl/certs...
0 added, 0 removed; done.
Running hooks in /etc/ca-certificates/update.d...

done.
done.
Processing triggers for initramfs-tools (0.136ubuntu6.4) ...
update-initramfs: Generating /boot/initrd.img-5.11.5-051105-generic
Errors were encountered while processing:
 nvidia-dkms-460
 cuda-drivers-460
 cuda-drivers
 cuda-runtime-11-2
 nvidia-driver-460
 cuda-11-2
 cuda-demo-suite-11-2
 cuda
E: Sub-process /usr/bin/dpkg returned an error code (1)

It seems the driver is unsupported for the kernel I am using, but before I downgrade my kernel to a different one, I want to know for sure that is the issue that is occuring here. Furthermore, if I have to downgrade, which kernel would you suggest for installing CUDA 11.2 ?

Here is my dkpg -l | grep nvidia output if needed:

ii  libnvidia-cfg1-460:amd64                   460.32.03-0ubuntu1                    amd64        NVIDIA binary OpenGL/GLX configuration library
ii  libnvidia-common-460                       460.32.03-0ubuntu1                    all          Shared files used by the NVIDIA libraries
ii  libnvidia-compute-460:amd64                460.32.03-0ubuntu1                    amd64        NVIDIA libcompute package
ii  libnvidia-decode-460:amd64                 460.32.03-0ubuntu1                    amd64        NVIDIA Video Decoding runtime libraries
ii  libnvidia-encode-460:amd64                 460.32.03-0ubuntu1                    amd64        NVENC Video Encoding runtime library
ii  libnvidia-extra-460:amd64                  460.32.03-0ubuntu1                    amd64        Extra libraries for the NVIDIA driver
ii  libnvidia-fbc1-460:amd64                   460.32.03-0ubuntu1                    amd64        NVIDIA OpenGL-based Framebuffer Capture runtime library
ii  libnvidia-gl-460:amd64                     460.32.03-0ubuntu1                    amd64        NVIDIA OpenGL/GLX/EGL/GLES GLVND libraries and Vulkan ICD
ii  libnvidia-ifr1-460:amd64                   460.32.03-0ubuntu1                    amd64        NVIDIA OpenGL-based Inband Frame Readback runtime library
ii  nvidia-compute-utils-460                   460.32.03-0ubuntu1                    amd64        NVIDIA compute utilities
iF  nvidia-dkms-460                            460.32.03-0ubuntu1                    amd64        NVIDIA DKMS package
iU  nvidia-driver-460                          460.32.03-0ubuntu1                    amd64        NVIDIA driver metapackage
ii  nvidia-kernel-common-460                   460.32.03-0ubuntu1                    amd64        Shared files used with the kernel module
ii  nvidia-kernel-source-460                   460.32.03-0ubuntu1                    amd64        NVIDIA kernel source package
ii  nvidia-modprobe                            460.32.03-0ubuntu1                    amd64        Load the NVIDIA kernel driver and create device files
ii  nvidia-prime                               0.8.16~0.20.04.1                      all          Tools to enable NVIDIA's Prime
ii  nvidia-settings                            460.32.03-0ubuntu1                    amd64        Tool for configuring the NVIDIA graphics driver
ii  nvidia-utils-460                           460.32.03-0ubuntu1                    amd64        NVIDIA driver support binaries
ii  screen-resolution-extra                    0.18build1                            all          Extension for the nvidia-settings control panel
ii  xserver-xorg-video-nvidia-460              460.32.03-0ubuntu1                    amd64        NVIDIA binary Xorg driver

Many thanks in advance!

Update: doing a kernel downgrade solved the problem effortlessly!

@bob18 How did you downgrade the kernel?

hi @edouard1, I used the following article, it was very easy! The ubuntu installation I used came with kernel 5.8, which is the one I am working with right now.

1 Like