NVIDIA drivers not working on ubuntu 20.04


I’ve been trying to install nvidia drivers for Geforce RTX 3070 GPU, but it seems not work properly.

I checked recommended driver version using “ubuntu-drivers devices” command and got these results below.

== /sys/devices/pci0000:00/0000:00:01.0/0000:01:00.0 ==
modalias : pci:v000010DEd00002484sv0000103Csd000088DCbc03sc00i00
vendor : NVIDIA Corporation
driver : nvidia-driver-510 - distro non-free
driver : nvidia-driver-515-open - distro non-free
driver : nvidia-driver-470 - distro non-free
driver : nvidia-driver-525-open - third-party non-free recommended
driver : nvidia-driver-470-server - distro non-free
driver : nvidia-driver-515-server - distro non-free
driver : nvidia-driver-515 - distro non-free
driver : nvidia-driver-525 - third-party non-free
driver : nvidia-driver-525-server - distro non-free
driver : xserver-xorg-video-nouveau - distro free builtin

So, I installed 525-open driver using “sudo apt install nvidia-driver-525-open” command, rebooted and display system didn’t come up.

It remained black screen for a long time.
I removed the driver through ssh and re-installed using “sudo ubuntu-drivers autoinstall” command, rebooted.
Installing seemed done well, but it seems driver is not installed or detected yet.

“nvidia-settings” command gives me this error below.

Unable to init server: Could not connect: Connection refused

ERROR: The control display is undefined; please run nvidia-settings --help for usage information.

“nvidia-smi” command gives me this error below.

No devices were found

Please let me know what I need to do to install nvidia drivers properly.

Please don’t use the “-open” driver unless you read the manual for it, use Software&Updates to switch to the non “-open” 525 driver.