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

- **ID:** `cuda/cublas-api-not-found`
- **领域:** cuda
- **类别:** runtime_error
- **错误码:** `CUBLAS_STATUS_ARCH_MISMATCH`
- **验证级别:** ai_generated
- **修复率:** 82%

## 根因

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

## 版本兼容性

| 版本 | 状态 | 引入 | 弃用 |
|------|------|------|------|
| CUDA 11.8 | active | — | — |
| cuBLAS 11.11 | active | — | — |
| PyTorch 2.0.1 | active | — | — |
| NVIDIA Driver 525.85.05 | active | — | — |

## 解决方案

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
   ```

## 无效尝试

- **** — Reinstallation does not change the GPU hardware or the compiled architecture targets; the mismatch persists. (90% 失败率)
- **** — Driver updates do not alter cuBLAS library architecture requirements; the kernel still expects a higher compute capability. (85% 失败率)
