Install wget first
yum -y install wget
Create your own folder
mkdir sunyan
Download Anoconda. Note that the latest Anoconda is version 3.7, but tensorflow has not been updated to 3.7. Here we install the python 3.6 version released in May 2018.
wget https://mirrors.tuna.tsinghua.edu.cn/anaconda/archive/Anaconda3-5.2.0-Linux-x86_64.sh
Install bzip2
yum install -y bzip2
Install Anoconda, yes all the way.
bash Anaconda3-5.2.0-Linux-x86_64.sh
Enable configuration
source .bashrc
Enter Python to see if the configuration is correct
Configure domestic conda source. Because cudnn and cuda are very large and conda is abroad, it is easy to cause download interruption. Here we configure the mirror image of the Chinese University of Science and Technology in China.
conda config --add channels https://mirrors.ustc.edu.cn/anaconda/pkgs/main/
installation
conda install tensorflow-gpu
My cuda version is 9.0, cudnn version is 7.1.2, and tensorflow-gpu version is 1.9.0.
Install gcc
yum -y install gcc-c++
Install Open JDK
yum install java-1.8.0-openjdk java-1.8.0-openjdk-devel
Check the graphics card driver and model
sudo rpm --import https://www.elrepo.org/RPM-GPG-KEY-elrepo.org sudo rpm -Uvh http://www.elrepo.org/elrepo-release-7.0-2.el7.elrepo.noarch.rpm sudo yum install nvidia-detect
Shown here is Tesla P4, 410.66 NVIDIA driver
Go to Official Website to download the corresponding driver
wget http://cn.download.nvidia.com/tesla/384.145/NVIDIA-Linux-x86_64-384.145.run
Shield the default nouveau, use the su command to switch to the root user, and then modify the /etc/modprobe.d/blacklist.conf file, if the system does not have this file, you need to create a new one.
su root echo -e "blacklist nouveau\noptions nouveau modeset=0" > /etc/modprobe.d/blacklist.conf
Then check the contents of the file:
cat /etc/modprobe.d/blacklist.conf
Rebuild the initramfs image
mv /boot/initramfs-
Modify the run level to text mode
systemctl set-default multi-user.target
Restart, log in as root user, you need to wait here, about 1 minute.
sudo iptables stop reboot
Check whether nouveau has been disabled. If no relevant content is displayed, it means it has been disabled.
ls mod | grep nouveau
Install kenel-devel
wget ftp://ftp.riken.jp/Linux/cern/centos/7/updates/x86_64/Packages/kernel-devel-3.10.0-693.17.1.el7.x86_64.rpm yum install kernel-devel-3.10.0-693.17.1.el7.x86_64.rpm
Install NVIDIA driver, just enter all the way
chmod +x NVIDIA-Linux-x86_64-384.145.run sh NVIDIA-Linux-x86_64-384.145.run
pip install h5py==2.8.0rc1
. nvidia-smi python3 import tensorflow as tf sess = tf.Session()Replace PyPi as a domestic source
pip install pqi pqi use tuna pqi show
Replace conda source with domestic source
conda config --add channels https://mirrors.ustc.edu.cn/anaconda/pkgs/main/ conda config --add channels https://mirrors.ustc.edu.cn/anaconda/pkgs/free/ conda config --add channels https://mirrors.ustc.edu.cn/anaconda/cloud/conda-forge/ conda config --add channels https://mirrors.ustc.edu.cn/anaconda/cloud/msys2/ conda config --add channels https://mirrors.ustc.edu.cn/anaconda/cloud/bioconda/ conda config --add channels https://mirrors.ustc.edu.cn/anaconda/cloud/menpo/ conda config --set show_channel_urls yes
Recommended Posts