Skip to content

Instantly share code, notes, and snippets.

@seominjoon
Last active January 20, 2017 22:00
Show Gist options
  • Save seominjoon/f541c4108f9df5e14d753387125813b3 to your computer and use it in GitHub Desktop.
Save seominjoon/f541c4108f9df5e14d753387125813b3 to your computer and use it in GitHub Desktop.
tensorflow-ec2
# On ubuntu 14.04
sudo apt-get update
sudo apt-get install -y linux-image-extra-`uname -r` linux-headers-`uname -r` linux-image-`uname -r`
mkdir tmp
cd tmp
# CUDA
wget http://developer.download.nvidia.com/compute/cuda/repos/ubuntu1404/x86_64/cuda-repo-ubuntu1404_7.5-18_amd64.deb
sudo dpkg -i cuda-repo-ubuntu1404_7.5-18_amd64.deb
sudo apt-get update
sudo apt-get install -y cuda-7-5
echo "export CUDA_HOME=/usr/local/cuda-7.5" >> ~/.bashrc
echo "export LD_LIBRARY_PATH=/usr/local/cuda-7.5/lib64:/usr/local/cuda-7.5/extras/CUPTI/lib64" >> ~/.bashrc
# CuDNN
wget https://s3-us-west-2.amazonaws.com/minjoon/cudnn/cudnn-7.5-linux-x64-v5.1.tgz
sudo tar -xvf cudnn-7.5-linux-x64-v5.1.tgz -C /usr/local
# Python
sudo apt-get install -y zlib1g-dev libsqlite3-dev libssl-dev libbz2-dev # Required libraries to install python and pip locally
wget https://www.python.org/ftp/python/3.5.3/Python-3.5.3.tgz
tar -zxvf Python-3.5.3.tgz
cd Python-3.5.3
./configure --prefix=/home/ubuntu/
make; make install
cd ..
wget https://bootstrap.pypa.io/get-pip.py
/home/ubuntu/bin/python3 get-pip.py
echo "export PATH=$HOME/bin/:$PATH" >> ~/.bashrc
source ~/.bashrc
# TensorFlow
# For 7.5 CUDA, 0.11rc0 is the easiest to install
export TF_BINARY_URL=https://storage.googleapis.com/tensorflow/linux/gpu/tensorflow-0.11.0rc0-cp35-cp35m-linux_x86_64.whl
pip3 install --upgrade $TF_BINARY_URL
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment