Nvidia drivers are not working properly after upgrading to Ubuntu 21.10

Hi everyone! Recently upgraded to Ubuntu 21.10 and after that:

  • One of the monitors stopped working
  • In Displays there’s only one Unknown display
  • xrandr says: Failed to get size of gamma for output default
  • Nvidia X server settings window is completely blank

While using nouveau drivers, both displays are recognized, so I’m using it as a workaround for now. But some graphical features work buggy with it, e.g. screen sharing in Google Meet, so I really would love to make Nvidia drivers work.

Attached the debug logs. Can someone help, please?
nvidia-bug-report.log.gz (117.2 KB)

The i915 driver for your igpu is missing, it should be in the modules package of your kernel. Likely, ubuntu upgrade forgot to install it.
Please try a full system upgrade first, then check whats installed
dpkg -l |grep “5,13.0”

Thanks a lot for helping, system upgrade only upgraded google-chrome version.
The command you asked to execute outputs nothing, but I assume you meant dpkg -l | grep 5.13.0, so here it is:

➜  ~ dpkg -l |grep 5.13.0
ii  linux-headers-5.13.0-19                    5.13.0-19.19                                 all          Header files related to Linux kernel version 5.13.0
ii  linux-headers-5.13.0-19-generic            5.13.0-19.19                                 amd64        Linux kernel headers for version 5.13.0 on 64 bit x86 SMP
ii  linux-headers-generic                      5.13.0.19.30                                 amd64        Generic Linux kernel headers
ii  linux-image-5.13.0-20-generic              5.13.0-20.20                                 amd64        Signed kernel image generic
ii  linux-libc-dev:amd64                       5.13.0-21.21                                 amd64        Linux Kernel Headers for development
ii  linux-modules-5.13.0-20-generic            5.13.0-20.20                                 amd64        Linux kernel extra modules for version 5.13.0 on 64 bit x86 SMP
ii  linux-modules-extra-5.13.0-20-generic      5.13.0-20.20                                 amd64        Linux kernel extra modules for version 5.13.0 on 64 bit x86 SMP
ii  ruby-minitest                              5.13.0-1                                     all          Ruby test tools supporting TDD, BDD, mocking, and benchmarking
ii  strace                                     5.13-0ubuntu1                                amd64        System call tracer

I also followed an online guide to install i915 driver and did this:

sudo add-apt-repository ppa:oibaf/graphics-drivers
sudo apt-get update
sudo apt-get dist-upgrade

And it indeed installed something, but the problem is still there.

I also tried to reinstall Nvidia drivers after that:

sudo apt-get remove --purge '^nvidia-.*'
sudo ubuntu-drivers autoinstall

But still no luck

Sorry for the typo.
The i915 driver should be in the package
linux-modules-extra-5.13.0-20-generic

Please check if it’s there:
ls -l /lib/modules/5.13.0-20-generic/kernel/drivers/gpu/drm/i915/

Furthermore, the headers for the kernel is missing so the nvidia driver doesn’t compile but that’s only a sidequest since without the i915 driver it won’t work anyway.

➜  ~ ls -l /lib/modules/5.13.0-20-generic/kernel/drivers/gpu/drm/i915/
total 4520
drwxr-xr-x 2 root root    4096 ноя  4 17:55 gvt
-rw-r--r-- 1 root root 4620777 окт 15 18:53 i915.ko

I guess my Ubuntu installation didn’t go as intended then. Is it possible to install these drivers manually?

It’s installed well, i915.ko. So I guess it’s just not included in the initrd. Please run
sudo update-initramfs -u
and reboot. Afterwards, please create a new nvidia-bug-report.log

Just did, but I had to switch from noveau drivers to Nvidia again to be able to create report, so I did:

sudo ubuntu-drivers autoinstall

Which apparently installs libnvidia-common-470.

Here is the log after installation: nvidia-bug-report.log.gz (97.1 KB)

P.S. During the Nvidia installation, I noticed that a lot of 5.13.0-19 stuff is installed, for example:

