Linux:GeForce RTX 3090 with CUDA capability sm_86 is not compatible with the current PyTorch 问题

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

问题描述

  • 在使用比较新的显卡RTX 3090时,遇到如下问题:
    • 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 GeForce RTX 3090 GPU with PyTorch, please check the instructions at https://pytorch.org/get-started/locally/
      在这里插入图片描述

问题解析

  • CUDA capability sm_86:GPU的算力8.6
  • 可以通过该下述令进行查看现有CUDA版本以及支持的算力情况
  • torch.cuda.get_arch_list()在这里插入图片描述
  • 由上图可知,我目前使用的CUDA版本支持的最大算力仅为7.0
  • 而问题中显示需要可以匹配算力8.6的CUDA才可以,因此报错。
  • 因此,这个问题表面上是说PyTorch,实际上是PyTorch依赖的CUDA版本的问题

解决方法

  • 先通过下述指令查看自己的GPU算力情况

    nvidia-smi
    nvidia-smi -a
    ## 我的gpu是3090Ti
    
  • 然后去英伟达官网查看对应的算力情况,英伟达官网,戳这里

  • 在这里插入图片描述

  • RTX 3090的算力是8.6,但是当前的PyTorch依赖的CUDA版本支持的算力只有3.7、5.0、6.0、7.0

  • 因此,需要对CUDA进行有针对性的升级

  • 上pytorch官网查看(安装)最新版本的cuda以及对应的pytorch,pytorch官网,戳👉这里

  • 在这里插入图片描述

  • 然后,根据上图红框里的指令进行安装即可;

    pip install torch==1.11.0+cu113 torchvision==0.12.0+cu113 torchaudio==0.11.0 --extra-index-url https://download.pytorch.org/whl/cu113
    
  • 安装时,最好完全新建一个conda环境,从头开始,然后在新的conda环境里最安装上述指令,然后再安装其他库,要不然会显示python被损坏的问题。

  • 下图便是安装好后,查看CUDA算力支持情况:

  • 在这里插入图片描述

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值