【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:

相关推荐
北京青翼科技11 小时前
PCIe接口-高速模拟采集—高性能计算卡-青翼科技高品质军工级数据采集板-打造专业工业核心板
图像处理·人工智能·fpga开发·信号处理·智能硬件
软件聚导航12 小时前
马年、我用AI写了个“打工了马” 小程序
人工智能·ui·微信小程序
陈天伟教授13 小时前
人工智能应用-机器听觉:7. 统计合成法
人工智能·语音识别
笨蛋不要掉眼泪13 小时前
Spring Boot集成LangChain4j:与大模型对话的极速入门
java·人工智能·后端·spring·langchain
昨夜见军贴061613 小时前
IACheck AI审核技术赋能消费认证:为智能宠物喂食器TELEC报告构筑智能合规防线
人工智能·宠物
摘星编程13 小时前
OpenHarmony + RN:Calendar日期选择功能
python
DisonTangor13 小时前
阿里开源语音识别模型——Qwen3-ASR
人工智能·开源·语音识别
Yvonne爱编码13 小时前
JAVA数据结构 DAY3-List接口
java·开发语言·windows·python
一方_self13 小时前
了解和使用python的click命令行cli工具
开发语言·python
小芳矶13 小时前
Dify本地docker部署踩坑记录
python·docker·容器