Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Tensorflow 0.9 on AWS GPU instance installation
# Install build tools
sudo apt-get update
sudo apt-get install -y build-essential git python-pip libfreetype6-dev libxft-dev libncurses-dev libopenblas-dev gfortran python3-matplotlib libblas-dev liblapack-dev libatlas-base-dev python3-dev python3-pydot linux-headers-generic linux-image-extra-virtual unzip python3-numpy swig python3-pandas python-sklearn unzip python3-pip python3-venv
# Install CUDA 7
# wget http://developer.download.nvidia.com/compute/cuda/repos/ubuntu1410/x86_64/cuda-repo-ubuntu1410_7.0-28_amd64.deb
wget http://developer.download.nvidia.com/compute/cuda/repos/ubuntu1504/x86_64/cuda-repo-ubuntu1504_7.5-18_amd64.deb
sudo dpkg -i cuda-repo-ubuntu1504_7.5-18_amd64.deb && rm cuda-repo-ubuntu1504_7.5-18_amd64.deb
sudo apt-get update
sudo apt-get install -y cuda
# Install cuDNN
# You get the CUDNN_URL by logging into your nivida account and downloading cuDNN
# https://developer.nvidia.com/rdp/cudnn-archive (cudnn 7.0)
export CUDNN_URL=""
wget $CUDNN_URL -O cudnn-7.0-linux-x64-v3.0-prod.tgz
tar -zxf cudnn-7.0-linux-x64-v3.0-prod.tgz && rm cudnn-7.0-linux-x64-v3.0-prod.tgz
sudo cp ./cuda/lib64/* /usr/local/cuda/lib64/
sudo cp ./cuda/include/* /usr/local/cuda/include/
# Reboot for CUDA
sudo reboot
# Create virtualenv
pyvenv-3.4 ~/tf
source ~/tf/bin/activate
export TF_BINARY_URL=https://storage.googleapis.com/tensorflow/linux/gpu/tensorflow-0.9.0-cp34-cp34m-linux_x86_64.whl
pip install -U pip
pip install -U $TF_BINARY_URL
pip install jupyter ipython numpy pandas scikit-learn
# Set CUDA env vars
export CUDA_HOME=/usr/local/cuda
export CUDA_ROOT=$CUDA_HOME
export PATH=$PATH:$CUDA_ROOT/bin
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$CUDA_ROOT/lib64
@DarylWM

This comment has been minimized.

Copy link

commented May 3, 2016

Thanks for sharing this. Some tweaks to get it to work for me: the latest CuDNN that I could see was cudnn-7.0-linux-x64-v4.0-prod.tgz. Also apt-get didn't have any luck finding python3-pydot, so I just removed it.

@mtthss

This comment has been minimized.

Copy link

commented Oct 16, 2016

does this work on a clean aws instance of Ubuntu Server 14.04?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.