CentOS 7 Environment Configuration
1. Check GPU device recognition
$ yum install pciutils
$ sudo lspci | grep NVIDIA
3D controller: NVIDIA Corporation GK210GL [Tesla K80] indicates recognition as K80
3D controller: NVIDIA Corporation Device 1b38 (rev a1) indicates P40
2. Obtain the cuda network source and configure it
The official source address of NVidia is http://developer.download.nvidia.com/compute/cuda/repos/rhel7/x86_64/
$ wget http://developer.download.nvidia.com/compute/cuda/repos/rhel7/x86_64/cuda-repo-rhel7-8.0.61-1.x86_64.rpm
$ rpm -Uvh cuda-repo-rhel7-8.0.61-1.x86_64.rpm
Note: Installing the nvidia driver requires the kernel-devel package, which can be installed as follows:
$ wget http://vault.centos.org/7.0.1406/updates/x86_64/Packages/kernel-devel-3.10.0-123.4.4.el7.x86_64.rpm
$ wget http://vault.centos.org/7.0.1406/updates/x86_64/Packages/kernel-headers-3.10.0-123.4.4.el7.x86_64.rpm
$ rpm -Uvh kernel-devel-3.10.0-123.4.4.el7.x86_64.rpm
$ rpm -Uvh kernel-headers-3.10.0-123.4.4.el7.x86_64.rpm
3. Install cuda 8.0
$ yum install cuda-8-0
3.1 Check driver status
$ sudo nvidia-smi
4. Test the basic GPU functionality (optional)
4.1 Add LD path
$ export LD_LIBRARY_PATH="/usr/local/cuda-7.5/lib64:/usr/lib64/:$LD_LIBRARY_PATH"
4.2 Install cuda examples
$ cd /usr/local/cuda/bin
$ sh cuda-install-samples-8.0.sh ~/cuda-test/
$ cd ~/cuda-test/NVIDIA_CUDA-8.0_Samples
$ make
$ ./bin/x86_64/linux/release/deviceQuery To get device status
$ ./bin/x86_64/linux/release/bandwidthTest To test the device bandwidth
Note: If lnvcuvid error found during the compiling process, run:
$ find . -type f -execdir sed -i 's/UBUNTU_PKG_NAME = "nvidia-367"/UBUNTU_PKG_NAME = "nvidia-375"/g' '{}' \
In which nvidia-375 is the current installed driver version
5. Install cudnn
Optional, note: Different AI frameworks support different versions of cudnn
5.1 Download cudnn software package
, registration of nvidia account is required for downloading.
Note: Download cuDNN v5.1 Library for Linux for CentOS
5.2 Installation
Example using cudnn5.1, since TensorFlow currently only supports 5.1
$ tar -zxf cudnn-8.0-linux-x64-v5.1.tgz
The path for decompression can be freely chosen, generally under /usr/lib, here assume it as <CUDNN_INSTALL_PATH>
$ export LD_LIBRARY_PATH=:$LD_LIBRARY_PATH
FAQ
1. Why does nvidia-smi find the GPU usage is 100%?
This problem is due to the system’s inaccurate reading of the gpu status information. Executing the following command can correct it and allow the system to read the command correctly.
# nvidia-smi -pm 1