Created
July 11, 2018 10:26
-
-
Save adujardin/edae26afbfe8e9971226187313a7ca8a to your computer and use it in GitHub Desktop.
Install cuDNN on linux
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
set -e | |
NONE='\x1b[m' | |
BOLD='\x1b[1m' | |
RED='\x1b[31m' | |
ITALIC='\x1b[3m' | |
tmp_folder="/tmp/cudnn_install" | |
cuda_installation_path="/usr/local/cuda" | |
mkdir -p ${tmp_folder} | |
rm -rf ${tmp_folder:?}/* | |
echo -e "${BOLD}Extracting cuDNN archive...${NONE}${ITALIC}" | |
tar zxvf cudnn*.tgz -C ${tmp_folder} | |
if [ ! -d "$cuda_installation_path" ]; then | |
echo -e "${NONE}${BOLD}${RED}CUDA installation folder not found!${NONE}" | |
exit 1 | |
fi | |
echo -e "${NONE}${BOLD}Installing cuDNN files...${NONE}${ITALIC}" | |
sudo rsync --recursive -luv --ignore-existing ${tmp_folder}/cuda/include ${cuda_installation_path}/ | |
sudo rsync --recursive -luv --ignore-existing ${tmp_folder}/cuda/lib64 ${cuda_installation_path}/ | |
echo -e "${NONE}${BOLD}All done !${NONE}" | |
rm -rf ${tmp_folder:?}/* | |
tput sgr0 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment