Intel Movidius NCSDK Installation

From RidgeRun Developer Wiki


Introduction to Intel Movidius NCSDK

The Intel® Movidius™ Neural Compute SDK (Intel® Movidius™ NCSDK) enables rapid prototyping and deployment of deep neural networks (DNNs) on compatible neural compute devices like the Intel® Movidius™ Neural Compute Stick. The NCSDK includes a set of software tools to compile, profile, and check (validate) DNNs as well as the Intel® Movidius™ Neural Compute API (Intel® Movidius™ NCAPI) for application development in C/C++ or Python.

The NCSDK has two general usages:

  • Profiling, tuning, and compiling a DNN model on a development computer (host system) with the tools provided in the NCSDK.
  • Prototyping a user application on a development computer (host system), which accesses the neural compute device hardware to accelerate DNN inferences using the NCAPI.

Intel Movidius NCSDK Installation

This link: https://developer.movidius.com/start provides a straight forward guide to install the NCSDK, however it doesn't download the latest NCSDK version. So I created a guide to easily install and troubleshoot these problems.

  • First, download the latest NCSDK version.
mkdir -p ~/workspace
cd ~/workspace
wget https://ncs-forum-uploads.s3.amazonaws.com/ncsdk/ncsdk-02_05_00_02-full/ncsdk-2.05.00.02.tar.gz
tar xvf ncsdk-2.05.00.02.tar.gz
cd ncsdk-2.05.00.02
  • Next step is to install the NCSDK
make install

After this the installation has finished. However you may encounter some problems and issues, so in the Troubleshooting section you can find a description of the issues found so far and the solution. When you fix an issue you can go back and run the install-ncsdk.sh script again.

NCSDK v2.0 API

Intel provides a complete API documentation here.

Troubleshooting

OpenCV compatibility issue

An error like below may appear in the middle of the installation:

**********************************************************************
          ERROR - Compatibility Issue Detected with OpenCV

The OpenCV library /usr/local/lib/libopencv_highgui.so.4.0.0 links against libprotobuf-lite
This causes an error with ssd-caffe as it links against libprotobuf (non-lite version)
and these libraries cannot be used together and can cause a crash when deallocating memory.
Note building OpenCV with QT vs. the default GTK avoids this issue

To avoid this, uninstall OpenCV libraries built from sources.
The script, uninstall-opencv.sh, attempts to do this and is called by make install
If you have run make install or uninstall-opencv.sh and see this, try uninstalling OpenCV installed in /usr/local/ manually
Will exit
Makefile:47: recipe for target 'install' failed
make: *** [install] Error 1

This happens mainly when you have installed OpenCV manually. So the next thing to do is to perform the uninstall manually. Follow below steps:

cd
sudo apt-get update
sudo apt-get install build-essential cmake git libgtk2.0-dev pkg-config libavcodec-dev libavformat-dev libswscale-dev
sudo apt-get install python3.5-dev
git clone https://github.com/Itseez/opencv.git
cmake -D CMAKE_BUILD_TYPE=RELEASE -D CMAKE_INSTALL_PREFIX=/usr/local ..
make
sudo make install
sudo make uninstall

Intel Caffe Build: OpenCV 4.0 Support

Inte Caffe requires some changes in case you are using OpenCV 4.0. NCSDK OpenCV 4.0 support patch from RidgeRun fixes those issues. Copy the content of the patch in a file named 0001-opencv-4.0-compatibility.patch.

  • Copy the patch into the ssd-caffe directory
cp 0001-opencv-4.0-compatibility.patch /opt/movidius/ssd-caffe
  • Modify the install_ncsdk.sh to apply the patch from there:
cd /opt/movidius/NCSDK
#Add a new line in 461, it should looks like:
		eval git pull $STDOUT_QUIET
		eval git apply 0001-opencv-4.0-compatibility.patch
  • Run the installer again
make install