Skip to content

Instantly share code, notes, and snippets.

@821760408-sp
Forked from joyofdata/digits.md
Last active September 6, 2016 18:08
Show Gist options
  • Save 821760408-sp/e8326e79f298795cfc8347fa2b8dae69 to your computer and use it in GitHub Desktop.
Save 821760408-sp/e8326e79f298795cfc8347fa2b8dae69 to your computer and use it in GitHub Desktop.
Installing CUDA, cuDNN, caffe and DIGITS on EC2

Preliminary Updates and Installations

(http://markus.com/install-theano-on-aws/)

sudo apt-get update

sudo apt-get -y dist-upgrade  

sudo apt-get install -y gcc g++ gfortran build-essential git wget linux-generic libopenblas-dev python-dev python-pip python-nose python-numpy python-scipy python3-dev python3-pip python3-nose python3-numpy python3-scipy

Installing NVIDIA CUDA

(http://developer.download.nvidia.com/compute/cuda/7.5/Prod/docs/sidebar/CUDA_Installation_Guide_Linux.pdf)


sudo 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

echo -e "\nexport PATH=/usr/local/cuda-7.5/bin:$PATH\n\nexport LD_LIBRARY_PATH=/usr/local/cuda-7.5/lib64:$LD_LIBRARY_PATH" >> .bashrc

sudo reboot

cuda-install-samples-7.5.sh ~/

cd NVIDIA\_CUDA-7.5\_Samples
make
./bin/x86_64/linux/release/deviceQuery

Installing cuDNN

(https://developer.nvidia.com/cuDNN)

scp -i  ~/.ssh/aws.pem ~/Downloads/cudnn-7.5-linux-x64-v5.1.tgz ubuntu@ec2-54-159-0-45.compute-1.amazonaws.com:/home/ubuntu

tar xf cudnn-7.5-linux-x64-v5.1.tgz

echo -e "\nexport LD_LIBRARY_PATH=/home/ubuntu/cuda:$LD_LIBRARY_PATH" >> ~/.bashrc

sudo cp cuda/include/cudnn.h /usr/local/cuda-7.0/include
sudo cp cuda/lib64/libcudnn* /usr/local/cuda-7.0/lib64

(http://caffe.berkeleyvision.org/installation.html#compilation)


Installing caffe

(http://caffe.berkeleyvision.org/install_apt.html)

sudo apt-get install libprotobuf-dev libleveldb-dev libsnappy-dev libopencv-dev libboost-all-dev libhdf5-serial-dev
sudo apt-get install libgflags-dev libgoogle-glog-dev liblmdb-dev protobuf-compiler
sudo apt-get install libatlas-base-dev

git clone --branch v0.11.0 https://github.com/NVIDIA/caffe.git

cd ~/caffe/python
for req in $(cat requirements.txt); do sudo pip install $req; done

cd ~/caffe
cp Makefile.config.example Makefile.config

make all
make py
make test
make runtest

echo -e "\nexport CAFFE_HOME=/home/ubuntu/caffe" >> ~/.bashrc

Installing DIGITS

(http://on-demand.gputechconf.com/gtc/2015/webinar/gtc-express-digits-webinar.pdf) (https://devtalk.nvidia.com/default/topic/826167/announcements/recordings-of-new-gpu-computing-webinars-now-available-/)

git clone https://github.com/NVIDIA/DIGITS.git digits
cd digits
sudo apt-get install graphviz gunicorn
for req in $(cat requirements.txt); do sudo pip install $req; done

chmod -R 777 /home/ubuntu/.digits
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment