Skip to content

Instantly share code, notes, and snippets.

@dennybritz
Last active April 14, 2017 14:19
Show Gist options
  • Save dennybritz/f37ae8b740d09b221fb103a3a04124a3 to your computer and use it in GitHub Desktop.
Save dennybritz/f37ae8b740d09b221fb103a3a04124a3 to your computer and use it in GitHub Desktop.
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
@mtthss
Copy link

mtthss 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