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

相关推荐
嫂子的姐夫44 分钟前
02-多线程
爬虫·python·多线程·并发爬虫·基础爬虫
OpenCSG1 小时前
悟界Emu3.5发布:世界模型诞生,多模态进入“下一状态预测”新纪元
人工智能·开源
铅笔侠_小龙虾1 小时前
深度学习理论推导--多元线性回归
人工智能·深度学习·机器学习
腾视科技1 小时前
私有云时代来临:AI NAS如何重塑你的数字生活?
人工智能·生活
TextIn智能文档云平台1 小时前
PDF格式转化,哪款软件的准确率更高?
人工智能·pdf
星座5281 小时前
智慧农林核心遥感技术暨:AI赋能农林遥感智能提取99案例实践-生化参数智能反演、表型信息智能提取、胁迫状态智能识别
人工智能·高光谱·智慧农林
糖葫芦君1 小时前
普通卷积 VS 深度卷积
人工智能·深度学习
【建模先锋】1 小时前
基于Python的智能故障诊断系统 | SmartDiag AI (基础版)V1.0 正式发布!
开发语言·人工智能·python·故障诊断·智能分析平台·大数据分析平台·智能故障诊断系统
简鹿办公1 小时前
Opera 全线浏览器接入 Google Gemini,AI 上网体验全面升级
人工智能·google gemini·opera neon