Instance: p2.xlarge
AMI ID: ubuntu/images/hvm-ssd/ubuntu-xenial-16.04-amd64-server-20170221
EBS volume for root: 30GB
sudo apt-get install libprotobuf-dev libleveldb-dev libsnappy-dev libopencv-dev libhdf5-serial-dev protobuf-compiler
sudo apt-get install --no-install-recommends libboost-all-dev
sudo apt-get install python-dev
sudo apt-get install libgflags-dev libgoogle-glog-dev liblmdb-dev
sudo apt-get install libatlas-base-dev
sudo apt-get install python-pip
sudo pip install numpy
Download and install CUDA from Nvidia
Download and install cuDNN from Nvidia
Make sure LD_LIBRARY_PATH is correctly set.
Ref: BVLC/caffe#2347
Add hdf5 include path to Makefile.config.
INCLUDE_DIRS := $(PYTHON_INCLUDE) /usr/local/include /usr/include/hdf5/serial/
Create symlinks of lib files.
cd /usr/lib/x86_64-linux-gnu
sudo ln -s libhdf5_serial.so.8.0.2 libhdf5.so
sudo ln -s libhdf5_serial_hl.so.8.0.2 libhdf5_hl.so
Checkout caffe repo with git.
Setup correct variables in Makefile.config.
Make sure numpy include path is correctly set
E.g.,
PYTHON_INCLUDE := /usr/include/python2.7 \
/usr/lib/python2.7/dist-packages/numpy/core/include \
/usr/local/lib/python2.7/dist-packages/numpy/core/include
Add cuDNN include & lib path to INCLUDE_DIRS & LIBRARY_DIRS.
E.g.,
INCLUDE_DIRS := $(PYTHON_INCLUDE) /usr/local/include /home/ubuntu/cuda/include /usr/include/hdf5/serial/
LIBRARY_DIRS := $(PYTHON_LIB) /usr/local/lib /usr/lib /home/ubuntu/cuda/lib64
Compile caffe:
make all
make test
make runtest
make pycaffe
sudo pip install jupyter
sudo pip install scipy matplotlib
sudo pip install scikit-image
sudo pip install protobuf
jupyter notebook --ip="public domainname of ec2 instance"
Basically, a computing machine prepared with above steps are also ready for TensorFlow installation, except for Bazel
and maybe libcupti-dev
.