装置显卡驱动
禁止集成的nouveau驱动
vim /etc/modprobe.d/blacklist.conf#增加几行blacklist vga16fbblacklist nouveaublacklist rivafbblacklist rivatvblacklist nvidiafb#执行update-initramfs -ureboot#重启后执行lsmod | grep nouveau#没有显示阐明曾经禁用
开始装置
#装置必要apt-get updateapt-get install gcc g++ make -y#依照提醒进行装置bash NVIDIA-Linux-x86_64-440.31.run#装置后执行,能够查看gpu状态nvidia-smi #查看gpu的驱动版本cat /proc/driver/nvidia/version
Anaconda
下载Anaconda, 如果在国内的话倡议应用国内的mirror下载, https://mirrors.tuna.tsinghua... 清华镜像源的镜像,找到对应的版本进行下载.
wget https://mirrors.tuna.tsinghua.edu.cn/anaconda/archive/Anaconda3-5.3.1-Linux-x86_64.shbash Anaconda3-5.3.1-Linux-x86_64.sh
- 依照提醒进行装置
失效环境变量
source ~/.bashrc
换清华镜像源
conda 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的虚拟环境。
conda create -n pytorch python=3.7 #切入环境 source activate pytorch
pytroch
配置好conda环境后就,pytorch就能够顺利装置了。
此处不能依照官网进行装置conda install pytorch torchvision cudatoolkit=10.1 -c pytorch
#须要去掉-c torch后,能够从清华镜像疾速下载。conda install pytorch torchvision cudatoolkit=10.1