Score:0

Can't Access NVIDIA Drivers After Update

lc flag

After updating my Ubuntu OS from 18.04 to 20.04 I could no longer access the NVIDIA drivers on my machine. If I run nvidia-smi I just see this:

NVIDIA-SMI has failed because it couldn't communicate with the NVIDIA driver. Make sure that the latest NVIDIA driver is installed and running.

I tried to re-install them by doing this:

sudo ubuntu-drivers install

But that failed and gave me this long list of error messages:

Setting up initramfs-tools (0.136ubuntu6.6) ...
update-initramfs: deferring update (trigger activated)
Setting up linux-image-5.4.0-81-generic (5.4.0-81.91) ...
Processing triggers for initramfs-tools (0.136ubuntu6.6) ...
update-initramfs: Generating /boot/initrd.img-5.4.0-81-generic
W: Possible missing firmware /lib/firmware/ast_dp501_fw.bin for module ast
Error 24 : Write error : cannot write compressed block
E: mkinitramfs failure cpio 141 lz4 -9 -l 24
update-initramfs: failed for /boot/initrd.img-5.4.0-81-generic with 1.
dpkg: error processing package initramfs-tools (--configure):
 installed initramfs-tools package post-installation script subprocess returned error exit status 1
Processing triggers for linux-image-5.4.0-81-generic (5.4.0-81.91) ...
/etc/kernel/postinst.d/dkms:
 * dkms: running auto installation service for kernel 5.4.0-81-generic
   ...done.
/etc/kernel/postinst.d/initramfs-tools:
update-initramfs: Generating /boot/initrd.img-5.4.0-81-generic
W: Possible missing firmware /lib/firmware/ast_dp501_fw.bin for module ast
Error 24 : Write error : cannot write compressed block
E: mkinitramfs failure cpio 141 lz4 -9 -l 24
update-initramfs: failed for /boot/initrd.img-5.4.0-81-generic with 1.
run-parts: /etc/kernel/postinst.d/initramfs-tools exited with return code 1
dpkg: error processing package linux-image-5.4.0-81-generic (--configure):
 installed linux-image-5.4.0-81-generic package post-installation script subprocess returned error exit status 1
Errors were encountered while processing:
 initramfs-tools
 linux-image-5.4.0-81-generic
E: Sub-process /usr/bin/dpkg returned an error code (1)

I'm not sure what it means that it can't write to a "compressed block" nor have my web searches haven't helped me resolve the problem. Does anyone on here understand why I can't install the NVIDIA driver?

Also I can see the NVIDIA drivers when I run apt search nvidia-driver but I just can't access them when I run nvidia-smi:

nvidia-384/focal-security,focal-updates 390.144-0ubuntu0.20.04.1 amd64
  Transitional package for nvidia-driver-390

nvidia-384-dev/focal-security,focal-updates 390.144-0ubuntu0.20.04.1 amd64
  Transitional package for nvidia-driver-390

nvidia-driver-390/focal-security,focal-updates 390.144-0ubuntu0.20.04.1 amd64
  NVIDIA driver metapackage

nvidia-driver-418/focal 430.50-0ubuntu3 amd64
  Transitional package for nvidia-driver-430

nvidia-driver-418-server/focal-security,focal-updates 418.211.00-0ubuntu0.20.04.1 amd64
  NVIDIA Server Driver metapackage

nvidia-driver-430/focal-security,focal-updates 440.100-0ubuntu0.20.04.1 amd64
  Transitional package for nvidia-driver-440

nvidia-driver-435/focal-updates 455.45.01-0ubuntu0.20.04.1 amd64
  Transitional package for nvidia-driver-455

nvidia-driver-440/focal-security,focal-updates 450.119.03-0ubuntu0.20.04.1 amd64
  Transitional package for nvidia-driver-450

nvidia-driver-440-server/focal-security,focal-updates 450.142.00-0ubuntu0.20.04.1 amd64
  Transitional package for nvidia-driver-450-server

nvidia-driver-450/focal-security,focal-updates 460.91.03-0ubuntu0.20.04.1 amd64
  Transitional package for nvidia-driver-460

nvidia-driver-450-server/focal-security,focal-updates 450.142.00-0ubuntu0.20.04.1 amd64
  NVIDIA Server Driver metapackage

nvidia-driver-455/focal-security,focal-updates 460.91.03-0ubuntu0.20.04.1 amd64
  Transitional package for nvidia-driver-460

nvidia-driver-460/focal-security,focal-updates 460.91.03-0ubuntu0.20.04.1 amd64
  NVIDIA driver metapackage

nvidia-driver-460-server/focal-security,focal-updates 460.91.03-0ubuntu0.20.04.1 amd64
  NVIDIA Server Driver metapackage

nvidia-driver-465/focal-security,focal-updates 470.57.02-0ubuntu0.20.04.1 amd64
  Transitional package for nvidia-driver-470

nvidia-driver-470/focal-security,focal-updates,now 470.57.02-0ubuntu0.20.04.1 amd64 [installed]
  NVIDIA driver metapackage

nvidia-driver-470-server/focal-updates 470.57.02-0ubuntu0.20.04.2 amd64
  NVIDIA Server Driver metapackage

