安装显卡驱动
禁止集成的nouveau驱动
1 | vim /etc/modprobe.d/blacklist.conf |
开始安装
1 | #安装必要 |
Anaconda
下载Anaconda, 如果在国内的话建议使用国内的mirror下载, https://mirrors.tuna.tsinghua.edu.cn/anaconda/archive/ 清华镜像源的镜像,找到对应的版本进行下载.
1
2wget https://mirrors.tuna.tsinghua.edu.cn/anaconda/archive/Anaconda3-5.3.1-Linux-x86_64.sh
bash Anaconda3-5.3.1-Linux-x86_64.sh按照提示进行安装
生效环境变量
1
source ~/.bashrc
换清华镜像源
1
2
3
4conda config --add channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/free/
conda config --add channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/main/
conda config --add channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/pytorch/
conda config --set show_channel_urls yes创建一个name为pytorh python版本为3.7的虚拟环境。
1
2
3conda create -n pytorch python=3.7
#切入环境
source activate pytorch
pytroch
配置好conda环境后就,pytorch就可以顺利安装了。
此处不能按照官方进行安装conda install pytorch torchvision cudatoolkit=10.1 -c pytorch
1 | #需要去掉-c torch后,可以从清华镜像快速下载。 |