解决pytorch capability sm_86 is not compatible with the current PyTorch installation 问题

编程入门 行业动态 更新时间:2024-10-26 10:37:24

问题描述

当使用比较新的显卡(比如NVIDIA GeForce RTX 3090)时,由于显卡的架构比较新,可能旧版本的pytorch库没有支持到。这时候就会出现capability sm_86 is not compatible的问题,同时根据输出可以看到 The current PyTorch install supports CUDA capabilities sm_37 sm_50 sm_60 sm_70 sm_75当前pytorch只能支持上面几种架构。

问题解决

最常见的解决方式是升级Pytorch版本,新的版本增加了对新显卡架构的支持。但是有时候升级到1.10.0问题仍然没有解决,其实1.7.1版本的pytorch就已经支持3090,问题没有解决的原因大概率是CUDA版本的问题。3090显卡一般使用CUDA11+,而直接pip安装的pytorch可能是cuda10.2版本的,所以只依靠升级pytorch版本是不行的,还需要安装对应cuda版本的pytorch。

pip安装

直接使用pip安装 pip install torch==1.7.1+cu110 会报错,提示如下

Could not find a version that satisfies the requirement torch==1.7.1+cu110 (from versions: 1.4.0, 1.5.0, 1.5.1, 1.6.0, 1.7.0, 1.7.1, 1.8.0, 1.8.1, 1.9.0, 1.9.1, 1.10.0)
ERROR: No matching distribution found for torch==1.7.1+cu110

原因是在pip使用的镜像网站中没有指定cuda版本的torch链接,这时候需要去官网上找,可以看到pip 安装cuda11.3版本pytorch的命令

pip3 install torch==1.10.0+cu113 torchvision==0.11.1+cu113 torchaudio==0.10.0+cu113 -f https://download.pytorch/whl/cu113/torch_stable.html

我们可以去-f后面的网站找到对应的pytorch版本,也可以将cu113替换为其他版本的cuda,比如想要安装pytorch1.7.1+cuda11.0,可以使用下面的命令

pip3 install torch==1.7.1+cu110 torchvision==0.8.2+cu110 -f https://download.pytorch/whl/cu110/torch_stable.html

更多推荐

解决pytorch capability sm_86 is not compatible with the current PyTorch installati

本文发布于:2023-06-14 01:17:00,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1422018.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:capability   pytorch   compatible   installation   PyTorch

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!