GeForce RTX 3090 with CUDA capability sm_86 is not compatible with the current PyTorch installation

在使用服务器训练网络时遇到PyTorch与RTX3090的CUDA算力不匹配的问题,提示需要安装支持sm_86的PyTorch版本。尝试通过pip安装特定CUDA版本的PyTorch,但因网络问题导致安装失败。另一种方法是直接安装对应CUDA的PyTorch,但可能仍然无法解决问题。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

服务器在训练网络时报错:

anaconda3/envs/particlesfm/lib/python3.7/site-packages/torch/cuda/init.py:104: UserWarning:
GeForce RTX 3090 with CUDA capability sm_86 is not compatible with the current PyTorch installation.
The current PyTorch install supports CUDA capabilities sm_37 sm_50 sm_60 sm_61 sm_70 sm_75 compute_37.
If you want to use the GeForce RTX 3090 GPU with PyTorch, please check the instructions at https://pytorch.org/get-started/locally/
warnings.warn(incompatible_device_warn.format(device_name, capability, " ".join(arch_list), device_name))

[解决方法]
CUDA capability sm_86与安装的pytorch版本不匹配,即当前RTX 3090的算力是8.6,但是当前的PyTorch依赖的CUDA版本支持的算力只有3.7、5.0、6.0、7.0,因此根据设备支持安装对应的pytorch和cuda版本:

pip install torch==1.8.0+cu111 torchvision==0.9.0+cu111 torchaudio==0.8.0 -f https://download.pytorch.org/whl/torch_stable.html

但是上述命令报错:

ERROR: Exception:
Traceback (most recent call last):
File “/home/yitong/anaconda3/envs/particlesfm/lib/python3.7/site-packages/pip/_vendor/urllib3/response.py”, line 438, in _error_catcher
yield
File “/home/yitong/anaconda3/envs/particlesfm/lib/python3.7/contextlib.py”, line 130, in exit
self.gen.throw(type, value, traceback)
File “/home/yitong/anaconda3/envs/particlesfm/lib/python3.7/site-packages/pip/_vendor/urllib3/response.py”, line 443, in _error_catcher
raise ReadTimeoutError(self._pool, None, “Read timed out.”)
pip._vendor.urllib3.exceptions.ReadTimeoutError: HTTPSConnectionPool(host=‘download.pytorch.org’, port=443): Read timed out.

这个是因为网络问题,排查网络后重新安装即可。
在查资料的过程中发现还有一种方法,即直接安装对应cuda的pytorch,不指定torch版本:

pip3 install torch torchvision torchaudio --extra-index-url https://download.pytorch.org/whl/cu113

但是经过验证发现无法解决这一问题,分析可能仍旧安装了不适配的pytorch。

参考1
参考2

评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值