Skip to content

Instantly share code, notes, and snippets.

@baraldilorenzo
Last active December 9, 2017 21:53
Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 8 You must be signed in to fork a gist
  • Save baraldilorenzo/5cce8087dbae098aa5a6 to your computer and use it in GitHub Desktop.
Save baraldilorenzo/5cce8087dbae098aa5a6 to your computer and use it in GitHub Desktop.
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
Copy link

mrgloom commented Feb 26, 2016

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

@boydlever
Copy link

But how about a CNN path?

@boydlever
Copy link

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