nvidia-smi : no devices were found.

ubuntu16.04
kenerl 4.15.0-29-generic
GPU GTX1070

when I finished the installation of nvidia driver, I input ‘nvidia-smi’, then I got ‘no devices were found’.
I don’t know why this happened, I do everything according to many online tutorials.
Please help me out.

Check if you have secure boot enabled and disable it in bios if so. Otherwise, please run nvidia-bug-report.sh as root and attach the resulting .gz file to your post. Hovering the mouse over an existing post of yours will reveal a paperclip icon.
https://devtalk.nvidia.com/default/topic/1043347/announcements/attaching-files-to-forum-topics-posts/

I had a similar issue with ubuntu 18.04 kernel 4.15.

As I undestand :

  1. Since nvidia-smi doesn’t reply an error message, your driver are seemingly properly installed and in use.
  2. “No devices found” was in my case a problem related to nouveau driver

I set the nouveau mode 0 and updated grub (beware that the “/etc/” line has not been sufficient in my case. The “/lib/” one was also necessary.

echo options nouveau modeset=0 | sudo tee -a /etc/modprobe.d/nouveau-kms.conf
echo options nouveau modeset=0 | sudo tee -a /lib/modprobe.d/nouveau-kms.conf
sudo update-initramfs -u

This solved my issue.