有人说是CUDA版本太高,而没有对应的Pytorch版本,导致不能兼容,故而失败,我也在尝试中。。。
本人nvidia-smi信息 现在是False
(base) wangbin@wangbin-ZHENGJIUZHE-REN9000K-34IMZ:~$ nvidia-smi
Fri Nov 20 09:57:00 2020
+-----------------------------------------------------------------------------+
| NVIDIA-SMI 455.38 Driver Version: 455.38 CUDA Version: 11.1 |
|-------------------------------+----------------------+----------------------+
| 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 GeForce RTX 3080 Off | 00000000:01:00.0 On | N/A |
| 30% 27C P8 22W / 320W | 177MiB / 10011MiB | 2% Default |
| | | N/A |
+-------------------------------+----------------------+----------------------+
+-----------------------------------------------------------------------------+
| Processes: |
| GPU GI CI PID Type Process name GPU Memory |
| ID ID Usage |
|=============================================================================|
| 0 N/A N/A 993 G /usr/lib/xorg/Xorg 95MiB |
| 0 N/A N/A 1605 G cinnamon 19MiB |
| 0 N/A N/A 23533 G ...AAAAAAAAA= --shared-files 59MiB |
+-----------------------------------------------------------------------------+
搞定了,其实我的nvidia-smi显示出来cuda的版本是11.1,但是我通过cuda list查找并没有看到cuda,不知道是怎么回事。
添加了一个清华源, https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/free/
(
conda config --add channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/free
conda config --set show_channel_urls yes
)
我将anconda彻底卸载了按照(https://blog.csdn.net/qq_22474567/article/details/54984257#commentBox),
然后重新装了一遍,然后进入官网(https://pytorch.org/get-started/locally/)根据人家所给命令下载
conda install pytorch torchvision torchaudio cudatoolkit=11.0 -c pytorch
就成功了,感觉如果不成功,可以先将anaconda先彻底卸载了再装一遍,也许就好了。
(first_env) wangbin@wangbin-ZHENGJIUZHE-REN9000K-34IMZ:~/Desktop$ python
Python 3.8.5 (default, Sep 4 2020, 07:30:14)
[GCC 7.3.0] :: Anaconda, Inc. on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import torch
>>> torch
>>> print(torch.cuda.is_available())
True
https://blog.csdn.net/qq_22474567/article/details/54984257#commentBox
linux上anaconda的卸载
同学A:我在运行第三步后,出现#export: command not found错误,是为什么呢
同学A回复:哈哈,我来自问自答吧.我的错误是第二步修改文件没有成功导致的,重新转到第一步进入bashrc文件,我的bashrc文件里面是if...else \export... fi ,这里需要把else和\export两行都注释掉,也就是在前面加#号
https://blog.csdn.net/ashome123/article/details/105822040#commentBox
https://blog.csdn.net/xq_nbu/article/details/83188570#commentBox
安装了anaconda不需要安装cuda和cudnn! ->这个貌似有用
torch.cuda.is_available()返回False,但nvidia-smi正常
https://spring-quan.github.io/2019/04/16/torch-cuda-is-available-%E8%BF%94%E5%9B%9EFalse-%E4%BD%86nvidia-smi%E6%AD%A3%E5%B8%B8/
Ubuntu安装和卸载CUDA和CUDNN
https://blog.csdn.net/qq_33200967/article/details/80689543#commentBox
https://www.cnblogs.com/yhjoker/p/10972795.html
Pytorch 使用不同版本的 cuda
https://www.jianshu.com/p/3c75176e7d8b
Linux下安装anaconda,Pytorch,tensorflow
Linux设置anaconda的环境变量
https://blog.csdn.net/m0_37041325/article/details/77169972
安装pytorch出现torch.cuda.is_available() False
https://blog.csdn.net/liu16659/article/details/105163179#commentBox
https://blog.csdn.net/lwgkzl/article/details/89329383
两行代码下载安装Anaconda(linux环境)
https://blog.csdn.net/qq1483661204/article/details/78201451#commentBox
linux下Anaconda的安装