Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Install Caffe on Amazon EC2 g2.2xlarge instance
#! /bin/bash
# Upgrade
sudo aptitude update
sudo aptitude full-upgrade -y
# Install CUDA
wget http://developer.download.nvidia.com/compute/cuda/repos/ubuntu1404/x86_64/cuda-repo-ubuntu1404_6.5-14_amd64.deb
sudo dpkg -i cuda-repo-ubuntu1404_6.5-14_amd64.deb
sudo aptitude update
sudo aptitude install -y linux-image-extra-virtual
sudo aptitude install -y cuda # Takes a lot of time
echo 'export PATH=/usr/local/cuda/bin:$PATH' >> .bashrc
echo 'export LD_LIBRARY_PATH=/usr/local/cuda/lib64:/usr/local/lib:$LD_LIBRARY_PATH' >> .bashrc
source .bashrc
sudo reboot
# Caffe dependencies
sudo apt-get install libatlas-base-dev
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
# CuDNN
cd cuDNN # Replace with CuDNN path
sudo cpcudnn.h /usr/local/include
sudo cp *so* /usr/local/lib
sudo cp libcudnn_static.a /usr/local/lib
# Clone and install Caffe
sudo apt-get install git
git clone https://github.com/BVLC/caffe.git
cd caffe
cp Makefile.config.example Makefile.config
make all -j8
make test -j8
make runtest # Checks whether it's all OK
@mrgloom

This comment has been minimized.

Copy link

mrgloom commented Feb 26, 2016

Small mistake sudo cpcudnn.h /usr/local/include -> sudo cp cudnn.h /usr/local/include ?

@boydlever

This comment has been minimized.

Copy link

boydlever commented Aug 28, 2016

But how about a CNN path?

@boydlever

This comment has been minimized.

Copy link

boydlever commented Aug 28, 2016

I expect you are going to build a phenomenal product.

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.