Pytorch GPU安装

cuda

实验室镜像中一开始没有CUDA
遂看到:https://developer.nvidia.com/cuda-downloads?target_os=Linux&target_arch=x86_64&Distribution=Ubuntu&target_version=22.04&target_type=runfile_local
准备使用wget进行安装
但是发现连接有点慢,但是又看到比较天才的做法:把官网com的域名改为cn,
https://blog.csdn.net/sinat_29217765/article/details/115723758 下载速度随即非常快。
或者采用:https://blog.csdn.net/Sihang_Xie/article/details/127347139在本地安装 .run文件
然后进行配置https://blog.csdn.net/weixin_49223002/article/details/120509776
安装cuda碰到问题:https://blog.csdn.net/weixin_43220532/article/details/112425819

torch

想的是:CUDA可以向下兼容所以直接下载torch 1.13
下载torch:换源,修改版本https://blog.csdn.net/cyy0789/article/details/131137525

原本准备:pip install torch1.12.0+cu113 torchvision0.13.0+cu113 torchaudio==0.12.0+cu113 --index-url https://download.pytorch.org/whl/cu113

但是这里面用清华源加速的方法反而不如直接用官方链接?

还是慢!

https://download.pytorch.org/whl/cu113/torchvision/
于是直接对应着从官网下载了相应的whl文件,并且通过pip install

有点慌的是:用whl安装的时候没有显示进度,等了差不多20min,下好了torch

torch和torchaudio,torchvision版本对应

https://blog.csdn.net/shiwanghualuo/article/details/122860521

whl下载网址

https://download.pytorch.org/whl/torch_stable.html

小问题记载:

3090集群上最好先下torch再配环境这样在pip install -r 时不会默认安装torch的cpu版本而且安装很慢!

机子的CUDA driver version支持更低的CUDA

CUDA对torch也不是完全向下兼容,有的torch版本太低,CUDA会运行不了
CUDA capability和torch支持的capability有区别!

提示一个换源方法https://blog.csdn.net/weixin_42640909/article/details/112142215

没去看:https://blog.csdn.net/gg864461719/article/details/112259806

print(torch.cuda.is_available()) 显示为TRUE 可以了!

打个点:https://blog.csdn.net/Miss_croal/article/details/128087921 cuDNN之后可以参考一下

posted @   张扬zy  阅读(10)  评论(0编辑  收藏  举报
相关博文:
阅读排行:
· 物流快递公司核心技术能力-地址解析分单基础技术分享
· 单线程的Redis速度为什么快?
· 展开说说关于C#中ORM框架的用法!
· Pantheons:用 TypeScript 打造主流大模型对话的一站式集成库
· SQL Server 2025 AI相关能力初探
点击右上角即可分享
微信分享提示