I have a dual-boot setup with Windows 10 and Ubuntu 20.04. I was originally using the NVIDIA driver 440 with CUDA on Ubuntu with no issues. I then installed the NVIDIA driver for Windows (version 452.06) and accidentally selected clean installation in the Custom install options. Everything works fine in the Windows side, but on the Ubuntu side, I ran nvidia-smi
and got the following error:
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 then removed the NVIDIA driver packages with:
$ sudo dpkg -P $(dpkg -l | grep nvidia-driver | awk '{print $2}')
$ sudo apt autoremove
$ reboot
I also uninstalled and re-installed the NVIDIA driver version for Windows. I tried re-installing the driver for Ubuntu using:
$ sudo apt install nvidia-driver-440
but I get the following error:
Error! Bad return status for module build on kernel: 5.4.0-45-generic (x86_64)
Consult /var/lib/dkms/nvidia/450.66/build/make.log for more information.
dpkg: error processing package nvidia-dkms-450 (--configure):
installed nvidia-dkms-450 package post-installation script subprocess returned
error exit status 10
dpkg: dependency problems prevent configuration of nvidia-driver-450:
nvidia-driver-450 depends on nvidia-dkms-450 (<= 450.66-1); however:
Package nvidia-dkms-450 is not configured yet.
nvidia-driver-450 depends on nvidia-dkms-450 (>= 450.66); however:
Package nvidia-dkms-450 is not configured yet.
dpkg: error processing package nvidia-driver-450 (--configure):
dependency problems - leaving unconfigured
No apport report written because the error message indicates its a followup erro
r from a previous failure.
No apport report written because the error message ind
icates its a followup error from a previous failure.
dpkg: dependency problems pr
event configuration of nvidia-driver-440:
nvidia-driver-440 depends on nvidia-driver-450; however:
Package nvidia-driver-450 is not configured yet.
dpkg: error processing package nvidia-driver-440 (--configure):
dependency problems - leaving unconfigured
Setting up libnvidia-gl-450:amd64 (450.66-0ubuntu0.20.04.1) ...
Setting up libnvidia-gl-450:i386 (450.66-0ubuntu0.20.04.1) ...
Setting up libnvidia-encode-450:amd64 (450.66-0ubuntu0.20.04.1) ...
Setting up libnvidia-encode-450:i386 (450.66-0ubuntu0.20.04.1) ...
Setting up libnvidia-gl-440:i386 (450.66-0ubuntu0.20.04.1) ...
Setting up libnvidia-ifr1-450:amd64 (450.66-0ubuntu0.20.04.1) ...
Setting up libnvidia-ifr1-450:i386 (450.66-0ubuntu0.20.04.1) ...
Processing triggers for mime-support (3.64ubuntu1) ...
Processing triggers for gnome-menus (3.36.0-1ubuntu1) ...
Processing triggers for libc-bin (2.31-0ubuntu9) ...
/sbin/ldconfig.real: /usr/local/cuda-10.1/targets/x86_64-linux/lib/libcudnn.so.7
is not a symbolic link
Processing triggers for man-db (2.9.1-1) ...
Processing triggers for desktop-file-utils (0.24-1ubuntu3) ...
Processing triggers for initramfs-tools (0.136ubuntu6.2) ...
update-initramfs: Generating /boot/initrd.img-5.4.0-45-generic
Errors were encountered while processing:
nvidia-dkms-450
nvidia-driver-450
nvidia-driver-440
E: Sub-process /usr/bin/dpkg returned an error code (1)
I don’t know how to resolve this. Please help!
Update: I backed up my home folder and reinstalled Ubuntu 20.04 (without erasing option) and went into Recovery mode where I saw that there is an issue with dpkg
. I selected the option to “fix broken packages” but it didn’t work and encountered an error. So I normal booted into Ubuntu and tried installing NVIDIA driver 440 via “Software & Updates > Additional Drivers”. It seemed to have installed the driver, but when I run nvidia-smi
I still get:
NVIDIA-SMI has failed because it couldn't communicate with the NVIDIA driver. Make sure that the latest NVIDIA driver is installed and running.
Update2: I rebooted into recovery mode to try and capture the error I got, and when I normal booted and checked nvidia-smi
it seemed to be working properly. I ran a deep learning network as a test, and it ran as expected. Will boot into Windows to check if the driver is working properly and then boot back into Ubuntu to see if can still use the nvidia-smi
. If I don’t update again within 72 hours, you can safely assume that my issue has been resolved.