NVIDIA GeForce RTX 3050 Laptop GPU with CUDA capability sm_86 is not compatible with current PyTorch

NVIDIA GeForce RTX 3050 Laptop GPU 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

root@7cd0ba7d49bc:/app# python
Python 3.8.10 (default, Jun 22 2022, 20:18:18) 
[GCC 9.4.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import torch
>>> torch.__version__ 
'1.12.1+cu102'
>>> print (torch.cuda.is_available());
True
leon@leon:~$ nvidia-smi
Wed Sep 14 15:55:07 2022       
+-----------------------------------------------------------------------------+
| NVIDIA-SMI 470.141.03   Driver Version: 470.141.03   CUDA Version: 11.4     |
|-------------------------------+----------------------+----------------------+
| GPU  Name        Persistence-M| Bus-Id        Disp.A | Volatile Uncorr. ECC |
| Fan  Temp  Perf  Pwr:Usage/Cap|         Memory-Usage | GPU-Util  Compute M. |
|                               |                      |               MIG M. |
|===============================+======================+======================|
|   0  NVIDIA GeForce ...  Off  | 00000000:01:00.0  On |                  N/A |
| N/A   39C    P8     6W /  N/A |    726MiB /  3902MiB |      3%      Default |
|                               |                      |                  N/A |
+-------------------------------+----------------------+----------------------+

解决方法:

https://pytorch.org/get-started/locally/#supported-linux-distributions

选择合适的版本,然后进入镜像,卸载原来的torch, 然后用pip重新安装

可以把修复的容器保存为镜像。

接下来我们看一下pytorch对应版本是否有问题:
https://pytorch.org/get-started/previous-versions/

我们可以看到cuda版本如果是11.1,那么所对应torch的版本应该是v1.8.0,但是我们刚才查看版本是1.6.0。接下来就简单啦。升级我们的pytorch。
复制上图对应11.1的命令到cmd又出现如下报错:
torchvision 0.7.0+cu101 has requirement torch1.6.0, but you’ll have torch 1.8.0 which is incompatible.
那我们就单独再download一遍:
pip install --upgrade torchvision0.9.0
报错如下:
Could not install packages due to an EnvironmentError: [WinError 5] 拒绝访问。: ‘d:\anaconda3.7\anaconda\lib\site-packages\torch_c.cp37-win_amd64.pyd’
Consider using the --user option or check the permissions.

参考:
https://blog.csdn.net/Xunuo1995/article/details/115261069

你可能感兴趣的:(python,人工智能,pytorch,深度学习,python)