Executing nvidia-smi to monitor GPU temperatures, memory allocation, or CUDA computing workloads in Ubuntu only to receive the 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” halts machine learning tasks and graphical acceleration. This error indicates a kernel-driver mismatch where the user-space NVIDIA management library cannot communicate with the loaded NVIDIA kernel module (nvidia.ko). This issue arises when an automated Ubuntu kernel update installs a newer Linux kernel while DKMS fails to recompile matching NVIDIA kernel modules, or when UEFI Secure Boot blocks unsigned proprietary modules.
Verify Kernel and Module Version Discrepancies
Before purging packages, compare your active running kernel version with the kernel modules registered on your filesystem.
- Open a terminal window (press Ctrl + Alt + T).
- Check your running kernel release:
uname -r - Check which NVIDIA kernel modules are currently loaded in memory:
lsmod | grep nvidia - If the command returns blank, the NVIDIA module failed to load during boot.
- Query DKMS status to see if the driver is compiled for your current kernel:
dkms status - If DKMS displays
installedfor an older kernel but not your active running kernel, an automatic kernel update left your driver behind.
Rebuild the NVIDIA Kernel Module Using DKMS
Dynamic Kernel Module Support (DKMS) automatically compiles driver binaries. Forcing a manual rebuild against your current kernel restores communication.
- Identify your installed NVIDIA driver version (e.g. 535, 550, or 560) by running:
dpkg -l | grep nvidia-driver - Rebuild the module for your active kernel (replace
550.54.14with your specific version fromdkms status):sudo dkms install -m nvidia -v 550.54.14 -k $(uname -r) - If the build succeeds, reload the kernel module without rebooting:
sudo modprobe nvidia - Execute
nvidia-smito verify that the GPU status table renders properly.
Sign the Kernel Module for UEFI Secure Boot
If UEFI Secure Boot is enabled in your computer BIOS, the Linux kernel refuses to load third-party proprietary modules unless they are signed with an enrolled Machine Owner Key (MOK).
- Check if Secure Boot is active:
mokutil --sb-state - If it outputs SecureBoot enabled, the unsigned NVIDIA module was rejected by kernel security enforcement.
- Trigger the Ubuntu MOK enrollment procedure:
sudo dpkg-reconfigure $(dpkg -l | grep -o 'linux-modules-nvidia-[0-9]*-generic' | head -n 1) - Alternatively, generate a new key and enroll it:
sudo update-secureboot-policy --enroll-key - Enter a temporary password when prompted.
- Reboot the computer. The blue Perform MOK management screen will appear. Select Enroll MOK > Continue > Yes, enter your password, and reboot.
Perform a Clean Reinstallation of the Recommended Driver
If broken package updates or mixed PPA repositories corrupted internal dependencies, purging and reinstalling the official recommended driver establishes a pristine baseline.
- Completely remove all existing NVIDIA packages:
sudo apt purge ~nnvidia - Clean package manager lists and fix interrupted installations:
sudo apt autoremove -y && sudo apt clean sudo apt update && sudo apt --fix-broken install - Check the recommended proprietary driver for your graphics card:
ubuntu-drivers devices - Install the recommended driver:
sudo ubuntu-drivers autoinstall - Reboot the system:
sudo reboot - After rebooting, run
nvidia-smi. The GPU driver version, CUDA version, temperature, and process list will display accurately.