Skip to content

Instantly share code, notes, and snippets.

@harvitronix
Forked from chaser92/install_tensorflow_p2.sh
Last active March 10, 2017 17:06
Show Gist options
  • Save harvitronix/877f71f237525c0627c2e570596682f1 to your computer and use it in GitHub Desktop.
Save harvitronix/877f71f237525c0627c2e570596682f1 to your computer and use it in GitHub Desktop.
Install TensorFlow and Anaconda on an Amazon EC2 P2
# Forked from https://gist.github.com/chaser92/3f50d75170050abc3cb463b2be04262b
# BEFORE STARTING PUT libcudnn5_5.1.10-1+cuda8.0_amd64.deb AND libcudnn5-dev_5.1.10-1+cuda8.0_amd64.deb IN /tmp
# OTHERWISE THIS WON'T WORK
# These are actually the Ubuntu 14.04 deb files. The 16.06 won't work with the below.
pushd /tmp &&
stat libcudnn5_5.1.10-1+cuda8.0_amd64.deb &&
stat libcudnn5-dev_5.1.10-1+cuda8.0_amd64.deb &&
echo "export LC_ALL=\"en_US.UTF-8\"" > ~/.profile &&
echo "export LC_CTYPE=\"en_US.UTF-8\"" > ~/.profile &&
source ~/.profile &&
sudo dpkg-reconfigure --frontend=noninteractive locales &&
sudo apt-get update &&
sudo apt-get upgrade -y &&
sudo apt-get install -y build-essential git libfreetype6-dev \
libxft-dev libncurses-dev libopenblas-dev gfortran libblas-dev \
liblapack-dev libatlas-base-dev python3-dev linux-headers-generic \
linux-image-extra-virtual unzip swig unzip \
wget pkg-config zip g++ zlib1g-dev libcurl3-dev &&
sudo pip3 install -U pip &&
wget "https://developer.nvidia.com/compute/cuda/8.0/prod/local_installers/cuda-repo-ubuntu1604-8-0-local_8.0.44-1_amd64-deb" &&
sudo dpkg -i cuda-repo-ubuntu1604-8-0-local_8.0.44-1_amd64-deb &&
rm cuda-repo-ubuntu1604-8-0-local_8.0.44-1_amd64-deb &&
sudo apt-get update &&
sudo apt-get install -y cuda &&
sudo dpkg -i libcudnn5_5.1.10-1+cuda8.0_amd64.deb &&
sudo dpkg -i libcudnn5-dev_5.1.10-1+cuda8.0_amd64.deb &&
echo "export CUDA_HOME=/usr/local/cuda" >> ~/.profile &&
echo "export CUDA_ROOT=/usr/local/cuda" >> ~/.profile &&
echo "export PATH=\$PATH:\$CUDA_ROOT/bin" >> ~/.profile &&
echo "export LD_LIBRARY_PATH=\$LD_LIBRARY_PATH:\$CUDA_ROOT/lib64" >> ~/.profile &&
source ~/.profile &&
sudo pip3 install tensorflow-gpu &&
popd &&
echo "TF Installation finished."
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment