Can't install nvidia driver 495 on Ubuntu 20.04 LTS

I installed the 495 nvidia driver for ubuntu. I installed the driver recommended by ubuntu.

Somehow nvidia-smi doesn’t find the driver I installed. Yet, the driver is present when running dkms status

user@server:~$ nvidia-smi
NVIDIA-SMI has failed because it couldn't communicate with the NVIDIA driver. Make sure that the latest NVIDIA driver is installed and running.

user@server:~$ dkms status
nvidia, 495.29.05, 5.11.0-41-generic, x86_64: installed

user@server:~$ nvidia-debugdump -l
Error: nvmlInit(): Driver Not Loaded

user@server:~$ lspci -v | grep VGA
01:00.0 VGA compatible controller: NVIDIA Corporation TU106 [GeForce RTX 2060 Rev. A] (rev a1) (prog-if 00 [VGA controller])

My GPU is detected. Am I missing a step required to link nvidia-smi to the ubuntu nvidia driver?
I have an xorg.conf file, with which I am able to set a resolution size, but not connect it to nvidia-smi.

Thank you in advance

Hi there @user83549 and welcome to the NVIDIA developer forums!

The first thing to look out for is the nouveau driver, which needs to be blacklisted. For example by doing the following:

$ sudo bash -c "echo blacklist nouveau > /etc/modprobe.d/blacklist-nvidia-nouveau.conf"
$ sudo bash -c "echo options nouveau modeset=0 >> /etc/modprobe.d/blacklist-nvidia-nouveau.conf"
$ sudo update-initramfs -u
$ sudo reboot

(see also the general driver README section 8.1 how to do that)
Another regularly overlooked thing is the fact that you need to reboot between installation processes. Meaning after driver installation and after utility isntallation.

I assume you installed the correct version of the nvidia-utils since you can execute nvidia-smi?
One other common reason for the error message you receive is a driver version mismatch. That can also be caused by old resident NVIDIA drivers. Check if you have older nvidia drivers installed and purge them.

After this you should be all set.