Carry an installation guide, memo

CUDA

First, I downloaded CUDA according to the actual situation of the system. Here, I downloaded CUDA version 9.0

1. Check whether a GPU is installed.

   lspci | grep -i nvidia  
Copy the code

2. Install GCC and g++ compilers

   sudo yum install gcc    
   sudo yum install gcc-c++  
Copy the code

3. Install the kernel – devel

 sudo yum install kernel-devel  
Copy the code

4. Install Driver, Toolkit, and Samples

Sudo sh cuda_9. 0.176 _384. 81 _linux - run. RunCopy the code

In this case, we have installed the matching Driver by ourselves, so when the first Driver comes out, select N followed by Y

5. Add the following content to the. Bashrc file in the user root directory:

export PATH=$PATH:/usr/local/ cuda - 9.0 / binexport LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/local/cuda-9.0/lib64 Save and exitsourceBashrc (immediate effect file) If it is a full environment variable (available to all users), you need to add the above sentence to the /etc/profile fileCopy the code

CUDNN

1. Select the appropriate version (corresponding to CUDA version)

2. Unzip CUDNN

The tar - XZVF cudnn - 9.0 - Linux - x64 - v7.1. TGZCopy the code

Copy related files to cudA-specific directory (my CUDA installation directory is /usr/local/cuda-9.0/)

sudo cp cuda/include/cudnn.h /usr/local/cuda-9.0/include
sudo cp cuda/lib64/libcudnn* /usr/local/ cuda - 9.0 / lib64Copy the code

Modifying file Permissions

sudo chmod a+r /usr/local/ cuda - 9.0 / include/cudnn. H/usr /local/ cuda - 9.0 / lib64 / libcudnn *Copy the code

Reference

  • www.jianshu.com/p/a201b91b3…