Free | No tracking | Every fact with a source|German and English

Error / Graphics card and drivers

nvidia-smi: command not found in WSL (CUDA not available in WSL — the only correct driver is the Windows driver)

In WSL, you can’t find nvidia-smi or PyTorch can’t see a graphics card there.

The message

nvidia-smi: command not found  |  torch.cuda.is_available() → False (in WSL/Ubuntu)

Affects: WSL 2 (Windows Subsystem for Linux), Python

Why is this happening?

In WSL 2, the graphics driver comes from the Windows driver: It is provided in WSL as libcuda.so, and nvidia-smi is located under /usr/lib/wsl/lib. You must not install a Linux graphics driver in WSL, because it interferes with this integration. CUDA also works only with WSL 2 (not WSL 1) and a current WSL kernel.

How to fix it

  1. Install a current NVIDIA driver on Windows (Game Ready or Studio). That is the only driver you need.
  2. Check in PowerShell with wsl -l -v that your distribution has a 2 under VERSION. If not: wsl --set-version <Distributionsname> 2 (back up your data first).
  3. Update WSL with wsl --update and restart it with wsl --shutdown. The kernel must be at least 5.10.43.3; you can check this with wsl cat /proc/version.
  4. Run /usr/lib/wsl/lib/nvidia-smi in WSL. If that works, only the path is missing: Add /usr/lib/wsl/lib to the PATH.
  5. If you installed a Linux NVIDIA driver or the packages „cuda“ or „cuda-drivers“ in WSL, remove them again.
  6. If you need the CUDA Toolkit in WSL, use NVIDIA’s WSL Ubuntu installer and install only the metapackage cuda-toolkit-12-x (x = desired version).

Better not: Do not install a Linux graphics driver in WSL — not even through the packages „cuda“ or „cuda-drivers“.

Set up from scratch again

If it still doesn’t work after that, a fresh setup step by step often helps:

Terms for this

Similar errors

Sources

Checked on Oct 27, 2026. Didn't help? Ask in the forum and name the graphics card, program, and the full message.