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