Error database

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

The NVIDIA kernel driver is not loaded — not installed, broken by a kernel update, or blocked by Secure Boot. Reboot first, then reinstall the driver.

The message you saw
NVIDIA-SMI has failed because it couldn't communicate with the NVIDIA driver

By Updated

The error

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

What it means

nvidia-smi is the tool that talks to the NVIDIA driver — the kernel-level software that operates the GPU. This message means the driver is not running at all. Until it is, nothing above it can work: CUDA, PyTorch and TensorFlow will all report no GPU. Fix this first; every higher-level GPU error is downstream of it.

Why it happens

On Linux, the driver is a kernel module built for one exact kernel version. The classic sequence: a system update installs a new kernel, the module does not get rebuilt, and after the next reboot the GPU is gone. Other causes: the driver was never installed, an installation half-completed, Secure Boot refuses to load an unsigned module, or — in WSL — someone installed a Linux display driver inside WSL, which breaks the special passthrough setup.

How to fix it

1. Reboot. If the driver was installed or updated recently, a plain reboot completes the switch and fixes a surprising share of cases.

2. On Ubuntu, (re)install the driver the supported way.

bash
sudo ubuntu-drivers install
sudo reboot

Or pick an explicit version: sudo apt install nvidia-driver-570 (use the latest offered for your card). After reboot, nvidia-smi should print the familiar table.

3. After kernel updates, check DKMS rebuilt the module.

bash
dkms status

A driver listed without "installed" for the running kernel explains everything. sudo apt install --reinstall nvidia-dkms-570 (matching your driver series) plus a reboot rebuilds it.

4. Check Secure Boot. If mokutil --sb-state says Secure Boot is enabled and the module is unsigned, either enroll the signing key when the installer offers (MOK enrollment on next boot) or disable Secure Boot in firmware settings. Symptom to confirm: modprobe nvidia mentions a key or signature problem in dmesg.

5. In WSL2: the driver lives on Windows, never inside WSL. Install the normal Windows NVIDIA driver, update WSL (wsl --update from Windows), and remove any nvidia-driver-* packages installed inside the Linux side. Inside WSL, nvidia-smi works via the passthrough at /usr/lib/wsl.

6. In cloud instances and containers, verify the host actually has the driver. A container needs the NVIDIA container toolkit and --gpus all; a fresh VM needs the driver installed once on the host.

How to prevent it

On workstations, prefer distribution-packaged drivers with DKMS so kernel updates rebuild the module automatically. Note your working driver version somewhere; after any big system upgrade, run nvidia-smi before starting a training job rather than discovering the problem mid-run.