幸福的烦恼:显卡算力太高而pytorch版本太低不支持

NVIDIA 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_70.


The current PyTorch install supports CUDA capabilities sm_37 sm_50 sm_60 sm_70.)
前些天发现了一个出色的人工智能学习网站。它的内容不仅深入浅出、易于理解,还充满了趣味性和幽默感,我觉得这对于喜欢探索新知识的朋友们来说会是一个不错的资源。
如果你对人工智能感兴趣,不妨 点击查看,看看能否为你的学习之旅增添一些乐趣和启发。

写在最前面

表面上是pytorch版本不够,实际是pytorch所依赖的cuda版本不够
在这里插入图片描述
在这里插入图片描述
总结:给RTX 3090配置cuda11以上版本即可

项目场景:

环境
RTX 3090 + linux
配置
torch-1.10.0 torchtext-0.11.0
cuda11.8


问题描述

UserWarning:
带有CUDA能力sm_86的NVIDIA GeForce RTX 3090与当前的PyTorch安装不兼容。
当前的PyTorch安装支持CUDA功能sm_37 sm_50 sm_60 sm_70。
如果您想在PyTorch中使用NVIDIA GeForce RTX 3090 GPU,请查看https://pytorch.org/get-started/locally/的说明

UserWarning: 
NVIDIA 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_70.
If you want to use the NVIDIA GeForce RTX 3090 GPU with PyTorch, please check the instructions at https://pytorch.org/get-started/locally/

原因分析:

参考:https://blog.csdn.net/Paramagnetism/article/details/115221478

幸福的烦恼
CUDA capability sm_86:算力8.6
上面表面上是说PyTorch,实际上是PyTorch依赖的CUDA版本的问题
翻译一下就是:RTX 3090的算力是8.6,但是当前的PyTorch依赖的CUDA版本支持的算力只有3.7、5.0、6.0、7.0

算力7.0的显卡可以在支持最高算力7.5的CUDA版本下运行,但是算力7.5的显卡不可以在支持最高算力7.0的CUDA版本下运行
同理算力8.x的显卡不可以在支持最高算力7.x的CUDA版本下运行


解决方案:

参考:https://blog.csdn.net/weixin_41529093/article/details/122039547

查看gpu的算力(即nvidia的算力)

nvidia-smi
nvidia-smi -a

在这里插入图片描述nvidia官网的算力查询
https://developer.nvidia.cn/zh-cn/cuda-gpus

在这里插入图片描述

查看pytorch版本&支持的cuda算力

>>> import torch
>>> print(torch.__version__)

在这里插入图片描述

python
import torch
torch.cuda.get_arch_list()

[‘sm_37’, ‘sm_50’, ‘sm_60’, ‘sm_70’]
在这里插入图片描述

查看cuda版本

nvcc _V

在这里插入图片描述

查看对应版本

pytorch官网
https://pytorch.org/get-started/previous-versions/

上pytorch官网查看(安装)最新版本的cuda以及对应的pytorch

在这里插入图片描述

# CUDA 11.3
conda install pytorch==1.10.0 torchvision==0.11.0 torchaudio==0.10.0 cudatoolkit=11.3 -c pytorch -c conda-forge

在现有conda下安装报错

因此新建环境

conda create -n wyt_1.10 python==3.8

进入到环境下

conda activate wyt_1.10

然后安装,还是报错
换成pip版本

pip install torch==1.10.0+cu111 torchvision==0.11.0+cu111 torchaudio==0.10.0 -f https://download.pytorch.org/whl/torch_stable.html

成功了

查看支持算力
在这里插入图片描述

  • 13
    点赞
  • 45
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

是Yu欸

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

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

余额充值