Skip to content

Instantly share code, notes, and snippets.

@codingneo
Last active April 23, 2016 16:14
Show Gist options
  • Save codingneo/b193c7388f320c27ff100eda18d2205d to your computer and use it in GitHub Desktop.
Save codingneo/b193c7388f320c27ff100eda18d2205d to your computer and use it in GitHub Desktop.
Setup Tensorflow GPU Instance on AWS EC2
  1. Launch the g2.2xlarge instance, select a security group with SSH rule
  2. ssh to the instance
ssh -i [pem file] ubuntu@[Public DNS of the instance]
  1. Update the locale
export LC_ALL="en_US.UTF-8"
export LC_CTYPE="en_US.UTF-8"
sudo dpkg-reconfigure locales
  1. Follow this to install CUDA 7.5
  2. Install CuDNN V5
  3. Download cudnn-7.5-linux-x64-v5.0-rc.tgz from Nvidia Download Page
  4. Upload cudnn-7.5-linux-x64-v5.0-rc.tgz to AWS instance via scp
scp -i [pem file] cudnn-7.5-linux-x64-v5.0-rc.tgz ubuntu@[Public DNS]:[file path]
  1. Unzip the tar file
tar zxvf ./cudnn-7.5-linux-x64-v5.0-rc.tgz
  1. Copy the file to CUDA_ROOT folder
sudo cp ./cuda/include/cudnn.h /usr/local/cuda-7.5/include
sudo cp ./cuda/lib64/libcudnn* /usr/local/cuda-7.5/lib64
  1. Export the environment variables about CUDA and CuDNN by adding the following into ~/.bashrc and source it
export CUDA_HOME=/usr/local/cuda
export CUDA_ROOT=/usr/local/cuda
export PATH=$PATH:$CUDA_ROOT/bin
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$CUDA_ROOT/lib64
  1. Install pip
sudo apt-get install python-pip python-dev
sudo pip install -U pip
  1. Install tensorflow with GPU enabled (r0.8)
sudo pip install --upgrade https://storage.googleapis.com/tensorflow/linux/gpu/tensorflow-0.8.0-cp27-none-linux_x86_64.whl
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment