sm_** 报错

问题描述

使用A800显卡,配置了一个pytorch==1.6.0 torchvision==0.7.0 cudatoolkit=10.2的环境,但在测试时报错如下:

(thy_vln_tta) wangzixu@gpu01:~/tianhaoyuan/WS-MGMap$ python
Python 3.6.15 | packaged by conda-forge | (default, Dec  3 2021, 18:49:41) 
[GCC 9.4.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import torch
>>> torch.tensor([1.0, 2.0]).cuda()
/share/home/wangzixu/miniconda3/envs/thy_vln_tta/lib/python3.6/site-packages/torch/cuda/__init__.py:125: UserWarning: 
NVIDIA A800 80GB PCIe with CUDA capability sm_80 is not compatible with the current PyTorch installation.
The current PyTorch install supports CUDA capabilities sm_37 sm_50 sm_60 sm_61 sm_70 sm_75 compute_37.
If you want to use the NVIDIA A800 80GB PCIe GPU with PyTorch, please check the instructions at https://pytorch.org/get-started/locally/

  warnings.warn(incompatible_device_warn.format(device_name, capability, " ".join(arch_list), device_name))

这意味着当前pytorch和cuda版本过低,无法支持此显卡

解决方法

  1. 首先查看当前显卡的计算能力,访问网站1,可以看到(A800是A100的中国特供版本)image1
  2. 然后访问网站2,可以看到8.0的计算能力对应最低的cuda版本为11.0image2
  3. 接下来就是在这找到合适torch安装,pytorch和python的对应关系可以看这里