0

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
1

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.

1
  • That did it. Thank you so much!
    – nikebol906
    Aug 16 at 14:58
0

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.

0

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

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.