diff --git a/docs/building-nvcaffe.md b/docs/building-nvcaffe.md index 9b0854bdc..13e51fce9 100644 --- a/docs/building-nvcaffe.md +++ b/docs/building-nvcaffe.md @@ -8,7 +8,22 @@ The code is released in NVIDIA's caffe repo in the experimental/fp16 branch, loc #### 1. Installing Dependencies ``` bash -$ sudo apt-get install protobuf-compiler libprotobuf-dev cmake git libboost-thread1.55-dev libgflags-dev libgoogle-glog-dev libhdf5-dev libatlas-dev libatlas-base-dev libatlas3-base liblmdb-dev libleveldb-dev +$ sudo apt-get update -y +$ sudo apt-get install cmake -y + +# General dependencies +$ sudo apt-get install libprotobuf-dev libleveldb-dev libsnappy-dev \ +libhdf5-serial-dev protobuf-compiler -y +$ sudo apt-get install --no-install-recommends libboost-all-dev -y + +# BLAS +$ sudo apt-get install libatlas-base-dev -y + +# Remaining Dependencies +$ sudo apt-get install libgflags-dev libgoogle-glog-dev liblmdb-dev -y + +# Python Dependencies +$ sudo apt-get install python-dev python-numpy python-skimage python-protobuf -y ``` The Snappy package needs a symbolic link created for Caffe to link correctly: @@ -31,6 +46,7 @@ This will checkout the repo to a local directory called `caffe` on your Jetson. ``` bash $ cd caffe $ cp Makefile.config.example Makefile.config +$ rm -rf cmake/ CMakeLists.txt ``` ###### Enable FP16: @@ -51,14 +67,48 @@ $ sed -i 's/# USE_CUDNN/USE_CUDNN/g' Makefile.config $ sed -i 's/-gencode arch=compute_50,code=compute_50/-gencode arch=compute_53,code=sm_53 -gencode arch=compute_53,code=compute_53/g' Makefile.config ``` +###### Setup header/linker paths + +``` bash + INCLUDE_DIRS := $(PYTHON_INCLUDE) /usr/local/include + becomes + INCLUDE_DIRS := $(PYTHON_INCLUDE) /usr/local/include /usr/include/hdf5/serial/ + + LIBRARY_DIRS := $(PYTHON_LIB) /usr/local/lib /usr/lib + becomes + LIBRARY_DIRS := $(PYTHON_LIB) /usr/local/lib /usr/lib /usr/lib/aarch64-linux-gnu/hdf5/serial/ +``` + +###### Fix HDF5 Linking Issue + +``` bash +$ sudo ln -s /usr/lib/aarch64-linux-gnu/libhdf5_serial.so.10 /usr/lib/aarch64-linux-gnu/libhdf5.so +$ sudo ln -s /usr/lib/aarch64-linux-gnu/libhdf5_serial_hl.so.10 /usr/lib/aarch64-linux-gnu/libhdf5_hl.so +``` + #### 4. Compiling nvcaffe ``` bash -$ make all -$ make test +$ make -j4 +$ make pycaffe +$ make distribute +``` + +#### 5. Set environment paths + +``` bash +# Edit the following lines in .bashrc and then source .bashrc +export PATH=/usr/local/cuda-8.0/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/home/ubuntu/caffe/build/tools +export PYTHONPATH=/home/ubuntu/caffe/python:$PYTHONPATH +``` + +#### 6. Install iPython (optional) + +``` bash +$ sudo apt-get install ipython ipython-notebook python-pandas -y ``` -#### 5. Testing nvcaffe +#### 6. Testing nvcaffe ``` bash $ make runtest