ubuntu系统下,pytorch安装
因为pytorch依赖于cuda的版本,显卡驱动的版本,三者之间对应不上就会安装失败
1.显卡驱动下载
显卡,支持最新的驱动型号
TitanX 430.64 LINUX X64 (AMD64/EM64T) DISPLAY DRIVER
TitanXP 440.82 LINUX X64 (AMD64/EM64T) DISPLAY DRIVER
GTX 1080Ti 440.82 LINUX X64 (AMD64/EM64T) DISPLAY DRIVER
RTX 2080Ti 440.82 LINUX X64 (AMD64/EM64T) DISPLAY DRIVER
2.驱动型号查询
nvidia-smi
3.驱动型号对应支持的cuda的版本号
[来源]https://docs.nvidia.com/cuda/cuda-toolkit-release-notes/index.html
CUDA Toolkit Linux x86_64 Driver Version Windows x86_64 Driver Version
CUDA 11.0.189 RC >= 450.36.06 >= 451.22
CUDA 10.2.89 >= 440.33 >= 441.22
CUDA 10.1 (10.1.105 general release, and updates) >= 418.39 >= 418.96
CUDA 10.0.130 >= 410.48 >= 411.31
CUDA 9.2 (9.2.148 Update 1) >= 396.37 >= 398.26
CUDA 9.2 (9.2.88) >= 396.26 >= 397.44
CUDA 9.1 (9.1.85) >= 390.46 >= 391.29
CUDA 9.0 (9.0.76) >= 384.81 >= 385.54
CUDA 8.0 (8.0.61 GA2) >= 375.26 >= 376.51
CUDA 8.0 (8.0.44) >= 367.48 >= 369.30
CUDA 7.5 (7.5.16) >= 352.31 >= 353.66
CUDA 7.0 (7.0.28) >= 346.46 >= 347.62
4.cuda的版本号(cudatoolkit)对应支持pytorch的版本号,torchvision的版本号,
[来源]https://pytorch.org/get-started/previous-versions/
# CUDA 9.2
conda install pytorch==1.2.0 torchvision==0.4.0 cudatoolkit=9.2 -c pytorch
# CUDA 10.0
conda install pytorch==1.2.0 torchvision==0.4.0 cudatoolkit=10.0 -c pytorch
# CUDA 9.0
conda install pytorch==1.1.0 torchvision==0.3.0 cudatoolkit=9.0 -c pytorch
# CUDA 10.0
conda install pytorch==1.1.0 torchvision==0.3.0 cudatoolkit=10.0 -c pytorch
# CUDA 9.0
conda install pytorch==1.0.1 torchvision==0.2.2 cudatoolkit=9.0 -c pytorch
# CUDA 10.0
conda install pytorch==1.0.1 torchvision==0.2.2 cudatoolkit=10.0 -c pytorch
# CUDA 10.0
conda install pytorch==1.0.0 torchvision==0.2.1 cuda100 -c pytorch
# CUDA 9.0
conda install pytorch==1.0.0 torchvision==0.2.1 cuda90 -c pytorch
# CUDA 8.0
conda install pytorch==1.0.0 torchvision==0.2.1 cuda80 -c pytorch
# CUDA 9
conda install pytorch=0.4.1 cuda90 -c pytorch
conda install pytorch=0.4.1 cuda92 -c pytorch
conda install pytorch=0.4.1 cuda80 -c pytorch
conda install pytorch=0.4.1 cuda75 -c pytorch
conda install pytorch=0.4.1 cuda75 -c pytorch
参考资料
[1] pytorch版本,cuda版本,系统cuda版本查询和对应关系
https://www.cnblogs.com/Wanggcong/p/12625540.html
[2] 显卡驱动版本查询和对应下载地址
https://www.nvidia.com/Download/index.aspx?lang=en-us
[3] 显卡驱动和cuda的对应关系
https://docs.nvidia.com/cuda/cuda-toolkit-release-notes/index.html
[4] pytorch和cudatoolkit版本对应关系
https://pytorch.org/get-started/previous-versions/
网友评论