cuda compatibility_error ai_generated true

RuntimeError: CUDA error: no kernel image is available for execution on the device

ID: cuda/cuda-capability-error

Also available as: JSON · Markdown
88%Fix Rate
90%Confidence
50Evidence
2023-01-01First Seen

Version Compatibility

VersionStatusIntroducedDeprecatedNotes
12 active

Root Cause

PyTorch/binary compiled for different GPU architecture. Need build matching your GPU compute capability.

generic

Workarounds

  1. 95% success Install PyTorch with correct CUDA version for your GPU: check pytorch.org/get-started
    pip install torch --index-url https://download.pytorch.org/whl/cu121

    Sources: https://pytorch.org/get-started/locally/

  2. 80% success Build from source with your GPU's compute capability: TORCH_CUDA_ARCH_LIST='8.9'
    TORCH_CUDA_ARCH_LIST='8.9'

    Sources: https://pytorch.org/docs/stable/cpp_extension.html

Dead Ends

Common approaches that don't work:

  1. Install older CUDA toolkit 70% fail

    CUDA toolkit version is separate from compute capability

  2. Set CUDA_VISIBLE_DEVICES to a different GPU 65% fail

    If all GPUs are same architecture, this won't help

Error Chain

Frequently confused with: