Skip to content

Commit 4e9766f

Browse files
bushibushigineshidalgo99
authored andcommitted
Jetson TX2 JetPack 3.1 install scripts (#245)
* Install scripts and configurations for Jetson TX2 with JetPack 3.1 * All working, fixed missing warning message. * Added documentation for Jetson TX2 installation. * Rename Makefile.config.Ubuntu16_cuda8.JetsonTX2 to Makefile.config.Ubuntu16_cuda8_JetsonTX2 * Rename Makefile.config.Ubuntu16_cuda8.JetsonTX2 to Makefile.config.Ubuntu16_cuda8_JetsonTX2 * Update installation_jetson_tx2.md * Update install_openpose_JetsonTX2_JetPack3.1.sh * Update install_caffe_JetsonTX2_JetPack3.1.sh
1 parent 3c73f2d commit 4e9766f

6 files changed

+459
-0
lines changed
Lines changed: 129 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,129 @@
1+
## Refer to http://caffe.berkeleyvision.org/installation.html
2+
# Contributions simplifying and improving our build system are welcome!
3+
4+
# cuDNN acceleration switch (uncomment to build with cuDNN).
5+
USE_CUDNN := 1
6+
7+
# CPU-only switch (uncomment to build without GPU support).
8+
# CPU_ONLY := 1
9+
10+
# uncomment to disable IO dependencies and corresponding data layers
11+
# USE_OPENCV := 0
12+
# USE_LEVELDB := 0
13+
# USE_LMDB := 0
14+
15+
# uncomment to allow MDB_NOLOCK when reading LMDB files (only if necessary)
16+
# You should not set this flag if you will be reading LMDBs with any
17+
# possibility of simultaneous read and write
18+
# ALLOW_LMDB_NOLOCK := 1
19+
20+
# Uncomment if you're using OpenCV 3
21+
# OPENCV_VERSION := 3
22+
23+
# To customize your choice of compiler, uncomment and set the following.
24+
# N.B. the default for Linux is g++ and the default for OSX is clang++
25+
# CUSTOM_CXX := g++
26+
27+
# CUDA directory contains bin/ and lib/ directories that we need.
28+
CUDA_DIR := /usr/local/cuda
29+
# On Ubuntu 14.04, if cuda tools are installed via
30+
# "sudo apt-get install nvidia-cuda-toolkit" then use this instead:
31+
# CUDA_DIR := /usr
32+
33+
# CUDA architecture setting: going with all of them.
34+
# For CUDA < 6.0, comment the *_50 through *_61 lines for compatibility.
35+
# For CUDA < 8.0, comment the *_60 and *_61 lines for compatibility.
36+
CUDA_ARCH := -gencode arch=compute_30,code=sm_30 \
37+
-gencode arch=compute_35,code=sm_35 \
38+
-gencode arch=compute_50,code=sm_50 \
39+
-gencode arch=compute_52,code=sm_52 \
40+
-gencode arch=compute_60,code=sm_60 \
41+
-gencode arch=compute_61,code=sm_61 \
42+
-gencode arch=compute_61,code=compute_61
43+
# Deprecated
44+
# CUDA_ARCH := -gencode arch=compute_20,code=sm_20 \
45+
# -gencode arch=compute_20,code=sm_21 \
46+
# -gencode arch=compute_30,code=sm_30 \
47+
# -gencode arch=compute_35,code=sm_35 \
48+
# -gencode arch=compute_50,code=sm_50 \
49+
# -gencode arch=compute_52,code=sm_52 \
50+
# -gencode arch=compute_60,code=sm_60 \
51+
# -gencode arch=compute_61,code=sm_61 \
52+
# -gencode arch=compute_61,code=compute_61
53+
54+
# BLAS choice:
55+
# atlas for ATLAS (default)
56+
# mkl for MKL
57+
# open for OpenBlas
58+
BLAS := atlas
59+
# Custom (MKL/ATLAS/OpenBLAS) include and lib directories.
60+
# Leave commented to accept the defaults for your choice of BLAS
61+
# (which should work)!
62+
# BLAS_INCLUDE := /path/to/your/blas
63+
# BLAS_LIB := /path/to/your/blas
64+
65+
# Homebrew puts openblas in a directory that is not on the standard search path
66+
# BLAS_INCLUDE := $(shell brew --prefix openblas)/include
67+
# BLAS_LIB := $(shell brew --prefix openblas)/lib
68+
69+
# This is required only if you will compile the matlab interface.
70+
# MATLAB directory should contain the mex binary in /bin.
71+
# MATLAB_DIR := /usr/local
72+
# MATLAB_DIR := /Applications/MATLAB_R2012b.app
73+
74+
# NOTE: this is required only if you will compile the python interface.
75+
# We need to be able to find Python.h and numpy/arrayobject.h.
76+
PYTHON_INCLUDE := /usr/include/python2.7 \
77+
/usr/lib/python2.7/dist-packages/numpy/core/include \
78+
/usr/local/lib/python2.7/dist-packages/numpy/core/include
79+
# Anaconda Python distribution is quite popular. Include path:
80+
# Verify anaconda location, sometimes it's in root.
81+
# ANACONDA_HOME := $(HOME)/anaconda
82+
# PYTHON_INCLUDE := $(ANACONDA_HOME)/include \
83+
# $(ANACONDA_HOME)/include/python2.7 \
84+
# $(ANACONDA_HOME)/lib/python2.7/site-packages/numpy/core/include
85+
86+
# Uncomment to use Python 3 (default is Python 2)
87+
# PYTHON_LIBRARIES := boost_python3 python3.5m
88+
# PYTHON_INCLUDE := /usr/include/python3.5m \
89+
# /usr/lib/python3.5/dist-packages/numpy/core/include
90+
91+
# We need to be able to find libpythonX.X.so or .dylib.
92+
PYTHON_LIB := /usr/lib /usr/local/lib
93+
# PYTHON_LIB := $(ANACONDA_HOME)/lib
94+
95+
# Homebrew installs numpy in a non standard path (keg only)
96+
# PYTHON_INCLUDE += $(dir $(shell python -c 'import numpy.core; print(numpy.core.__file__)'))/include
97+
# PYTHON_LIB += $(shell brew --prefix numpy)/lib
98+
99+
# Uncomment to support layers written in Python (will link against Python libs)
100+
# WITH_PYTHON_LAYER := 1
101+
102+
# Whatever else you find you need goes here.
103+
INCLUDE_DIRS := $(PYTHON_INCLUDE) /usr/local/include /usr/include/hdf5/serial
104+
LIBRARY_DIRS := $(PYTHON_LIB) /usr/local/lib /usr/lib /usr/lib/aarch64-linux-gnu /usr/lib/aarch64-linux-gnu/hdf5/serial
105+
106+
# If Homebrew is installed at a non standard location (for example your home directory) and you use it for general dependencies
107+
# INCLUDE_DIRS += $(shell brew --prefix)/include
108+
# LIBRARY_DIRS += $(shell brew --prefix)/lib
109+
110+
# NCCL acceleration switch (uncomment to build with NCCL)
111+
# https://github.com/NVIDIA/nccl (last tested version: v1.2.3-1+cuda8.0)
112+
# USE_NCCL := 1
113+
114+
# Uncomment to use `pkg-config` to specify OpenCV library paths.
115+
# (Usually not necessary -- OpenCV libraries are normally installed in one of the above $LIBRARY_DIRS.)
116+
# USE_PKG_CONFIG := 1
117+
118+
# N.B. both build and distribute dirs are cleared on `make clean`
119+
BUILD_DIR := build
120+
DISTRIBUTE_DIR := distribute
121+
122+
# Uncomment for debugging. Does not work on OSX due to https://github.com/BVLC/caffe/issues/171
123+
# DEBUG := 1
124+
125+
# The ID of the GPU that 'make runtest' will use to run unit tests.
126+
TEST_GPUID := 0
127+
128+
# enable pretty build (comment to see full commands)
129+
Q ?= @
Lines changed: 69 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,69 @@
1+
#!/bin/bash
2+
3+
4+
5+
echo "------------------------- Installing Caffe -------------------------"
6+
echo "NOTE: This script assumes that just flashed JetPack 3.1 : Ubuntu 16, CUDA 8, cuDNN 6 and OpenCV are already installed on your machine. Otherwise, it might fail."
7+
8+
9+
10+
function exitIfError {
11+
if [[ $? -ne 0 ]] ; then
12+
echo ""
13+
echo "------------------------- -------------------------"
14+
echo "Errors detected. Exiting script. The software might have not been successfully installed."
15+
echo "------------------------- -------------------------"
16+
exit 1
17+
fi
18+
}
19+
20+
21+
22+
echo "------------------------- Checking Ubuntu Version -------------------------"
23+
# If you respected the installation assumptions, nothing to do.
24+
echo "------------------------- Ubuntu Version Checked -------------------------"
25+
echo ""
26+
27+
28+
29+
echo "------------------------- Checking Number of Processors -------------------------"
30+
NUM_CORES=$(grep -c ^processor /proc/cpuinfo 2>/dev/null || sysctl -n hw.ncpu)
31+
echo "$NUM_CORES cores"
32+
exitIfError
33+
echo "------------------------- Number of Processors Checked -------------------------"
34+
echo ""
35+
36+
37+
38+
echo "------------------------- Installing some Caffe Dependencies -------------------------"
39+
# Basic
40+
sudo apt-get --assume-yes update
41+
sudo apt-get --assume-yes install build-essential
42+
# General dependencies
43+
sudo apt-get --assume-yes install libprotobuf-dev libleveldb-dev libsnappy-dev libhdf5-serial-dev protobuf-compiler libatlas-base-dev
44+
sudo apt-get --assume-yes install --no-install-recommends libboost-all-dev
45+
sudo apt-get --assume-yes install libgflags-dev libgoogle-glog-dev liblmdb-dev
46+
# Python libs
47+
sudo apt-get --assume-yes install python-pip python-dev build-essential
48+
sudo -H pip install --upgrade pip
49+
sudo -H pip install --upgrade numpy protobuf
50+
# OpenCV is provided for tegra in JetPack
51+
exitIfError
52+
echo "------------------------- Some Caffe Dependencies Installed -------------------------"
53+
echo ""
54+
55+
56+
57+
echo "------------------------- Compiling Caffe -------------------------"
58+
cp Makefile.config.Ubuntu16_cuda8_JetsonTX2 Makefile.config
59+
make all -j$NUM_CORES && make distribute -j$NUM_CORES
60+
# make test -j$NUM_CORES
61+
# make runtest -j$NUM_CORES
62+
exitIfError
63+
echo "------------------------- Caffe Compiled -------------------------"
64+
echo ""
65+
66+
67+
68+
echo "------------------------- Caffe Installed -------------------------"
69+
echo ""

doc/installation_jetson_tx2.md

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
OpenPose Library - Compilation and Installation on Nvidia Jetson TX2
2+
====================================
3+
4+
## Contents
5+
1. [Requirements](#requirements)
6+
2. [Installation](#installation)
7+
3. [Usage](#usage)
8+
9+
10+
## Requirements
11+
Jetson TX2 just flashed with [JetPack 3.1](https://developer.nvidia.com/embedded/jetpack)
12+
13+
Notes :
14+
15+
- Installation is similar to Jetson TX1 and you can follow this [video tutorial](https://www.youtube.com/watch?v=RJkOGMC8IrY).
16+
- If you are installing from a virtual machine host, installation may need to be done in two steps, please refer to [this solution](https://devtalk.nvidia.com/default/topic/1002081/jetson-tx2/jetpack-3-0-install-with-a-vm/).
17+
- Be sure to complete both OS flashing and CUDA / cuDNN installation parts before installation.
18+
19+
20+
## Installation
21+
Use the following script for installation of both caffe and OpenPose:
22+
```
23+
./ubuntu/install_caffe_and_openpose_JetsonTX2_JetPack3.1.sh
24+
```
25+
26+
## Usage
27+
It is for now recommended to use an external camera with the demo. To get to decent FPS you need to lower the net resolution:
28+
```
29+
./build/openpose/openpose.bin -camera_resolution 640x480 -net_resolution 128x96
30+
```
31+
32+
To activate hand or face resolution please complete this command with the following options (warning, both simultaneously will cause out of memory error):
33+
```
34+
--hand -hand_net_resolution 256x256
35+
--face -face_net_resolution 256x256
36+
```
Lines changed: 101 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,101 @@
1+
## Refer to http://caffe.berkeleyvision.org/installation.html
2+
# Contributions simplifying and improving our build system are welcome!
3+
4+
# cuDNN acceleration switch (uncomment to build with cuDNN).
5+
USE_CUDNN := 1
6+
7+
# CPU-only switch (uncomment to build without GPU support).
8+
# CPU_ONLY := 1
9+
10+
# uncomment to disable IO dependencies and corresponding data layers
11+
# USE_OPENCV := 0
12+
# USE_LEVELDB := 0
13+
# USE_LMDB := 0
14+
15+
# uncomment to allow MDB_NOLOCK when reading LMDB files (only if necessary)
16+
# You should not set this flag if you will be reading LMDBs with any
17+
# possibility of simultaneous read and write
18+
# ALLOW_LMDB_NOLOCK := 1
19+
20+
# Uncomment if you're using OpenCV 3
21+
# OPENCV_VERSION := 3
22+
23+
# To customize your choice of compiler, uncomment and set the following.
24+
# N.B. the default for Linux is g++ and the default for OSX is clang++
25+
# CUSTOM_CXX := g++
26+
27+
# CUDA directory contains bin/ and lib/ directories that we need.
28+
CUDA_DIR := /usr/local/cuda
29+
# On Ubuntu 14.04, if cuda tools are installed via
30+
# "sudo apt-get install nvidia-cuda-toolkit" then use this instead:
31+
# CUDA_DIR := /usr
32+
33+
# CUDA architecture setting: going with all of them.
34+
# For CUDA < 6.0, comment the *_50 through *_61 lines for compatibility.
35+
# For CUDA < 8.0, comment the *_60 and *_61 lines for compatibility.
36+
CUDA_ARCH := -gencode arch=compute_30,code=sm_30 \
37+
-gencode arch=compute_35,code=sm_35 \
38+
-gencode arch=compute_50,code=sm_50 \
39+
-gencode arch=compute_52,code=sm_52 \
40+
-gencode arch=compute_60,code=sm_60 \
41+
-gencode arch=compute_61,code=sm_61 \
42+
-gencode arch=compute_61,code=compute_61
43+
# Deprecated
44+
# CUDA_ARCH := -gencode arch=compute_20,code=sm_20 \
45+
# -gencode arch=compute_20,code=sm_21 \
46+
# -gencode arch=compute_30,code=sm_30 \
47+
# -gencode arch=compute_35,code=sm_35 \
48+
# -gencode arch=compute_50,code=sm_50 \
49+
# -gencode arch=compute_52,code=sm_52 \
50+
# -gencode arch=compute_60,code=sm_60 \
51+
# -gencode arch=compute_61,code=sm_61 \
52+
# -gencode arch=compute_61,code=compute_61
53+
54+
# Uncomment to enable op::Profiler
55+
# PROFILER_ENABLED := 1
56+
57+
# DEEP_NET choice:
58+
# caffe for Caffe (default and only option so far)
59+
DEEP_NET := caffe
60+
61+
# BLAS choice:
62+
# atlas for ATLAS (default)
63+
# mkl for MKL
64+
# open for OpenBlas
65+
BLAS := atlas
66+
# Custom (MKL/ATLAS/OpenBLAS) include and lib directories.
67+
# Leave commented to accept the defaults for your choice of BLAS
68+
# (which should work)!
69+
# BLAS_INCLUDE := /path/to/your/blas
70+
# BLAS_LIB := /path/to/your/blas
71+
72+
# Homebrew puts openblas in a directory that is not on the standard search path
73+
# BLAS_INCLUDE := $(shell brew --prefix openblas)/include
74+
# BLAS_LIB := $(shell brew --prefix openblas)/lib
75+
76+
# Caffe directory
77+
CAFFE_DIR := 3rdparty/caffe/distribute
78+
79+
# Whatever else you find you need goes here.
80+
INCLUDE_DIRS := /usr/local/include /usr/include/hdf5/serial
81+
LIBRARY_DIRS := /usr/local/lib /usr/lib /usr/lib/aarch64-linux-gnu /usr/lib/aarch64-linux-gnu/hdf5/serial
82+
83+
# If Homebrew is installed at a non standard location (for example your home directory) and you use it for general dependencies
84+
# INCLUDE_DIRS += $(shell brew --prefix)/include
85+
# LIBRARY_DIRS += $(shell brew --prefix)/lib
86+
87+
# Uncomment to use `pkg-config` to specify OpenCV library paths.
88+
# (Usually not necessary -- OpenCV libraries are normally installed in one of the above $LIBRARY_DIRS.)
89+
# USE_PKG_CONFIG := 1
90+
91+
BUILD_DIR := build
92+
DISTRIBUTE_DIR := distribute
93+
94+
# Uncomment for debugging. Does not work on OSX due to https://github.com/BVLC/caffe/issues/171
95+
# DEBUG := 1
96+
97+
# The ID of the GPU that 'make runtest' will use to run unit tests.
98+
TEST_GPUID := 0
99+
100+
# enable pretty build (comment to see full commands)
101+
Q ?= @
Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
#!/bin/bash
2+
3+
4+
5+
echo "------------------------- Installing Caffe and OpenPose -------------------------"
6+
echo "NOTE: This script assumes that just flashed JetPack 3.1 : Ubuntu 16, CUDA 8, cuDNN 6 and OpenCV are already installed on your machine. Otherwise, it might fail."
7+
8+
9+
10+
function exitIfError {
11+
if [[ $? -ne 0 ]] ; then
12+
echo ""
13+
echo "------------------------- -------------------------"
14+
echo "Errors detected. Exiting script. The software might have not been successfully installed."
15+
echo "------------------------- -------------------------"
16+
exit 1
17+
fi
18+
}
19+
20+
21+
22+
function executeShInItsFolder {
23+
# $1 = sh file name
24+
# $2 = folder where the sh file is
25+
# $3 = folder to go back
26+
cd $2
27+
exitIfError
28+
sudo chmod +x $1
29+
exitIfError
30+
bash ./$1
31+
exitIfError
32+
cd $3
33+
exitIfError
34+
}
35+
36+
37+
38+
executeShInItsFolder "install_caffe_JetsonTX2_JetPack3.1.sh" "./3rdparty/caffe" "../.."
39+
exitIfError
40+
41+
42+
43+
executeShInItsFolder "install_openpose_JetsonTX2_JetPack3.1.sh" "./ubuntu" "./"
44+
exitIfError
45+
46+
47+
48+
echo "------------------------- Caffe and OpenPose Installed -------------------------"
49+
echo ""

0 commit comments

Comments
 (0)