#! /bin/bash # Require manual intervention # Refer to https://gist.github.com/lyastro/26e0cd8245bcf64914857dd5e8445724 # Preliminary requirement: # CUDA GPU(s) is (are) present # gcc gcc-c++ python-pip python-devel atlas atlas-devel gcc-gfortran openssl-devel libffi-devel are present # Mandatory requirement: # NVIDIA CUDA toolkit and driver version 10.1 are installed. For CentOS 7.5, it is found out that nvidia cuda driver version 10.1 will work. # To install cuda-10.1, refer http://comsics.usm.my/tlyoon/configrepo/howto/customise_centos/customize_centos_part2.txt # Download from https://developer.nvidia.com/rdp/cudnn-download to download the latest cuDNN Library for Linux. # The link to the cudnn date (20 Apr 2019) is for v7.5.0.56 at # https://developer.nvidia.com/compute/machine-learning/cudnn/secure/v7.5.0.56/prod/10.1_20190225/cudnn-10.1-linux-x64-v7.5.0.56.tgz # For the sake of installation convenience, cudnn from nvidia.com version v7.5.0.56 for linux, cudnn-10.1-linux-x64-v7.5.0.56.tgz, has been readily downloaded and stored in the following shared dropbox link which can be wget automatically # https://www.dropbox.com/s/yuw8t197dpdt7zt/cudnn-10.1-linux-x64-v7.5.0.56.tgz?dl=0 cd /share/apps/configrepo mkdir cudnn-10.1-linux-x64-v7.5.0.56 cd cudnn-10.1-linux-x64-v7.5.0.56 wget https://www.dropbox.com/s/yuw8t197dpdt7zt/cudnn-10.1-linux-x64-v7.5.0.56.tgz?dl=0 -O cudnn-10.1-linux-x64-v7.5.0.56.tgz tar -zxf cudnn-10.1-linux-x64-v7.5.0.56.tgz ### or any newer version cd cuda cp include/cudnn.h /usr/local/cuda-10.1/include/ cp lib64/libcudnn* /usr/local/cuda-10.1/lib64/. chmod a+x /usr/local/cuda-10.1/include/cudnn.h /usr/local/cuda-10.1/lib64/libcudnn* pip install --upgrade pip ### pip install cudatoolkit cudnn ### won't work pip install tensorflow-gpu keras numba numpy matplotlib scipy pip install ipython # Check Tensorflow with ipython ipython ## In [1]: import tensorflow as tf ## In [2]: sess = tf.Session(config=tf.ConfigProto(log_device_placement=True)) ## check nvidia-smi to see GPU status.