cudaErrorNoKernelImageAvailable
cuda
build_error
ai_generated
true
CUDA error: no kernel image is available for execution on the device (cudaErrorNoKernelImageAvailable)
ID: cuda/device-incompatible-cubin
90%Fix Rate
88%Confidence
1Evidence
2024-01-10First Seen
Version Compatibility
| Version | Status | Introduced | Deprecated | Notes |
|---|---|---|---|---|
| CUDA 12.0 | active | — | — | — |
| PyTorch 2.0.0 | active | — | — | — |
| NVIDIA A100 (sm_80) | active | — | — | — |
Root Cause
The compiled CUDA binary (cubin) was generated for a different GPU architecture than the one currently in use, e.g., sm_80 vs sm_86.
generic中文
编译的CUDA二进制文件(cubin)是为与当前使用的GPU架构不同的架构生成的,例如sm_80与sm_86。
Official Documentation
https://docs.nvidia.com/cuda/cuda-compiler-driver-nvcc/index.html#gpu-compilationWorkarounds
-
90% success Recompile the kernel with the correct architecture. For PyTorch, set environment variable `TORCH_CUDA_ARCH_LIST='8.6'` for Ampere GPUs. For custom CUDA code, compile with `-arch=sm_86`.
Recompile the kernel with the correct architecture. For PyTorch, set environment variable `TORCH_CUDA_ARCH_LIST='8.6'` for Ampere GPUs. For custom CUDA code, compile with `-arch=sm_86`.
中文步骤
Recompile the kernel with the correct architecture. For PyTorch, set environment variable `TORCH_CUDA_ARCH_LIST='8.6'` for Ampere GPUs. For custom CUDA code, compile with `-arch=sm_86`.
Dead Ends
Common approaches that don't work:
-
80% fail
The issue is architecture-specific, not CUDA version.
-
95% fail
Caching only affects runtime memory, not compiled code.