Configure CentOS7 GPU environment

basic configuration##

  1. Install wget first
    yum -y install wget

  2. Create your own folder
    mkdir sunyan

Install Anoconda

  1. 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

  2. Install bzip2
    yum install -y bzip2

  3. Install Anoconda, yes all the way.
    bash Anaconda3-5.2.0-Linux-x86_64.sh

  4. Enable configuration
    source .bashrc

  5. Enter Python to see if the configuration is correct

Conda installs TesnorFlow GPU version##

  1. 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/

  2. 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 NVIDIA driver##

  1. Install gcc
    yum -y install gcc-c++

  2. Install Open JDK
    yum install java-1.8.0-openjdk java-1.8.0-openjdk-devel

  3. 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

  1. 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

  2. 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
  1. Rebuild the initramfs image
    mv /boot/initramfs-(uname -r).img /boot/initramfs-(uname -r).img.bak dracut /boot/initramfs-$(uname -r).img $(uname -r)

  2. Modify the run level to text mode

systemctl set-default multi-user.target
  1. Restart, log in as root user, you need to wait here, about 1 minute.
    sudo iptables stop reboot

  2. Check whether nouveau has been disabled. If no relevant content is displayed, it means it has been disabled.
    ls mod | grep nouveau

  3. 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

  4. 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

test##

  1. nvidia-smi test and TensorFlow test, just display GPU information. It doesn't matter if the warning is reported, it is a warning from TF itself, and it can also be solved by pip install h5py==2.8.0rc1. nvidia-smi python3 import tensorflow as tf sess = tf.Session()

  1. Replace PyPi as a domestic source
    pip install pqi pqi use tuna pqi show

  2. 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

Configure CentOS7 GPU environment
Centos7 configure nodejs environment
CentOS 7 configure Java language development environment
CentOS 7 configure Ruby language development environment
CentOS 7 configure php language development environment
Configure python3 environment on centos7 and
CentOS 7 configure Python language development environment
Centos7 configure JDK
CentOS6.7 build LNMP environment
Hadoop environment construction (centos7)
lamp (centos7) installation lamp environment
Centos6.9 install npm environment
Configure lamp under centos6.8
Centos7 configure IP address
Ubuntu18.10 configure Java environment
CentOS 7 build LNMP environment
[CentOS environment deployment] Java7/Java8 deployment under CentOS
Build docker environment under Centos6.5
CentOS 7 install JAVA environment (JDK 1.8)
SkyWalking study notes (CentOS environment)
Centos7 set up GitBook environment
CentOS 7.2 deploy Node.js development environment
CentOS install nginx+tomcat+java+mysql operating environment
Configure static IP under CentOS 7
Centos6.5 install and configure mongodb
Centos configure multiple virtual IP
Configure swap space on CentOS7
Centos6 set up GitBook environment
CentOS environment installation of Docker
Centos7 deploys python3 virtual environment
Centos configure multiple virtual IP
Install and configure keepalived under CentOS 5.9
Configure rsyslog log client on CentOS
CentOS 8 (2)
CentOS 6/7 configure sendEmail to send mail
CentOS7 compile and install L(A|N)MP environment
CentOS 8 - install and configure NFS service
CentOS 8 (1)
Build Nginx environment on Linux (CentOS)
CentOS Minimal install and configure TIPS
[python] python virtual environment construction & GPU environment
Install and configure FreeIPA in Centos7
FFmpeg environment deployment record under centos7
CentOS6.8 Chinese/English environment switching tutorial illustration
PPTP environment deployment record under Centos
Tomcat configuration JMX in centos 6.5 environment
Configure Nginx reverse proxy based on CentOS 7
Configure Nginx load balancing based on CentOS 7
The software environment required for Centos7 installation
Configure Nginx forward proxy based on CentOS 7
Configure iSCSI network storage under CentOS 7.x
Centos7.5 configuration java environment installation tomcat explanation
Centos-6.5 installation and deployment of LNMP environment
Configure Java development environment in Ubuntu20.04 LTS
CentOS7 configure static address, turn off firewall
(1) Centos7 installation to build a cluster environment
Deploy Docker and configure Nginx in CentOS
[PHP] Build a PHP operating environment under CentOS
Install CentOS7 virtual machine, configure docker suite
GPU programming (1): CUDA8.0 environment construction under Ubuntu
Configure Nginx + PHP 7.0 + MySQL environment under Ubuntu 16.04