7

I dual booted my laptop into Ubuntu 20.04 LTS a few months ago. The Ubuntu installation by default installed NVIDIA driver for me, so I could seamlessly use NVIDIA driver and trained model with GPU.

Everything was fine until a few days ago I suddenly got the following error when executing nvidia-smi:

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

Since then, I couldn't properly open my NVIDIA X Server GUI, as attached: enter image description here

It also came with other annoying display issues, e.g:

  • the screen back lighting was still on even though the screen went black
  • the screen failed to resume when it was awaken from suspend mode
  • the screen brightness couldn't be adjusted

All these display issues didnt happen in the past when I installed Ubuntu 20.04.

When checked out Software & Update, I found out the driver strangely fell back to Nouveau display driver (as attached): nvid

I couldn't switch back to NVIDIA driver listed above. Whenever I attempted to switch, I got the following error:

enter image description here

I was really frustrated by what was happening. I didn't do any software update so as to minimize the risk of messing up NVIDIA driver, but it still happened at the end...

At last resort, I will reinstall Ubuntu, but before that I would like to look for other alternatives. Really appreciated if you have possible solutions!

Error when installing nvidia-driver-450-server

sudo apt-get install nvidia-driver-450-server

Reading package lists... Done Building dependency tree
Reading state information... Done Some packages could not be installed. This may mean that you have requested an impossible situation or if you are using the unstable distribution that some required packages have not yet been created or been moved out of Incoming. The following information may help to resolve the situation:

The following packages have unmet dependencies: nvidia-driver-450-server : Depends: libnvidia-gl-450-server (= 450.51.06-0ubuntu0.20.04.2) but it is not going to be installed Depends: libnvidia-compute-450-server (= 450.51.06-0ubuntu0.20.04.2) but it is not going to be installed Depends: libnvidia-extra-450-server (= 450.51.06-0ubuntu0.20.04.2) but it is not going to be installed Depends: nvidia-compute-utils-450-server (= 450.51.06-0ubuntu0.20.04.2) but it is not going to be installed Depends: libnvidia-decode-450-server (= 450.51.06-0ubuntu0.20.04.2) but it is not going to be installed Depends: libnvidia-encode-450-server (= 450.51.06-0ubuntu0.20.04.2) but it is not going to be installed Depends: nvidia-utils-450-server (= 450.51.06-0ubuntu0.20.04.2) but it is not going to be installed Depends: xserver-xorg-video-nvidia-450-server (= 450.51.06-0ubuntu0.20.04.2) but it is not going to be installed Depends: libnvidia-cfg1-450-server (= 450.51.06-0ubuntu0.20.04.2) but it is not going to be installed Depends: libnvidia-ifr1-450-server (= 450.51.06-0ubuntu0.20.04.2) but it is not going to be installed Depends: libnvidia-fbc1-450-server (= 450.51.06-0ubuntu0.20.04.2) but it is not going to be installed Recommends: libnvidia-compute-450-server:i386 (= 450.51.06-0ubuntu0.20.04.2) Recommends: libnvidia-decode-450-server:i386 (= 450.51.06-0ubuntu0.20.04.2) Recommends: libnvidia-encode-450-server:i386 (= 450.51.06-0ubuntu0.20.04.2) Recommends: libnvidia-ifr1-450-server:i386 (= 450.51.06-0ubuntu0.20.04.2) Recommends: libnvidia-fbc1-450-server:i386 (= 450.51.06-0ubuntu0.20.04.2) Recommends: libnvidia-gl-450-server:i386 (= 450.51.06-0ubuntu0.20.04.2) E: Unable to correct problems, you have held broken packages.

Specification
Laptop: Lenovo Legion Y740
OS: Ubuntu 20.04
Kernel: 5.4.0-48-generic
GPU: RTX 2070 Max-Q

alexwh
  • 113
  • Have you tried running sudo apt-get install nvidia-driver-450-server from the command line? I don't think you will need to reinstall Ubuntu. Reinstalling the nvidia driver might do the trick. – tomsal Sep 25 '20 at 16:47
  • @tomsal thanks for your help! I got an error with the command. I have updated the post and attached the error – alexwh Sep 25 '20 at 16:58
  • 1
    You could try a sudo apt-get update and afterwards sudo apt-get install -f, then try again to install nvidia-driver-450-server. It's a bit of a shot in the dark, though. – tomsal Sep 25 '20 at 18:13
  • I did something similar to @tomsal said. In particular, simply running sudo apt --fix-broken --install solves my issue. – Cuong Sep 05 '22 at 02:10

2 Answers2

6

As a temporary solution, try to boot the previous kernel version if everything was okay previously. In my case, the working kernel was 5.4.0-47 (*-48 was broken). Hopefully, it is some temporary issue with package dependencies which will be resolved soon.

Update: I have fixed the issue with the new kernel version (5.4.0-48) by aptitude install nvidia-driver-450. There was a lot of warnings about some conflicts and removing of nvidia-*-440 packages, but finally the new version installed and the new kernel boots with nvidia drivers and everything looks good so far.

  • 1
    thanks so much! switching back to 5.4.0-47 works! I just don't know why Ubuntu auto-upgraded my kernel – alexwh Sep 26 '20 at 04:04
  • I don't have 5.4.0-47 as a previous version because I just re-installed 20.04. How can I force 5.4.0-47 to be used when it's not on my machine? I'd appreciate knowing the steps so that I can use the Nvidia 450 drivers again! – Monte Creasor Sep 26 '20 at 15:08
  • I encountered the same error, switching back to 5.4.0-47 fixed the issue, thank you so much!! – dpacman Sep 27 '20 at 11:31
1

I finally found a fix to the exact same problem. Boot back into the faulty 5.4.0.48 kernel. Now, open your terminal and do the following:

  1. Run:

    sudo apt-get dist-upgrade
    
  2. Open Software Updater and install the new updates.

  3. Reboot and the NVIDIA driver should work again.

dpacman
  • 111