nvidia-headless-390/focal-security,focal-updates 390.144-0ubuntu0.20.04.1 amd64
  NVIDIA headless metapackage

nvidia-headless-418-server/focal-security,focal-updates 418.211.00-0ubuntu0.20.04.1 amd64
  NVIDIA headless metapackage

nvidia-headless-450-server/focal-security,focal-updates 450.142.00-0ubuntu0.20.04.1 amd64
  NVIDIA headless metapackage

nvidia-headless-460/focal-security,focal-updates 460.91.03-0ubuntu0.20.04.1 amd64
  NVIDIA headless metapackage

nvidia-headless-460-server/focal-security,focal-updates 460.91.03-0ubuntu0.20.04.1 amd64
  NVIDIA headless metapackage

nvidia-headless-470/focal-security,focal-updates 470.57.02-0ubuntu0.20.04.1 amd64
  NVIDIA headless metapackage

nvidia-headless-470-server/focal-updates 470.57.02-0ubuntu0.20.04.2 amd64
  NVIDIA headless metapackage

nvidia-headless-no-dkms-390/focal-security,focal-updates 390.144-0ubuntu0.20.04.1 amd64
  NVIDIA headless metapackage - no DKMS

nvidia-headless-no-dkms-418-server/focal-security,focal-updates 418.211.00-0ubuntu0.20.04.1 amd64
  NVIDIA headless metapackage - no DKMS

nvidia-headless-no-dkms-450-server/focal-security,focal-updates 450.142.00-0ubuntu0.20.04.1 amd64
  NVIDIA headless metapackage - no DKMS

nvidia-headless-no-dkms-460/focal-security,focal-updates 460.91.03-0ubuntu0.20.04.1 amd64
  NVIDIA headless metapackage - no DKMS

nvidia-headless-no-dkms-460-server/focal-security,focal-updates 460.91.03-0ubuntu0.20.04.1 amd64
  NVIDIA headless metapackage - no DKMS

nvidia-headless-no-dkms-470/focal-security,focal-updates 470.57.02-0ubuntu0.20.04.1 amd64
  NVIDIA headless metapackage - no DKMS

nvidia-headless-no-dkms-470-server/focal-updates 470.57.02-0ubuntu0.20.04.2 amd64
  NVIDIA headless metapackage - no DKMS

xserver-xorg-video-nvidia-390/focal-security,focal-updates 390.144-0ubuntu0.20.04.1 amd64
  NVIDIA binary Xorg driver

xserver-xorg-video-nvidia-418-server/focal-security,focal-updates 418.211.00-0ubuntu0.20.04.1 amd64
  NVIDIA binary Xorg driver

xserver-xorg-video-nvidia-450-server/focal-security,focal-updates 450.142.00-0ubuntu0.20.04.1 amd64
  NVIDIA binary Xorg driver

xserver-xorg-video-nvidia-460/focal-security,focal-updates 460.91.03-0ubuntu0.20.04.1 amd64
  NVIDIA binary Xorg driver

xserver-xorg-video-nvidia-460-server/focal-security,focal-updates 460.91.03-0ubuntu0.20.04.1 amd64
  NVIDIA binary Xorg driver

xserver-xorg-video-nvidia-470/focal-security,focal-updates,now 470.57.02-0ubuntu0.20.04.1 amd64 [installed,automatic]
  NVIDIA binary Xorg driver

xserver-xorg-video-nvidia-470-server/focal-updates 470.57.02-0ubuntu0.20.04.2 amd64
  NVIDIA binary Xorg driver
Score:1
ca flag

I had similar issues on 20.04, where an update restarted locked in lo-res graphics. I navigated to Menu\Administration\Software&Updates\AdditionalDrivers and selected the X.Org driver instead of NVIDIA and normal service resumed.

nikebol906 avatar
lc flag
That did it. Thank you so much!
Score:0
ie flag

While the answers mentioned above may prove useful to many, here is what worked for me. Please note that I am running Ubuntu 22.04 along with an RTX-4090.

  1. Remove all installations related to nvidia
sudo apt-get remove --purge '^nvidia-.*'                                                                                                                                                                                                                                 
sudo apt-get remove --purge '^libnvidia-.*'
sudo apt-get remove --purge '^cuda-.*'
  1. This safely removes all installations
sudo apt autoremove
  1. Install the nvidia toolkit
sudo apt install --upgrade nvidia-cuda-toolkit
  1. Install the latest nvidia drivers
sudo ubuntu-drivers autoinstall
  1. Upon doing this, you will be asked to set a password which will be useful in verifying the MOK in secure boot.

  2. Reboot your system and verify the password to set MOK in secure boot

And voila, your drivers will start working as expected again!

Score:0
ai flag

make sure the package nvidia-prime is installed:

sudo apt install nvidia-prime

Afterwards, run

sudo prime-select nvidia

Please check if the file

/lib/modprobe.d/blacklist-nvidia.conf

exists, delete it, then run

sudo update-initramfs -u

and reboot.

Score:0
in flag

You need to remove any old drivers and then re-install.

First remove old drivers like so:

sudo apt-get remove --purge '^nvidia-.*'

Then use the auto install to make sure you get the right version.

sudo ubuntu-drivers autoinstall

Finally you just need to reboot.

sudo reboot
mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.