Score:4

how to properly install nvidia 470 drivers on ubuntu 20.04?

in flag

I tried to switch to the "nvidia-driver-470" using the "Software & Updates / Additional Drivers" facility, but it always says the packages are not going to be installed.

If I select nvidia-driver-470 with synaptic, it installs all required packages, but there is something weird:
It requires an older kernel 5.4.0-1053-gcp (Google Cloud Platform), while the last one is 5.11.0-38-generic!
If I try to boot on the default option 5.11.0-38-generic, nvidia drivers wont load, and resolution will be 640x480 only!!!
If I try the 5.4.0-1053-gcp kernel (compatible with nvidia 470), it will not boot! It will stop booting when trying to initramfs, and then a few minutes later open busybox console...

Installing the 470 removed several older nvidia packages... good I had a root (and boot) backup made with rsync (https://unix.stackexchange.com/a/626503/30352), so I could quickly directly use the previously working OS copy AND/OR quickly restore it back (what I did).

I saw there are nvidia 470 for 5.11.0-38-generic packages, but I cant install them because
linux-modules-nvidia-470-5.11.0-38-generic requires
nvidia-kernel-common-470 >= 470.74, but the only available package is
nvidia-kernel-common-470 470.63.01-0ubuntu0.20.04.2
and if I download https://launchpad.net/ubuntu/+archive/primary/+files/nvidia-kernel-common-470_470.74-0ubuntu0.20.04.1_amd64.deb,
gdebi-gtk wont enable the install button for it! (I guess it is because mine is apparently 20.04.2 and the package is for 20.04.1)

but there is a report of it being installable:
NVIDIA 470 driver doesn't work after suspending Ubuntu 20.04.3 LTS (yeah, why mine with latest updates is apparently 20.04.2??)

Is 470 unstable? despite the additional drivers says it is "tested"?

I need to upgrade because UE4Editor is crashing with VK_ERROR_INITIALIZATION_FAILED "VkResult=-3" https://answers.unrealengine.com/questions/896820/out-of-memory-bug-running-422x-on-linux-with-vulka.html

Score:1
tr flag

I got the same error, currenly and somehow the 470 versión of the nvidia drivers that ubuntu provides does not work with kernel 5.11.0-38, downgrading to 460 drivers fixed the issue.

sudo apt remove '^nvidia'
sudo apt autoremove

Reboot

sudo apt install nvidia-driver-460
Score:0
no flag

I got a similar error when upgrading to latest. In my case, it was an upgrade from 465 -> 470 and the error was about a driver mismatch. In the end, I followed Octal's suggestion except after the reboot I tried:

sudo apt install nvidia-driver-470 libnvidia-gl-470 libnvidia-compute-470 libnvidia-decode-470 libnvidia-encode-470 libnvidia-ifr1-470 libnvidia-fbc1-470

And after another reboot, it seems to work as confirmed by nvidia-smi.

Note: the sudo apt remove '^nvidia' removed other things for me. You can keep track of the affected packages with apt list --installed '*nvidia*' so you can reinstall accordingly.

Score:0
in flag

I followed similar steps inspired from Octal. First, I ran

sudo apt update
sudo apt remove '^nvidia'
sudo apt autoremove

In the above command, please make sure to run "sudo apt update" before removing nvidia packages. Without that update command, this issue won't be fixed. Then, I ran

sudo apt-get purge 'nvidia*'
sudo apt autoremove

Then, I rebooted (this step is very very important. Don't immediately install the driver without rebooting).

Afterwards, I ran

sudo apt install nvidia-driver-460

and, reboot, and nvidia-smi should no longer cause any error.

Also, I agree with Octal, I think there is a compatibility issue between nvidia-driver-470, Ubuntu 20.04, and kernel 5.11.xxx because after I ran the steps that I have mentioned, I tried to install nvidia-driver-470 and nvidia-smi error returned.

EDIT: after the step above, I faced the same issue when I booted up my PC in the next day. The solution to this issue is to uninstall the bbswitch-dkms package from your OS. Then you need to reboot.

If after rebooting, your login menu somehow not showing, try to plug out your HDMI cable, and then, the login menu should show up. After you are already logged in, plug in the HDMI cable again.

fileyfood500 avatar
cn flag
+1 don't forget to reboot after uninstalling the bad install! This was my issue. I then reinstalled with `sudo ubuntu-drivers autoinstall`
mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.