PyTorch 不支持旧GPU的异常状态与解决方案:CUDNN_STATUS_NOT_SUPPORTED_ARCH_MISMATCH

问题

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)

相关推荐
我材不敲代码12 小时前
Python实现打包贪吃蛇游戏
开发语言·python·游戏
0思必得014 小时前
[Web自动化] Selenium处理动态网页
前端·爬虫·python·selenium·自动化
水如烟14 小时前
孤能子视角:“组织行为学–组织文化“
人工智能
韩立学长14 小时前
【开题答辩实录分享】以《基于Python的大学超市仓储信息管理系统的设计与实现》为例进行选题答辩实录分享
开发语言·python
大山同学14 小时前
图片补全-Context Encoder
人工智能·机器学习·计算机视觉
qq_1927798714 小时前
高级爬虫技巧:处理JavaScript渲染(Selenium)
jvm·数据库·python
薛定谔的猫198214 小时前
十七、用 GPT2 中文对联模型实现经典上联自动对下联:
人工智能·深度学习·gpt2·大模型 训练 调优
u01092727115 小时前
使用Plotly创建交互式图表
jvm·数据库·python
爱学习的阿磊15 小时前
Python GUI开发:Tkinter入门教程
jvm·数据库·python
壮Sir不壮15 小时前
2026年奇点:Clawdbot引爆个人AI代理
人工智能·ai·大模型·claude·clawdbot·moltbot·openclaw