Ubuntu 20.04 Nvidia-smi didnt work

I have a problem with Nvidia driver.
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.

Running nvidia-settings :

ERROR: NVIDIA driver is not loaded
ERROR: Unable to load info from any available system

Running lspci | grep -i nvidia

06:00.0 VGA compatible controller: NVIDIA Corporation Device 2503 (rev a1)
06:00.1 Audio device: NVIDIA Corporation Device 228e (rev a1)

I spent a long time searching to solve this problem including the following:
sudo apt install nvidia-driver-460

GRUB_CMDLINE_LINUX_DEFAULT="quiet splash pci=realloc"
sudo update-grub
sudo reboot

Running grep 10de /lib/udev/rules.d/*

/lib/udev/rules.d/71-nvidia.rules:SUBSYSTEM=="pci", ATTRS{vendor}=="0x10de", DRIVERS=="nvidia", TAG+="seat", TAG+="master-of-seat"

Running sudo modprobe nvidia

modprobe: ERROR: could not insert 'nvidia': Operation not permitted

Running dkms status

nvidia, 460.73.01, 5.8.0-59-generic, x86_64: installed

and running

sudo dkms remove nvidia/460.73.01 --all
sudo dkms install --force nvidia/460.73.01 -k $(uname -r)
sudo update-initramfs -u

and also some trying like this:

  1. Run prime-select query to get all possible options. You should see at least nvidia .
  2. Choose prime-select nvidia .

Running sudo lshw -c display

  *-display UNCLAIMED       
       description: VGA compatible controller
       product: NVIDIA Corporation
       vendor: NVIDIA Corporation
       physical id: 0
       bus info: pci@0000:06:00.0
       version: a1
       width: 64 bits
       clock: 33MHz
       capabilities: pm msi pciexpress vga_controller cap_list
       configuration: latency=0
       resources: iomemory:7f0-7ef iomemory:7f0-7ef memory:fb000000-fbffffff memory:7fe0000000-7fefffffff memory:7ff0000000-7ff1ffffff ioport:e000(size=128) memory:fc000000-fc07ffff

Running grep nvidia /etc/modprobe.d/ /lib/modprobe.d/**
Output: /etc/modprobe.d/blacklist-framebuffer.conf:blacklist nvidiafb

Here are the info about the pc.
Graphic card: nvidia RTX 3070
OS:Ubuntu 20.04.2 LTS
Kernel version: 5.8.0-59-generic

Thanks in advance. I really spent too much time here and still got stuck. I need your help, pls.
Kind regards,

Hi everyone, I came back with the successful solution. After trying thousands of ideas from the forums, it proved that, its not a problem with driver or kernel and even cuda. The problem is secure mode in BIOS. I solved it as follows:

1.Enter BIOS: reboot and power on, as soon as I powered on your pc start tapping the keys untill I entered BIOS
2.Go to Boot Manager and disable the option Secure Boot . This means , use insecure mode
4.nvidia-smi, it worked. Cheers.
btw. the devices is AMD B550 mainboard and RTX 3060


Cool,I have a similar problem when installing GPU T600 driver on Dell Precision 3561 computer, disabling the secure bios can install the gpu driver normally。

Thank you so much sharing this, I spent hours on changing driver, etc. Turns out to be exactly this problem.