CUBLAS_STATUS_ARCH_MISMATCH cuda runtime_error ai_generated true

运行时错误:CUDA 错误:调用 cublasSgemm 时出现 CUBLAS_STATUS_ARCH_MISMATCH

RuntimeError: CUDA error: CUBLAS_STATUS_ARCH_MISMATCH when calling cublasSgemm

ID: cuda/cublas-api-not-found

其他格式: JSON · Markdown 中文 · English
82%修复率
85%置信度
1证据数
2023-05-12首次发现

版本兼容性

版本状态引入弃用备注
CUDA 11.8 active
cuBLAS 11.11 active
PyTorch 2.0.1 active
NVIDIA Driver 525.85.05 active

根因分析

GPU 的计算能力低于所调用 cuBLAS 内核的要求,通常是因为代码针对 sm_80+ 编译,但 GPU 仅支持 sm_70 或更早版本。

English

The GPU's compute capability is too low for the cuBLAS kernel being invoked, typically because the code was compiled for sm_80+ but the GPU only supports sm_70 or earlier.

generic

官方文档

https://docs.nvidia.com/cuda/cublas/index.html#cublas-status-t

解决方案

  1. export CUBLAS_WORKSPACE_CONFIG=":4096:8" && python your_script.py
  2. export TORCH_CUDA_ARCH_LIST='7.0;7.5' && pip install --no-cache-dir torch --verbose

无效尝试

常见但无效的做法:

  1. 90% 失败

    Reinstallation does not change the GPU hardware or the compiled architecture targets; the mismatch persists.

  2. 85% 失败

    Driver updates do not alter cuBLAS library architecture requirements; the kernel still expects a higher compute capability.