13

The problem

Hi, I am having trouble installing the Nvidia drivers on my machine. The goal was to perform these simple commands:

$ ubuntu-drivers devices

And so, get something like:

modalias : pci:v000010DEd00001C8Csv00001028sd00000798bc03sc00i00
vendor   : NVIDIA Corporation
model    : GP107M [GeForce GTX 1050 Ti Mobile]
driver   : nvidia-driver-460 - distro non-free
driver   : nvidia-driver-418-server - distro non-free
driver   : nvidia-driver-470 - distro non-free recommended
driver   : nvidia-driver-450-server - distro non-free
driver   : nvidia-driver-460-server - distro non-free
driver   : nvidia-driver-390 - distro non-free
driver   : xserver-xorg-video-nouveau - distro free builtin

And after checking that everything was OK, just run this:

$ sudo ubuntu-drivers autoinstall

But I get this as a response inside the output of ubuntu-drivers devices and I can't do the next step sudo ubuntu-drivers autoinstall:

WARNING:root:_pkg_get_support nvidia-driver-390: package has invalid Support Legacyheader, cannot determine support level

Important note The drivers were working perfectly until today. But after the laptop ran out of battery (and it shut down because of this) the drivers, for some reason, vanished. The driver I had working and also the one I am going to try to install is the 470 from Nvidia, that is, I never installed the 390.

Attempts of solutions I already tried

I have tried several (attempted) solutions, but they don't work, such as a simple

$ sudo apt update
$ sudo apt upgrade
$ sudo ubuntu-drivers autoinstall

but it does not work, then I tried

$ sudo apt-get remove --purge nvidia*
$ sudo ubuntu-drivers autoinstall

and it doesn't work either, I also tried with the quotes

$ sudo apt-get remove --purge "nvidia*"
$ sudo ubuntu-drivers autoinstall

but it keeps failing

My configs

Ubuntu version

$ cat /etc/os-release

NAME="Ubuntu"
VERSION="20.04.3 LTS (Focal Fossa)"
ID=ubuntu
ID_LIKE=debian
PRETTY_NAME="Ubuntu 20.04.3 LTS"
VERSION_ID="20.04"
HOME_URL="https://www.ubuntu.com/"
SUPPORT_URL="https://help.ubuntu.com/"
BUG_REPORT_URL="https://bugs.launchpad.net/ubuntu/"
PRIVACY_POLICY_URL="https://www.ubuntu.com/legal/terms-and-policies/privacy-policy"
VERSION_CODENAME=focal
UBUNTU_CODENAME=focal

Kernel version

$ uname -a 

Linux DellInspiron 5.11.0-34-generic #36~20.04.1-Ubuntu SMP Fri Aug 27 08:06:32 UTC 2021 x86_64 x86_64 x86_64 GNU/Linux

Drivers list

$ ubuntu-drivers list

WARNING:root:_pkg_get_support nvidia-driver-390: package has invalid Support Legacyheader, cannot determine support level
nvidia-driver-450-server, (kernel modules provided by linux-modules-nvidia-450-server-generic-hwe-20.04)
nvidia-driver-460-server, (kernel modules provided by linux-modules-nvidia-460-server-generic-hwe-20.04)
nvidia-driver-390, (kernel modules provided by linux-modules-nvidia-390-generic-hwe-20.04)
nvidia-driver-418-server, (kernel modules provided by linux-modules-nvidia-418-server-generic-hwe-20.04)
nvidia-driver-470, (kernel modules provided by linux-modules-nvidia-470-generic-hwe-20.04)
nvidia-driver-460, (kernel modules provided by linux-modules-nvidia-460-generic-hwe-20.04)

Devices list

$ ubuntu-drivers devices

WARNING:root:_pkg_get_support nvidia-driver-390: package has invalid Support Legacyheader, cannot determine support level
== /sys/devices/pci0000:00/0000:00:01.0/0000:01:00.0 ==
modalias : pci:v000010DEd00001C8Csv00001028sd00000798bc03sc00i00
vendor   : NVIDIA Corporation
model    : GP107M [GeForce GTX 1050 Ti Mobile]
driver   : nvidia-driver-460 - distro non-free
driver   : nvidia-driver-418-server - distro non-free
driver   : nvidia-driver-470 - distro non-free recommended
driver   : nvidia-driver-450-server - distro non-free
driver   : nvidia-driver-460-server - distro non-free
driver   : nvidia-driver-390 - distro non-free
driver   : xserver-xorg-video-nouveau - distro free builtin
1

2 Answers 2

18

After researching in several forums, I found a partial solution here by the user alok.fj

The steps are quite simple, I put all the steps here in order:

$ sudo apt update
$ sudo apt upgrade
$ sudo apt autoremove
$ sudo apt-get remove --purge nvidia*
$ sudo apt-get remove --purge "nvidia*"

Then I run (as the original idea was)

$ ubuntu-drivers devices

WARNING:root:_pkg_get_support nvidia-driver-390: package has invalid Support Legacyheader, cannot determine support level
modalias : pci:v000010DEd00001C8Csv00001028sd00000798bc03sc00i00
vendor   : NVIDIA Corporation
model    : GP107M [GeForce GTX 1050 Ti Mobile]
driver   : nvidia-driver-460 - distro non-free
driver   : nvidia-driver-418-server - distro non-free
driver   : nvidia-driver-470 - distro non-free recommended
driver   : nvidia-driver-450-server - distro non-free
driver   : nvidia-driver-460-server - distro non-free
driver   : nvidia-driver-390 - distro non-free
driver   : xserver-xorg-video-nouveau - distro free builtin

Note that I still get the WARNING, but instead of running sudo ubuntu-drivers autoinstall, run the command explicitly clarifying the desired driver version:

sudo apt install nvidia-driver-470
sudo reboot

Once you have rebooted, test the installation with nvidia-smi and you should get something like this:

$ nvidia-smi

+-----------------------------------------------------------------------------+
| NVIDIA-SMI 470.57.02    Driver Version: 470.57.02    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 |
| N/A   50C    P0    N/A /  N/A |    447MiB /  4040MiB |      1%      Default |
|                               |                      |                  N/A |
+-------------------------------+----------------------+----------------------+
...

TL; DR

$ sudo apt update
$ sudo apt upgrade
$ sudo apt autoremove
$ sudo apt-get remove --purge nvidia*
$ sudo apt-get remove --purge "nvidia*"
$ sudo apt install nvidia-driver-470      (you may need other version)
$ sudo reboot

Test with

$ nvidia-smi
4
  • This fixed me right up. After rebooting, I had an "unclaimed" video output. Removing and reinstalling drivers fixed it. Thank you.
    – KenJ
    Oct 26, 2021 at 21:02
  • I'm using KDE and it freezes on boot on a black screen
    – chx101
    Feb 4, 2022 at 20:09
  • Really great, the settings are now remembered which previously (even when I was able to rotate the display) they weren't. Still haven't yet persuaded the logon screen to be rotated but that's a minor issue by comparison. Thanks.
    – glaucon
    Feb 9, 2022 at 23:11
  • This solution works for me (just no need reboot).
    – Feng Tian
    Apr 25, 2022 at 7:39
1

I tried all these steps but the underlying issue was the Secure Boot was Enabled. Disabling Secure Boot did the job.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .