@centos7安裝N卡驅動和conda pytorch1.7.1深度學習環境
centos7安裝N卡驅動和conda pytorch1.7.1深度學習環境
這是 centos7安裝N卡驅動和conda深度學習環境,
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
6.重新啟動
reboot
屏蔽后


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:
- defaults
show_channel_urls: true
default_channels: - https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/main
- https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/r
- https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/msys2
custom_channels:
conda-forge: https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud
msys2: https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud
bioconda: https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud
menpo: https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud
pytorch: https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud
simpleitk: https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud
conda clean -i


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
轉載請註明出處,本文鏈接:https://www.uj5u.com/qita/384122.html
標籤:AI
上一篇:深度神經網路壓縮和加速詳解
