How to Fix ‘NVIDIA-SMI Has Failed Because It Couldn’t Communicate with Driver’ in Linux

After performing routine system package upgrades on Ubuntu, Debian, or Fedora, running nvidia-smi to monitor GPU temperatures, memory usage, or CUDA workloads frequently fails with the critical error: ‘NVIDIA-SMI has failed because it couldn\’t communicate with the NVIDIA driver. Make sure that the latest NVIDIA driver is installed and running.’ Even though the graphics card worked moments prior, CUDA applications fail to detect compute capability. This mismatch occurs because the active Linux kernel version desynchronised from the compiled Dynamic Kernel Module Support (DKMS) driver modules.

Why Does NVIDIA-SMI Lose Communication with the Driver?

The communication failure stems from kernel-space module discrepancies:

  • Kernel Update Without DKMS Rebuild: An automated apt upgrade installed a newer Linux kernel image (e.g. updating from 6.5.0-28 to 6.5.0-35). If the system rebooted or failed to trigger DKMS autoinstall, the running kernel cannot locate matching nvidia.ko binaries.
  • Stale Driver Modules in Memory: Old driver modules remain loaded in kernel memory while user-space libraries (like nvidia-smi) updated to newer package versions.
  • Nouveau Open-Source Driver Conflict: The default open-source nouveau graphics driver grabbed the GPU framebuffer before proprietary NVIDIA modules loaded.
  • Secure Boot Signature Rejection: UEFI Secure Boot blocked third-party unsigned NVIDIA kernel modules from loading into the Linux kernel ring.

Step 1: Verify Running Kernel and DKMS Module Status

Check whether the running kernel has an active NVIDIA module registered.

  1. Open your terminal and check the currently active kernel:
    uname -r
  2. Check DKMS status across all installed kernel versions:
    dkms status
  3. If the output displays nvidia, X.Y.Z: installed for an older kernel but shows added or nothing for your current uname -r kernel, the module must be rebuilt.

Step 2: Rebuild NVIDIA DKMS Kernel Module

Compile the NVIDIA kernel module against the currently active kernel headers.

  1. Ensure header packages matching your kernel are installed:
    sudo apt update && sudo apt install -y linux-headers-$(uname -r) build-essential dkms
  2. Trigger DKMS automatic recompilation for all registered modules:
    sudo dkms autoinstall
  3. Alternatively, rebuild the specific NVIDIA driver version (replacing 550.54.14 with your driver version):
    sudo dkms install -m nvidia -v 550.54.14 -k $(uname -r)

Step 3: Unload Stale Modules or Reboot

If new modules compiled but user-space tools cannot communicate, unload the stale kernel drivers or perform a clean restart.

  1. Attempt to unload existing NVIDIA modules (stop display managers first if running a desktop environment):
    sudo systemctl stop gdm3  # or lightdm / sddm
    sudo rmmod nvidia_uvm
    sudo rmmod nvidia_modeset
    sudo rmmod nvidia_drm
    sudo rmmod nvidia
  2. Reload the newly compiled driver:
    sudo modprobe nvidia
  3. If modules report ‘in use’, perform a clean system reboot to initialise the new kernel module cleanly:
    sudo reboot

Step 4: Check UEFI Secure Boot MOK Key State

If modprobe nvidia returns ‘Operation not permitted’ or ‘Required key not available’, Secure Boot is rejecting unsigned modules.

  1. Check Secure Boot status:
    mokutil --sb-state
  2. If Secure Boot is enabled, sign the module using your machine-owner key (MOK) or disable Secure Boot temporarily in your motherboard UEFI BIOS.
  3. Run nvidia-smi to verify successful communication and monitor GPU stats.

Get the best tech tips delivered straight to your inbox.

Join thousands of readers mastering Apple, Google, Microsoft, and Linux.