1. pytorch安装
NVIDIA GeForce RTX 5060 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 5060 Ti GPU with PyTorch, please check the instructions at https://pytorch.org/get-started/locally/
上述错误说明:5060显卡的算力为“sm_120” 而a女装的pytorch最高只支持sm_90。但是pytorch官网“stable”版本暂不支持sm_120。
解决:
可以先安装 nightly 版本的 PyTorch 过度
# 先卸载已存在的pytorch
pip uninstall torch torchvision torchaudio
ps:虽然你安装的pytorch ,验证“print(torch.cuda.is_available()) 为 True”但是在运行程序是会出现上述错误
pip install --pre torch torchvision torchaudio --index-url https://download.pytorch.org/whl/nightly/cu129
再次验证pytorch是否可用:
import torch
print(torch.cuda.is_available()) # 输出 True 为torch可用
print(torch.cuda.get_device_name(0)) # 输出 显卡信息
print(torch.version.cuda) # 显示 CUDA 版本
出现问题:
(**) C:\U***>pip install --pre torch torchvision torchaudio --index-url https://download.pytorch.org/whl/nightly/cu129
Looking in indexes: https://download.pytorch.org/whl/nightly/cu129
ERROR: Could not find a version that satisfies the requirement torch (from versions: none)
ERROR: No matching distribution found for torch
发现找不到该版本,你需要更新你的python版本,我之前是python3.8会出现这个错误,但是升级到python3.10就可以正常安装了
参考链接:
https://github.com/Scarfy-sysu/rtx5060-pytorch-cuda129
https://blog.youkuaiyun.com/yin18827152962/article/details/149151015
-------------------------------------------------------2025年9月28日-----------------------------------------------------
1488

被折叠的 条评论
为什么被折叠?



