【debug】解决 5070ti 与 pytorch 版本不兼容的问题

遇到的报错:

packages\torch\cuda\init.py:435: UserWarning: Found GPU0 NVIDIA GeForce RTX 5070 Ti Laptop GPU which is of cuda capability 12.0. Minimum and Maximum cuda capability supported by this version of PyTorch is (5.0) - (9.0) queued_call() D:\my_programs\Anconda\conda_envs\rec\lib\site-packages\torch\cuda\init.py:435: UserWarning: Please install PyTorch with a following CUDA configurations: 12.8 13.0 following instructions at https://pytorch.org/get-started/locally/ queued_call() D:\my_programs\Anconda\conda_envs\rec\lib\site-packages\torch\cuda\init.py:435: UserWarning: NVIDIA GeForce RTX 5070 Ti Laptop GPU with CUDA capability sm_120 is not compatible with the current PyTorch installation. The current PyTorch install supports CUDA capabilities sm_50 sm_60 sm_61 sm_70 sm_75 sm_80 sm_86 sm_90. If you want to use the NVIDIA GeForce RTX 5070 Ti Laptop GPU GPU with PyTorch, please check the instructions at https://pytorch.org/get-started/locally/ queued_call()

5070ti 与 pytorch 版本不兼容,cuda 与 pytorch 不兼容

核心宗旨是确保:

nvidia-smi查到的可容纳的最大cuda的版本>=cuda版本>=pytorch版本

比如:

我查到的是12.8,那么我的cuda也下载12.8

接下来 pytorch 在Get Started中选择12.8的nightly,进入所给pip里面的链接

下载torch, torchvision( torchvision要比torch日期晚一天)到本地,然后:pip install 本地的下载路径

比如我的是:torchvision-0.25.0.dev20251124 +cu128-cp310-cp310-win_amd64.whl和orch- 2.10.0.dev20251123+cu128-cp310-cp310-win_amd64.whl

测试文件:

复制代码
import torch
print(torch.cuda.is_available())  # 应该返回 True
print(torch.cuda.current_device())  # 获取当前设备
print(torch.cuda.get_device_name(0))  # 获取第一个 GPU 的名字
print(torch.cuda.get_arch_list())  # 应包含'sm_120'

成功有了sm_120:

相关推荐
m0_613856294 小时前
mysql如何利用事务隔离级别解决特定业务冲突_mysql隔离方案选型
jvm·数据库·python
AI_小站4 小时前
6个GitHub爆火的免费大模型教程,助你快速进阶AI编程
人工智能·langchain·github·知识图谱·agent·llama·rag
xindoo4 小时前
GitHub Trending霸榜!深度解析AI Coding辅助神器 Superpowers
人工智能·github
时间之里5 小时前
【深度学习】:RF-DETR与yolo对比
人工智能·深度学习·yolo
北京阿法龙科技有限公司5 小时前
数智化升级:AR 智能眼镜驱动工业运维效能革新
人工智能
风落无尘5 小时前
《智能重生:从垃圾堆到AI工程师》——第二章 概率与生存
大数据·人工智能
j_xxx404_5 小时前
Linux:静态链接与动态链接深度解析
linux·运维·服务器·c++·人工智能
收获不止数据库5 小时前
达梦9发布会归来:AI 时代,我们需要一款什么样的数据库?
数据库·人工智能·ai·语言模型·数据分析
hhb_6185 小时前
AI全栈编程生存指南
人工智能
AI-Frontiers5 小时前
transformer进阶之路:#2 工作原理详解
人工智能·深度学习·transformer