NVIDIA-SMI has failed because it couldn't communicate with the NVIDIA driver

Some users get the following error when they do nvidia-smi in the shell.

NVIDIA-SMI has failed because it couldn't communicate with the NVIDIA driver. Make sure that the latest NVIDIA driver is installed and running.

This issue is easily fixed by re-installing the drivers and rebooting:

sudo apt-get update
sudo apt-get install --no-install-recommends nvidia-384 libcuda1-384 nvidia-opencl-icd-384
sudo reboot

We still have the issue after updating the drivers. (Admin edit: sudo reboot fixes this)

Output:

sudo apt-get install --no-install-recommends nvidia-384 libcuda1-384 nvidia-opencl-icd-384
Reading package lists... Done
Building dependency tree
Reading state information... Done
libcuda1-384 is already the newest version (384.111-0ubuntu1).
nvidia-384 is already the newest version (384.111-0ubuntu1).
nvidia-opencl-icd-384 is already the newest version (384.111-0ubuntu1).
0 upgraded, 0 newly installed, 0 to remove and 223 not upgraded.


$ watch -n 0.2 nvidia-smi
Every 0.2s: nvidia-smi                                                        Mon Jan 29 18:13:31 2018

NVIDIA-SMI has failed because it couldn't communicate with the NVIDIA driver. Make sure that the latest NVIDIA driver is installed and running.
1 Like

Can you try to reboot?

Worked perfectly after Reboot!

1 Like

In fact you don’t have to reboot your computer. Much better is use dkms directly, so if it will fail to build the modules you’ll get error message and you can fix missing dependencies - like install additional packages required to perform the build. I wrote more about it here: Short and always working- install CUDA on GCP VM (CentOS7/CentOS8) – fun in IT

1 Like

still didn’t work after reboot, any ideas? (note nvcc --version still produces an output)

output :

sudo apt-get install --no-install-recommends nvidia-384 libcuda1-384 nvidia-opencl-icd-384
Reading package lists… Done
Building dependency tree
Reading state information… Done
Package nvidia-384 is not available, but is referred to by another package.
This may mean that the package is missing, has been obsoleted, or
is only available from another source
E: Package ‘nvidia-384’ has no installation candidate
E: Unable to locate package libcuda1-384
E: Unable to locate package nvidia-opencl-icd-384

HELP ME PLS :slight_smile: