幸福的烦恼:显卡算力太高而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.

  • 写在最前面
  • 项目场景:
  • 问题描述
  • 原因分析:
  • 解决方案:
    • 查看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-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

成功了

查看支持算力

文章出处登录后可见!

已经登录?立即刷新

共计人评分,平均

到目前为止还没有投票!成为第一位评论此文章。

(0)
xiaoxingxing的头像xiaoxingxing管理团队
上一篇 2023年6月13日
下一篇 2023年6月13日

相关推荐