How to install the NVIDIA drivers on Ubuntu 20.04 Focal Fossa Linux - LinuxConfig.org

The objective is to install the NVIDIA drivers on Ubuntu 20.04 Focal Fossa Linux and switch from a opensource Nouveau driver to proprietary Nvidia driver.

To install Nvidia driver on other Linux distributions, follow our Nvidia Linux Driver guide.


This is a companion discussion topic for the original entry at https://linuxconfig.org/how-to-install-the-nvidia-drivers-on-ubuntu-20-04-focal-fossa-linux

hello, I have a problem with install the driver on my laptop. After I have install the driver, I can see the nvidia-X-server icon, but I get a error when i type “nvidia-smi” in the command line. It shows
“NVIDIA-SMI has failed because it couldn’t communicate with the NVIDIA driver. Make sure that the latest NVIDIA driver is installed and running.”
What can I do?

Hi Frank1126lin,

Welcome to our forums.

To start with, you could check if the driver is loaded. What output does the following command provide on your system?

$ sudo lsmod | grep -i nvidia

I also had that issue as mentioned above. I have tried multiple times and multiple methods to try to get my graphics drivers working (NVIDIA-390.132) However, when I run $ sudo lsmod | grep -i nvidia there is no output when I believe it should list “nvidia-390”
Any help would be greatly appreciated! :smiley:

I have the same issue. Please let me know if you have figure it out

Hi Sahel-Eskandar,

Welcome to our forums.

Which path did you take, the GUI install, or the command line install?

Hi @Lubos,
I would like to thank you. After hours of trial and error, your guide is what helped me get my GTX1650 working. Awesome!

Andre.

Hi

I’ve just installed a new Ubuntu 20.04. And I checked that nvidia-smi was working.

I’ve followed the “Automatic Install using PPA repository to install Nvidia Beta drivers” to install nvidia-drivers-450. Then I reboot the system.

I need this version to run a Docker container with CUDA 11.

Now when I run nvidia-smi, I get “NVIDIA-SMI has failed because it couldn’t communicate with the NVIDIA driver. Make sure that the latest NVIDIA driver is installed and running.”

When I run sudo lsmod | grep -i nvidia, I get no output.

Any ideas how to solve it? My GPU is a GeForce 940MX.

Well, I kept searching, and found a post in nvidia forum named “newly-installed-drivers-are-not-found-when-nvidia-smi-is-called” which has the answer (I can’t add the link because I’m a new user).
TLDR the problem was the Secure Boot. Deactivate it before installing the drivers.

you can try this live image

https__sourceforge.net/projects/toysbox/files/bionic-nvidia/ubuntu-20.04-5.4.0-26-generic-nvidia-450.57-primeselect.iso

where you have latest nvidia drivers on ubuntu-20.04 ; and you can switch back and forth between

intel/nvidia using prime-select without qny reboot and with a bonus : the nvidia card does really switch

off when you are on intel