Selecting previously unselected package linux-headers-5.13.0-19.
Preparing to unpack .../61-linux-headers-5.13.0-19_5.13.0-19.19_all.deb ...
Unpacking linux-headers-5.13.0-19 (5.13.0-19.19) ...
Selecting previously unselected package linux-headers-5.13.0-19-generic.
Preparing to unpack .../62-linux-headers-5.13.0-19-generic_5.13.0-19.19_amd64.deb ...
Unpacking linux-headers-5.13.0-19-generic (5.13.0-19.19) ...
Selecting previously unselected package linux-headers-generic.
Preparing to unpack .../63-linux-headers-generic_5.13.0.19.30_amd64.deb ...
Unpacking linux-headers-generic (5.13.0.19.30) ...

But in the very end, it still uses 5.13.0-20-generic version:

update-initramfs: Generating /boot/initrd.img-5.13.0-20-generic
I: The initramfs will attempt to resume from /dev/dm-1
I: (/dev/mapper/ubuntu--vg-swap_1)
I: Set the RESUME variable to override this.
Trying to select the on-demand PRIME profile
Error: no integrated GPU detected.

So I guess something really broken in my system :(

My bad, you don’t have an igpu, so the driver obviously isn’t needed. Please run
sudo apt install linux-headers-$(uname -r)
afterwards, please post the output of
dkms status

➜  ~ sudo apt install linux-headers-$(uname -r)
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
Package linux-headers-5.13.0-20-generic is not available, but is referred to by another package.
This may mean that the package is missing, has been obsoleted, or
is only available from another source

E: Package 'linux-headers-5.13.0-20-generic' has no installation candidate

I assume my package lists are wrong, right now trying to fix that

Honestly, I really don’t understand this:

➜  ~ apt-cache search linux-image-5.13
linux-image-5.13.0-1004-kvm - Signed kernel image kvm
linux-image-5.13.0-1005-aws - Linux kernel image for version 5.13.0 on 64 bit x86 SMP
linux-image-5.13.0-1005-gcp - Signed kernel image GCP
linux-image-5.13.0-1006-azure - Signed kernel image azure
linux-image-5.13.0-1008-oracle - Signed kernel image oracle
linux-image-5.13.0-19-generic - Signed kernel image generic
linux-image-5.13.0-19-lowlatency - Signed kernel image lowlatency
linux-image-5.13.0-20-generic - Signed kernel image generic

And

➜  ~ apt-cache search linux-headers-5.13
linux-headers-5.13.0-1004-kvm - Linux kernel headers for version 5.13.0 on 64 bit x86 SMP
linux-headers-5.13.0-1005-aws - Linux kernel headers for version 5.13.0 on 64 bit x86 SMP
linux-headers-5.13.0-1005-gcp - Linux kernel headers for version 5.13.0 on 64 bit x86 SMP
linux-headers-5.13.0-1006-azure - Linux kernel headers for version 5.13.0 on 64 bit x86 SMP
linux-headers-5.13.0-1008-oracle - Oracle Linux kernel headers for version 5.13.0 on 64 bit x86 SMP
linux-headers-5.13.0-19 - Header files related to Linux kernel version 5.13.0
linux-headers-5.13.0-19-generic - Linux kernel headers for version 5.13.0 on 64 bit x86 SMP
linux-headers-5.13.0-19-lowlatency - Linux kernel headers for version 5.13.0 on 64 bit x86 SMP

So there’s an image available, but no headers?

And my sourcelist is:

➜  ~ cat /etc/apt/sources.list            
deb http://archive.ubuntu.com/ubuntu impish main universe restricted multiverse

Considering there IS headers (obviously): https://ubuntu.pkgs.org/21.10/ubuntu-updates-main-amd64/linux-headers-5.13.0-20-generic_5.13.0-20.20_amd64.deb.html I really don’t understand why my APT can’t get them

Looks like your cache is broken, the current kernel version for ubuntu 21.10 should be
5.13.0-22
try
sudo apt clean
sudo apt update

I was not able to install needed packages through apt, so I downloaded .deb files and installed manually. After that:

➜  ~ dpkg -l | grep 5.13.0
ii  linux-headers-5.13.0-19                    5.13.0-19.19                                 all          Header files related to Linux kernel version 5.13.0
ii  linux-headers-5.13.0-19-generic            5.13.0-19.19                                 amd64        Linux kernel headers for version 5.13.0 on 64 bit x86 SMP
ii  linux-headers-5.13.0-20                    5.13.0-20.20                                 all          Header files related to Linux kernel version 5.13.0
ii  linux-headers-5.13.0-20-generic            5.13.0-20.20                                 amd64        Linux kernel headers for version 5.13.0 on 64 bit x86 SMP
ii  linux-headers-generic                      5.13.0.19.30                                 amd64        Generic Linux kernel headers
ii  linux-image-5.13.0-19-generic              5.13.0-19.19                                 amd64        Signed kernel image generic
ii  linux-image-5.13.0-19-lowlatency           5.13.0-19.19                                 amd64        Signed kernel image lowlatency
ii  linux-image-5.13.0-20-generic              5.13.0-20.20                                 amd64        Signed kernel image generic
ii  linux-libc-dev:amd64                       5.13.0-21.21                                 amd64        Linux Kernel Headers for development
ii  linux-modules-5.13.0-19-generic            5.13.0-19.19                                 amd64        Linux kernel extra modules for version 5.13.0 on 64 bit x86 SMP
ii  linux-modules-5.13.0-19-lowlatency         5.13.0-19.19                                 amd64        Linux kernel extra modules for version 5.13.0 on 64 bit x86 SMP
ii  linux-modules-5.13.0-20-generic            5.13.0-20.20                                 amd64        Linux kernel extra modules for version 5.13.0 on 64 bit x86 SMP
ii  linux-modules-extra-5.13.0-20-generic      5.13.0-20.20                                 amd64        Linux kernel extra modules for version 5.13.0 on 64 bit x86 SMP
ii  ruby-minitest                              5.13.0-1                                     all          Ruby test tools supporting TDD, BDD, mocking, and benchmarking
ii  strace                                     5.13-0ubuntu1                                amd64        System call tracer

And after restarting the Nvidia drivers work:

➜  ~ nvidia-smi           
Mon Nov 15 16:59:28 2021       
+-----------------------------------------------------------------------------+
| NVIDIA-SMI 470.82.00    Driver Version: 470.82.00    CUDA Version: 11.4     |
|-------------------------------+----------------------+----------------------+
| GPU  Name        Persistence-M| Bus-Id        Disp.A | Volatile Uncorr. ECC |
| Fan  Temp  Perf  Pwr:Usage/Cap|         Memory-Usage | GPU-Util  Compute M. |
|                               |                      |               MIG M. |
|===============================+======================+======================|
|   0  NVIDIA GeForce ...  Off  | 00000000:01:00.0  On |                  N/A |
| 24%   47C    P8    15W / 215W |    329MiB /  7974MiB |      4%      Default |
|                               |                      |                  N/A |
+-------------------------------+----------------------+----------------------+
                                                                               
+-----------------------------------------------------------------------------+
| Processes:                                                                  |
|  GPU   GI   CI        PID   Type   Process name                  GPU Memory |
|        ID   ID                                                   Usage      |
|=============================================================================|
|    0   N/A  N/A      3688      G   /usr/lib/xorg/Xorg                141MiB |
|    0   N/A  N/A      4128      G   /usr/bin/gnome-shell              139MiB |
|    0   N/A  N/A      4467      G   ...se/Soft/Telegram/Telegram        2MiB |
|    0   N/A  N/A      4783      G   ...AAAAAAAAA= --shared-files       43MiB |
+-----------------------------------------------------------------------------+

@generix thanks a lot for the help

Maybe the just package list of the ubuntu repo is currently broken but you should have an eye on it to avoid being stuck regarding updates.

1 Like