问题
d:\anaconda3\envs***\lib\site-packages\torch\cuda_init _.py:262: UserWarning:
Found GPU0 GeForce GT 710 which is of cuda capability 3.5.
PyTorch no longer supports this GPU because it is too old.
The minimum cuda capability supported by this library is 3.7.
warnings.warn(
RuntimeError Traceback (most recent call last)
Cell In[3], line 906
(...)
--> 906 model = RnnNet().to(device)
907 # model = ResNet().to(device)
908 # model = SelfAttentionNet().to(device)
909 # model = TransformerNet().to(device)
(...)
RuntimeError: cuDNN error: CUDNN_STATUS_NOT_SUPPORTED_ARCH_MISMATCH
Output is truncated. View as a scrollable element or open in a text editor. Adjust cell output settings...
解决方案
你遇到的错误说明你的 GPU(NVIDIA GeForce GT 710, CUDA 3.5 )过旧 ,不再被 PyTorch 支持。下面是详细解释与解决方案:
❌ 报错核心含义
text
UserWarning:
Found GPU0 GeForce GT 710 which is of cuda capability 3.5.
PyTorch no longer supports this GPU because it is too old.
The minimum cuda capability supported by this library is 3.7.
并最终导致:
text
RuntimeError: cuDNN error: CUDNN_STATUS_NOT_SUPPORTED_ARCH_MISMATCH
✅ 解决方案(推荐方案)
方法一:强制使用 CPU
因为你的 GPU 不再被支持,所以最直接的办法是切换到 CPU 运算,代码中这样写:
python
device = torch.device("cpu") # 强制使用 CPU
model = RnnNet().to(device)
并确保 所有张量也使用 CPU,例如:
python
x = x.to(device)
y = y.to(device)
方法二:升级 GPU(如考虑 10 系列以上)
- 推荐 CUDA Compute Capability ≥ 3.7 的 GPU,比如:
- GTX 1050 / 1060 / 1660
- RTX 系列
- 或笔记本中的 MX450、RTX 2050 等
- 当前你的 GT 710(CC 3.5)已停止支持,不能再用于当前 PyTorch 版本中的 GPU 运算。
方法三(不推荐):安装旧版 PyTorch
可尝试安装支持 CUDA 3.5 的旧版本 PyTorch,例如:
bash
pip install torch==1.7.1+cu101 -f https://download.pytorch.org/whl/torch_stable.html
⚠️ 不推荐:旧版本可能兼容问题多、安全性差。
✅ 建议的代码示例(改为 CPU 模式)
python
device = torch.device("cpu")
model = RnnNet().to(device)
# 推理/训练时,张量也应在 CPU 上
for batch_x, batch_y in train_loader:
batch_x, batch_y = batch_x.to(device), batch_y.to(device)
output = model(batch_x)