CUDA Not Detected: Fix “CUDA driver version is insufficient” and GPU Not Found

Make CUDA work on Linux: confirm driver, toolkit, PATH/LD_LIBRARY_PATH, and verify with nvidia-smi and nvcc.

Keywords: cuda not detected, cuda driver version is insufficient

1) Confirm the GPU driver works

nvidia-smi
lsmod | grep nvidia

If nvidia-smi fails, fix the NVIDIA driver first (see the NVIDIA driver page).

2) Check toolkit vs driver compatibility

nvcc --version || echo "nvcc not installed"
echo $PATH
echo $LD_LIBRARY_PATH

3) Install CUDA toolkit (Ubuntu example)

Prefer your distro packages or NVIDIA repo — avoid mixing methods.

sudo apt update
sudo apt install -y nvidia-cuda-toolkit

4) Typical error: “CUDA driver version is insufficient”

This usually means: CUDA toolkit expects a newer driver than installed. Update the driver.

ubuntu-drivers devices
sudo ubuntu-drivers autoinstall
sudo reboot

5) Verify with a simple test

python3 -c "import torch; print(torch.cuda.is_available()); print(torch.version.cuda)"