当前位置:首页 » 《资源分享》 » 正文

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

25 人参与  2024年04月25日 09:44  分类 : 《资源分享》  评论

点击全文阅读


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.

写在最前面项目场景:问题描述原因分析:解决方案:查看gpu的算力(即nvidia的算力)查看pytorch版本&支持的cuda算力查看cuda版本查看对应版本
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-sminvidia-smi -a

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

在这里插入图片描述

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

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

在这里插入图片描述

pythonimport torchtorch.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.3conda 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

成功了

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


点击全文阅读


本文链接:http://zhangshiyu.com/post/99863.html

<< 上一篇 下一篇 >>

  • 评论(0)
  • 赞助本站

◎欢迎参与讨论,请在这里发表您的看法、交流您的观点。

关于我们 | 我要投稿 | 免责申明

Copyright © 2020-2022 ZhangShiYu.com Rights Reserved.豫ICP备2022013469号-1