Gefore RTX 3080 Laptop and Ubunut 21.10, Kernel 5.13.0-30 drivers not working

Hello,

i have upgraded my nvidia drivers and now my second external monitor is not detected.
I have Gefore RTX 3080 Laptop
I am using Ubuntu 21.10, kernel 5.13.0-30-generic.

I have already tried multiple ways how to fix it but none of it helped…

nvidia-smi command ouput:
NVIDIA-SMI has failed because it couldn’t communicate with the NVIDIA driver. Make sure that the latest NVIDIA driver is installed and running.

Nvidia X server Settings image

nvidia bug report
nvidia-bug-report.log.gz (182.0 KB)

Can anyone help me to resolve this? If you need more info let me know!
Thanks!

Secure boot is enabled in bios, either it got enabled by a windows update or module signing broke if you initially set ubuntu up with it. Please try disabling secure boot.

I tried to disable secure boot

sudo mokutil --sb-state
SecureBoot disabled

but nothing has changed, still the same problem.
Attaching new bug report
nvidia-bug-report.log.gz (157.4 KB)

Please try this:

  • run
sudo prime-select nvidia
  • run
grep nvidia /etc/modprobe.d/* /lib/modprobe.d/*

to find a file containing

blacklist nvidia

and remove it,
then run

sudo update-initramfs -u

and reboot.

Just to be sure not to break something even more, by running the grep command i got result like this

/etc/modprobe.d/blacklist-framebuffer.conf:blacklist nvidiafb
/etc/modprobe.d/nvidia-installer-disable-nouveau.conf:# generated by nvidia-installer
/lib/modprobe.d/nvidia-installer-disable-nouveau.conf:# generated by nvidia-installer
/lib/modprobe.d/nvidia-kms.conf:# This file was generated by nvidia-prime
/lib/modprobe.d/nvidia-kms.conf:options nvidia-drm modeset=1

should i remove this file or its something different?
/etc/modprobe.d/blacklist-framebuffer.conf

Don’t remove any of those files, those are correct. So since no blacklist file is in place, please try loading the module manually
sudo modprobe nvidia
and post any errors that are given.

Runned the first command from previous comment before grep so steps i did :

  1. prime-select nvidia
    Info: selecting the nvidia profile
    Deleting /lib/modprobe.d/nvidia-runtimepm.conf
    Updating the initramfs. Please wait for the operation to complete:
    Done
  2. modprobe nvidia
    modprobe: ERROR: could not insert ‘nvidia’: Exec format error

Ok, then something went wrong during module compilation.
Please check first that cc is set to gcc 11.2 by running
cc -v
then reinstall the kernel headers
sudo apt install --reinstall linux-headers-generic
and remove/reinstall the modules
sudo dkms remove nvidia/510.54
sudo dkms install nvidia/510.54
or remove/reinstall the driver using Software&Updates.

Forgot, run
sudo update-initramfs -u
afterwards to update the initrd.

Posting output of the commands before reboot:

cc -v

Using built-in specs.
COLLECT_GCC=cc
COLLECT_LTO_WRAPPER=/usr/lib/gcc/x86_64-linux-gnu/11/lto-wrapper
OFFLOAD_TARGET_NAMES=nvptx-none:amdgcn-amdhsa
OFFLOAD_TARGET_DEFAULT=1
Target: x86_64-linux-gnu
Configured with: …/src/configure -v --with-pkgversion=‘Ubuntu 11.2.0-7ubuntu2’ --with-bugurl=file:///usr/share/doc/gcc-11/README.Bugs --enable-languages=c,ada,c++,go,brig,d,fortran,objc,obj-c++,m2 --prefix=/usr --with-gcc-major-version-only --program-suffix=-11 --program-prefix=x86_64-linux-gnu- --enable-shared --enable-linker-build-id --libexecdir=/usr/lib --without-included-gettext --enable-threads=posix --libdir=/usr/lib --enable-nls --enable-bootstrap --enable-clocale=gnu --enable-libstdcxx-debug --enable-libstdcxx-time=yes --with-default-libstdcxx-abi=new --enable-gnu-unique-object --disable-vtable-verify --enable-plugin --enable-default-pie --with-system-zlib --enable-libphobos-checking=release --with-target-system-zlib=auto --enable-objc-gc=auto --enable-multiarch --disable-werror --enable-cet --with-arch-32=i686 --with-abi=m64 --with-multilib-list=m32,m64,mx32 --enable-multilib --with-tune=generic --enable-offload-targets=nvptx-none=/build/gcc-11-ZPT0kp/gcc-11-11.2.0/debian/tmp-nvptx/usr,amdgcn-amdhsa=/build/gcc-11-ZPT0kp/gcc-11-11.2.0/debian/tmp-gcn/usr --without-cuda-driver --enable-checking=release --build=x86_64-linux-gnu --host=x86_64-linux-gnu --target=x86_64-linux-gnu --with-build-config=bootstrap-lto-lean --enable-link-serialization=2
Thread model: posix
Supported LTO compression algorithms: zlib zstd
gcc version 11.2.0 (Ubuntu 11.2.0-7ubuntu2)

apt install --reinstall linux-headers-generic

Reading package lists… Done
Building dependency tree… Done
Reading state information… Done
0 upgraded, 0 newly installed, 1 reinstalled, 0 to remove and 0 not upgraded.
Need to get 2 316 B of archives.
After this operation, 0 B of additional disk space will be used.
Get:1 Index of /ubuntu impish-updates/main amd64 linux-headers-generic amd64 5.13.0.30.40 [2 316 B]
Fetched 2 316 B in 0s (26,8 kB/s)
(Reading database … 259321 files and directories currently installed.)
Preparing to unpack …/linux-headers-generic_5.13.0.30.40_amd64.deb …
Unpacking linux-headers-generic (5.13.0.30.40) over (5.13.0.30.40) …
Setting up linux-headers-generic (5.13.0.30.40) …

dkms remove nvidia/510.54

-------- Uninstall Beginning --------
Module: nvidia
Version: 510.54
Kernel: 5.13.0-30-generic (x86_64)

Status: Before uninstall, this module version was ACTIVE on this kernel.

nvidia.ko:

  • Uninstallation
    • Deleting from: /lib/modules/5.13.0-30-generic/updates/dkms/
  • Original module
    • No original module was found for this module on this kernel.
    • Use the dkms install command to reinstall any previous module version.

nvidia-modeset.ko:

  • Uninstallation
    • Deleting from: /lib/modules/5.13.0-30-generic/updates/dkms/
  • Original module
    • No original module was found for this module on this kernel.
    • Use the dkms install command to reinstall any previous module version.

nvidia-drm.ko:

  • Uninstallation
    • Deleting from: /lib/modules/5.13.0-30-generic/updates/dkms/
  • Original module
    • No original module was found for this module on this kernel.
    • Use the dkms install command to reinstall any previous module version.

nvidia-uvm.ko:

  • Uninstallation
    • Deleting from: /lib/modules/5.13.0-30-generic/updates/dkms/
  • Original module
    • No original module was found for this module on this kernel.
    • Use the dkms install command to reinstall any previous module version.

nvidia-peermem.ko:

  • Uninstallation
    • Deleting from: /lib/modules/5.13.0-30-generic/updates/dkms/
  • Original module
    • No original module was found for this module on this kernel.
    • Use the dkms install command to reinstall any previous module version.

depmod…

DKMS: uninstall completed.

dkms install nvidia/510.54

Kernel preparation unnecessary for this kernel. Skipping…
applying patch disable_fstack-clash-protection_fcf-protection.patch…patching file Kbuild
Hunk #1 succeeded at 82 (offset 11 lines).

Building module:
cleaning build area…
unset ARCH; [ ! -h /usr/bin/cc ] && export CC=/usr/bin/gcc; env NV_VERBOSE=1 ‘make’ -j16 NV_EXCLUDE_BUILD_MODULES=’’ KERNEL_UNAME=5.13.0-30-generic IGNORE_XEN_PRESENCE=1 IGNORE_CC_MISMATCH=1 SYSSRC=/lib/modules/5.13.0-30-generic/build LD=/usr/bin/ld.bfd modules…
Signing module:

  • /var/lib/dkms/nvidia/510.54/5.13.0-30-generic/x86_64/module/nvidia-peermem.ko
  • /var/lib/dkms/nvidia/510.54/5.13.0-30-generic/x86_64/module/nvidia.ko
  • /var/lib/dkms/nvidia/510.54/5.13.0-30-generic/x86_64/module/nvidia-drm.ko
  • /var/lib/dkms/nvidia/510.54/5.13.0-30-generic/x86_64/module/nvidia-modeset.ko
  • /var/lib/dkms/nvidia/510.54/5.13.0-30-generic/x86_64/module/nvidia-uvm.ko
    Secure Boot not enabled on this system.
    cleaning build area…

DKMS: build completed.

nvidia.ko:
Running module version sanity check.

  • Original module
    • No original module exists within this kernel
  • Installation
    • Installing to /lib/modules/5.13.0-30-generic/updates/dkms/

nvidia-modeset.ko:
Running module version sanity check.

  • Original module
    • No original module exists within this kernel
  • Installation
    • Installing to /lib/modules/5.13.0-30-generic/updates/dkms/

nvidia-drm.ko:
Running module version sanity check.

  • Original module
    • No original module exists within this kernel
  • Installation
    • Installing to /lib/modules/5.13.0-30-generic/updates/dkms/

nvidia-uvm.ko:
Running module version sanity check.

  • Original module
    • No original module exists within this kernel
  • Installation
    • Installing to /lib/modules/5.13.0-30-generic/updates/dkms/

nvidia-peermem.ko:
Running module version sanity check.

  • Original module
    • No original module exists within this kernel
  • Installation
    • Installing to /lib/modules/5.13.0-30-generic/updates/dkms/

depmod…

DKMS: install completed.

update-initramfs -u

update-initramfs: Generating /boot/initrd.img-5.13.0-30-generic
I: The initramfs will attempt to resume from /dev/nvme0n1p7
I: (UUID=3d8639ea-77b8-4ce8-8b8d-feebfaccfb2e)
I: Set the RESUME variable to override this

Will get back to you after reboot

Ok seems to be working now!

  1. external monitor is working - what was the main goal
  2. Nvidia X Server Settings are displayed
  3. but nvidia-smi output is:
    Failed to initialize NVML: Driver/library version mismatch

Should i worry about it or its fine in current state and it should be working from now on(or at least untill driver update)?

That’s not good, the mismatch tells that parts oftwo driver versions are installed. Please post the output of
dpkg -l |grep nvidia
and
dpkg -l |grep cuda

Attaching output and also printscreens for better readability

dpkg -l |grep nvidia

ii libnvidia-cfg1-510:amd64 510.54-0ubuntu0.20.04.1 amd64 NVIDIA binary OpenGL/GLX configuration library
ii libnvidia-common-510 510.54-0ubuntu0.20.04.1 all Shared files used by the NVIDIA libraries
rc libnvidia-compute-470:amd64 470.103.01-0ubuntu0.20.04.1 amd64 NVIDIA libcompute package
rc libnvidia-compute-470-server:amd64 470.103.01-0ubuntu0.20.04.1 amd64 NVIDIA libcompute package
rc libnvidia-compute-495:amd64 495.44-0ubuntu0.20.04.1 amd64 NVIDIA libcompute package
ii libnvidia-compute-510:amd64 510.54-0ubuntu0.20.04.1 amd64 NVIDIA libcompute package
ii libnvidia-compute-510:i386 510.54-0ubuntu0.20.04.1 i386 NVIDIA libcompute package
ii libnvidia-decode-510:amd64 510.54-0ubuntu0.20.04.1 amd64 NVIDIA Video Decoding runtime libraries
ii libnvidia-decode-510:i386 510.54-0ubuntu0.20.04.1 i386 NVIDIA Video Decoding runtime libraries
ii libnvidia-encode-510:amd64 510.54-0ubuntu0.20.04.1 amd64 NVENC Video Encoding runtime library
ii libnvidia-encode-510:i386 510.54-0ubuntu0.20.04.1 i386 NVENC Video Encoding runtime library
ii libnvidia-extra-510:amd64 510.54-0ubuntu0.20.04.1 amd64 Extra libraries for the NVIDIA driver
ii libnvidia-fbc1-510:amd64 510.54-0ubuntu0.20.04.1 amd64 NVIDIA OpenGL-based Framebuffer Capture runtime library
ii libnvidia-fbc1-510:i386 510.54-0ubuntu0.20.04.1 i386 NVIDIA OpenGL-based Framebuffer Capture runtime library
ii libnvidia-gl-510:amd64 510.54-0ubuntu0.20.04.1 amd64 NVIDIA OpenGL/GLX/EGL/GLES GLVND libraries and Vulkan ICD
ii libnvidia-gl-510:i386 510.54-0ubuntu0.20.04.1 i386 NVIDIA OpenGL/GLX/EGL/GLES GLVND libraries and Vulkan ICD
rc linux-modules-nvidia-470-5.11.0-38-generic 5.11.0-38.42~20.04.1 amd64 Linux kernel nvidia modules for version 5.11.0-38
rc linux-objects-nvidia-470-5.11.0-38-generic 5.11.0-38.42~20.04.1 amd64 Linux kernel nvidia modules for version 5.11.0-38 (objects)
rc linux-objects-nvidia-470-5.11.0-40-generic 5.11.0-40.44~20.04.2+1 amd64 Linux kernel nvidia modules for version 5.11.0-40 (objects)
ii linux-objects-nvidia-470-5.13.0-30-generic 5.13.0-30.33 amd64 Linux kernel nvidia modules for version 5.13.0-30 (objects)
ii linux-signatures-nvidia-5.13.0-30-generic 5.13.0-30.33 amd64 Linux kernel signatures for nvidia modules for version 5.13.0-30-generic
ii nvidia-compute-utils-510 510.54-0ubuntu0.20.04.1 amd64 NVIDIA compute utilities
ii nvidia-dkms-510 510.54-0ubuntu0.20.04.1 amd64 NVIDIA DKMS package
ii nvidia-driver-510 510.54-0ubuntu0.20.04.1 amd64 NVIDIA driver metapackage
ii nvidia-kernel-common-510 510.54-0ubuntu0.20.04.1 amd64 Shared files used with the kernel module
ii nvidia-kernel-source-510 510.54-0ubuntu0.20.04.1 amd64 NVIDIA kernel source package
ii nvidia-prime 0.8.17.1 all Tools to enable NVIDIA’s Prime
ii nvidia-settings 470.57.01-0ubuntu3 amd64 Tool for configuring the NVIDIA graphics driver
ii nvidia-utils-510 510.54-0ubuntu0.20.04.1 amd64 NVIDIA driver support binaries
ii screen-resolution-extra 0.18.1 all Extension for the nvidia-settings control panel
ii xserver-xorg-video-nvidia-510 510.54-0ubuntu0.20.04.1 amd64 NVIDIA binary Xorg driver

dpkg -l |grep cuda
Nothing in output

Looks correct, did you previously install the driver using the runfile installer?
The necessary libraries should be in libnvidia-compute-510, try reinstalling it
sudo apt install --reinstall libnvidia-compute-510
sudo apt-mark auto libnvidia-compute-510

Yes, i have also tried run files, but thought that i have reverted it…

sudo apt install --reinstall libnvidia-compute-510

Reading package lists… Done
Building dependency tree… Done
Reading state information… Done
Reinstallation of libnvidia-compute-510 is not possible, it cannot be downloaded.
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.

sudo apt-mark auto libnvidia-compute-510

libnvidia-compute-510 was already set to automatically installed.

does the same with
libnvidia-compute-510:amd64
work?

Same output

sudo apt install --reinstall libnvidia-compute-510:amd64

Reading package lists… Done
Building dependency tree… Done
Reading state information… Done
Reinstallation of libnvidia-compute-510 is not possible, it cannot be downloaded.
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.

Which repo did you install the 510.54 driver from? Seems that one is only available either from graphics drivers ppa or the ‘proposed’ repo.

I am not really sure if i installed it from run file

or in Software&Updates :/

Is there a way to find out?

Since you have packages installed, you likely installed it using Software&Updates.
-but-
the installed version is 510.54 while the current official Ubuntu version is only 510.47 so I wonder which additional repo you enabled to get the latest .54 version.

To make it simpler, just try updating the system
sudo apt update
sudo apt upgrade
maybe this will pull in the correct libraries by itself.