Skip to content

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

Problem

Recently, when I re-configure my work environment, I install the Nvidia GPU driver. But after installation and reboot, I cannot use nvidia-smi command to get the GPU information. The only one message is:

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


I try to install different version by command line and GUI, but they are not the points. Finally, I found I have not use MOK manager correctly, so my driver cannot work


What is MOK?

MOK stands for Machine Owner Key, which is boot process that protects operating system components and drivers.

Of course, it is implemented by BIOS.

We need to create a pair of keys, the private key is used to sign the driver to be allowed to execute, and the public key is used by the MOK system for encryption.


Solution

During the installation of the Nvidia driver, we must have the opportunity to enter our password. If you want to reinstall the driver, you can refer the following command to remove the currently installed nvidia package.

sudo apt purge nvidia-*


Now maybe you want to search the Nvidia driver you can install:

sudo apt search nvidia-driver*


If you find the version you want to use, key in:

sudo apt install nvidia-driver<NVIDIA DRIVER VERSION>


For related apt command operations, please refer the link at the bottom of the article.

And in case you missed the MOK screen and did not enter the MOK screen on the next reboot, maybe you can execute the following commands to re-do these procedures:

sudo mokutil --import /var/lib/shim-signed/mok/MOK.der


You’ll be prompted for your password, and you’ll be taken to the MOK screen upon reboot.


Operation steps in MOK screen

  1. Set the password in the configure secure boot stage, and remember your password
  2. If you enter the screen of Perform MOK management, please select Enroll MOK > Continue > Yes
  3. Enter the password at the screen of Enroll the key(s)?
  4. Select OK to reboot
  5. After rebooting, use nvidia-smi command to check the driver is work.

Hope everyone can successfully load their drivers!


References


Read More

Tags:

10 thoughts on “[Solved] 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. Iasonas Katechis

    You saved me countless hours brother! Last time I got this I was so pissed off that I installed linux from scratch.

  2. sudo apt-get purge nvidia-*
    sudo apt-get update
    sudo apt-get autoremove
    and

    apt search nvidia ( check latest version)

    sudo apt install libnvidia-common-
    sudo apt install libnvidia-gl-
    sudo apt install nvidia-driver-

Leave a Reply