NVIDIA GeForce RTX 3080 with CUDA capability sm_86 is not compatible with the current PyTorch installation. 在中国云服务器使用torch时,可能遇到的torch版本与CUDA不兼容的问题。
问题分析
根据报错信息的描述,我们可以很明显地发现是由于torch版本与CUDA版本不匹配导致的。
如果你是在中国的云服务器,例如featurize、AutoDL等,即使你按照python程序的依赖安装了对应版本torch,也可能会报这个错误,这是因为中国的云服务器大多数默认是清华镜像源下载,这样可以有更高的下载速率。然而清华的镜像源提供的torch只能支持cpu,所以这里的错误是未安装GPU版本的torch。
此时需要到torch官网,按照你的需要找到对应的安装指令,这样的指令后面会跟着它指定的下载地址。
Previous PyTorch Versionshttps://pytorch.org/get-started/previous-versions/
例如,对CUDA11.1的torch1.9.0
pip install torch==1.9.0+cu111 torchvision==0.10.0+cu111 torchaudio==0.9.0 -f https://download.pytorch.org/whl/torch_stable.html
请注意,在安装之前应当卸载你已经安装的torch、torchvision、torchaudio
# 使用pip list查看当前环境的安装项
pip list
# 卸载torch、torchvision、torchaudio
pip uninstall torch torchvision torchaudio
个人博客:https://kecilimu-notion.vercel.app/
个人邮箱:kecilimu@163.com
转载请务必注明出处
文章主图是陌芋大大的图