参考文章:
win10+1050Ti+python3.7+cuda10.1+cudnn7.6.4+pytroch1.5安装记录
需要准备的材料
1、驱动
https://www.nvidia.cn/Download/index.aspx?lang=cn
2、cuda
https://developer.nvidia.com/cuda-downloads
3、cudnn
https://developer.nvidia.com/rdp/cudnn-archive
4、pytorch
环境
pip debug --verbose
下载地址
https://download.pytorch.org/whl/cu101/torch_stable.html
其中cu101可以修改为cu90等
验证
import torch
print(torch.cuda.is_available())
# cuda是否可用;
print(torch.cuda.device_count())
# 返回gpu数量;
print(torch.cuda.get_device_name(0))
# 返回gpu名字,设备索引默认从0开始;
print(torch.cuda.current_device())
# 返回当前设备索引;
其他
由于pytorch的gpu版本严重依赖于cuda,导致有一些新包/库总是不兼容老版本的。所以能cuda高一点的话,pytorch也能高一点,就不会出现太多不兼容的bug。
当然也可以手动试一试支持1050Ti的其他更高版本的cuda。
版本相关
一定要提前确保版本之间的依赖关系正确,再进行下载安装,否则会浪费很多时间。
版本依赖