Problem installing Nvidia driver on Ubuntu 20.04
Solution 1:
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 , run the command explicitly clarifying the desired driver version:sudo ubuntu-drivers autoinstall
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