RUNLOCALAIv38
->Will it run?Best GPUCompareTroubleshootStartLearnPulseModelsHardwareToolsBench
Run check
RUNLOCALAI

Independently operated catalog for local-AI hardware and software. Hand-written verdicts. Source-cited claims. Reproducible commands when we have them.

OP·Fredoline Eruo
DIR
  • Models
  • Hardware
  • Tools
  • Benchmarks
TOOLS
  • Will it run?
  • Compare hardware
  • Cost vs cloud
  • Choose my GPU
  • Prompting kits
  • Quick answers
REF
  • All buyer guides
  • Learn local AI
  • Methodology
  • Glossary
  • Errors KB
  • Trust
EDITOR
  • About
  • Author
  • How we make money
  • Editorial policy
  • Contact
LEGAL
  • Privacy
  • Terms
  • Sitemap
MAIL · MONTHLY DIGEST
Get monthly local AI changes
Monthly recap. No spam.
DISCLOSURE

Some links on this site are affiliate links (Amazon Associates and other first-class retailers). When you buy through them, we earn a small commission at no extra cost to you. Affiliate links do not influence our verdicts — there are cards we rate highly that we don't have affiliate relationships with, and cards that sell well that we refuse to recommend. Read more →

© 2026 runlocalai.coIndependently operated
RUNLOCALAI · v38
Errors / CUDA / NVIDIA / CUDA runtime version doesn't match the installed driver
CUDA / NVIDIA
Verified by owner

CUDA runtime version doesn't match the installed driver

RuntimeError: The detected CUDA version (12.4) mismatches the version that was used to compile PyTorch (12.1). Please make sure to use the same CUDA versions.
By Fredoline Eruo · Last verified Jun 12, 2026

Cause

Environment: NVIDIA Linux/WSL2 hosts running vLLM, PyTorch wheels built against a specific CUDA toolkit, or llama.cpp compiled with flash-attention.

Severity: high — the runtime refuses to start.

The PyTorch / vLLM / flash-attention wheel you installed was compiled against a different CUDA toolkit than the one your driver exposes. Driver and runtime CUDA versions don't have to be identical, but the wheel often hard-checks the toolkit it was built against.

  • Mixed installs: pip install vllm pulled the cu121 wheel onto a system whose driver only supports up to CUDA 12.0
  • Driver upgraded after PyTorch was installed (now ahead of the wheel)
  • flash-attention pre-built wheel for cu124 dropped onto a cu121 environment
  • Conda environment leaked a different libcudart.so onto LD_LIBRARY_PATH

Solution

1. Pin to your driver's CUDA via the matching wheel index (most reliable):

# Check what your driver supports
nvidia-smi  # right column "CUDA Version" is the MAX
# Reinstall PyTorch with that exact toolkit
pip install --force-reinstall torch torchvision \
  --index-url https://download.pytorch.org/whl/cu121

2. Pin via Docker so toolkit + wheel + driver are always consistent:

docker run --gpus all --rm \
  nvidia/cuda:12.1.1-cudnn8-runtime-ubuntu22.04 \
  bash -c "pip install vllm && python -c 'import vllm'"

3. Downgrade flash-attention to a build matching your toolkit:

pip install --force-reinstall \
  flash-attn==2.5.8 --no-build-isolation

4. Or upgrade the NVIDIA driver (preferred when no app-side pin exists):

sudo apt install nvidia-driver-550  # or latest stable
sudo reboot

5. Verify the resolved versions match:

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

Alternative solutions

If on Windows + WSL2, never install Linux NVIDIA drivers inside WSL — only update the Windows host driver. The WSL2 distro inherits the host's libcuda.so.1.

Related errors

  • vLLM install picks the wrong CUDA wheel
  • RuntimeError: CUDA error: device-side assert triggered
  • PyTorch: CUDA error: no kernel image is available for execution on the device

Did this fix it?

If your case was different, email Contact support with what you saw and we'll update the page. If it worked but took different commands on your platform, we want to know that too.