@centos7安装N卡驱动和conda pytorch1.7.1深度学习环境
这是 centos7安装N卡驱动和conda深度学习环境。
Ananconda安装和 N卡驱动安装
百度网盘 安装包
链接:https://pan.baidu.com/s/1k69J5VU63WvnoBeMkWd8kw
提取码:1nr4
–来自百度网盘超级会员V5的分享
systemctl stop firewalld
systemctl disable firewalld
iptables -F
关闭所有节点的selinux
vi /etc/selinux/config
将SELINUX=enforcing改为SELINUX=disabled
设置后需要重启才能⽣效
安裝jdk
mkdir /usr/java
tar -zxvf jdk-8u212-linux-x64.tar.gz -C /usr/java/
#切记必须修正所属⽤户及⽤户组
chown -R root:root /usr/java/jdk1.8.0_212
echo “export JAVA_HOME=/usr/java/jdk1.8.0_212” >> /etc/profile
echo “export PATH=/usr/java/jdk1.8.0_212/bin:${PATH}” >> /etc/profile
source /etc/profile
which java
这三个
yum -y install wget
bash Anaconda3-2021.05-Linux-x86_64.sh
source ~/.bashrc
显卡驱动安装教程
1.安装依赖环境:
yum install kernel-devel gcc -y
2.检查内核版本和源码版本,保证一致
ls /boot | grep vmlinu
rpm -aq | grep kernel-devel
3.屏蔽系统自带的nouveau
查看命令:lsmod | grep nouveau
修改dist-blacklist.conf文件:
vim /lib/modprobe.d/dist-blacklist.conf
将nvidiafb注释掉:
#blacklist nvidiafb
然后添加以下语句:
blacklist nouveau
options nouveau modeset=0
屏蔽前
4.重建initramfs image步骤
mv /boot/initramfs- ( u n a m e − r ) . i m g / b o o t / i n i t r a m f s − (uname -r).img /boot/initramfs- (uname−r).img/boot/initramfs−(uname -r).img.bak
dracut /boot/initramfs-$(uname -r).img $(uname -r)
5.修改运行级别为文本模式
systemctl set-default multi-user.target
chmod +x NVIDIA-Linux-x86_64-460.91.03.run
./NVIDIA-Linux-x86_64-460.91.03.run --kernel-source-path=/usr/src/kernels/3.10.0-1160.el7.x86_64 -k $(uname -r)
安装cuda
bash cuda_11.2.0_460.27.04_linux.run
Pytorch 挖掘环境安装
conda config --set show_channel_urls yes
Vi .condarc
channels:
conda create -n dm python=3.8 -y
conda activate dm
https://pytorch.org/get-started/previous-versions/
conda install pytorch1.7.1 torchvision0.8.2 torchaudio==0.7.2 cudatoolkit=11.0 -c pytorch