* [IE CLDNN] Memory allocation optimizations (#2178) * [GNA] Safety fixes (#2193) * LSTMCell test [GNA] LSTMCell fix for GNA (#2216) * [GNA] fix scale factor calculation for unfused bias after fc (2021.1) (#2195) * [GNA] fix scale factor calculation for unfused bias after fc * change check * add test * apply requested changes * cpplint fix * apply test changes * modify model for test to match ::op:: * [LPT] Copy constant with several outputs before blob update (#2197) * [LPT] Copy constant implementation * [LPT] the same Constant ops as FQ interval boundaries * [Scripts] Fixing issue with exporting path-like env when it undef (#2164) * setupvars.sh: Added logic for exporting path env in case if it not defined * setupvars: Removed duplicated colon * Kept quotes where they were * setupvars: updated copyrights * FakeQuantize + Mul fusion (#2133) * FQ+Mul fusion transform skeleton * FQ+Mul fusion transform tests prep * Basic UT for the transform * Basic implementation of the transform * Parametrized UTs for FQMul transform * Parametrization of FQ+Mul UTs * Make sure that the shapes of constants match * Check if the mul constant matches FQ data * CentOs compilation error fix * PR feedback and adjusted tests * NHWC layout of the mul constant * UT: FQ output limits 4D * Redundant CF pass removed * Rewrite the graph in a different way * Shape checking infrastructure skeleton * Handle some negative cases * Check the rt info in the fusion test * Fuse all Mul nodes detected after FQ node * Dont cast the original FQ node * Dont throw if CF fails in new output range calculation * More UTs * Accept any type of input to FQ in the transformation * Test the fusion when all FQ inputs are non-const * Fusion test when only one output limit is const * Extend error message (#2174) * some nGraph KW fixes (#2176) * Removed redundant methods * Fixed KW for linux * Fix QueryNetwork for networks with KSO (#2202) * Added a test to reproduce QueryNetwork with KSO * Fixed QueryNetwork for networks with KSO * Added additional test * Fixed output names for case with redundant ops before result (#2209) * [IE][VPU]: Workaround to support parameter Beta for layer Swish (#2207) * Workaround to full support Swish layer. It is faster than native Swish for now. * [IE][VPU]: Remove the second call of ngraph::CommonOptimizations (#2221) * Remove the second call of ngraph::CommonOptimizations in myriad plugin * Reuse code with vpu ngraph transformations * Duplicate PR 2167 for release branch: GatherTree description was extended and outdated link fixed (#2235) * add more alrifications to description * move clarification to comment * pseudo code become more accurate * review changes * Add exposing function signatures via Cython (#2244) * [DOC] Reshape feature (#2194) * [IE][VPU][OpenCL] 2021.1 release compiler (#2189) * Statically analyzed issues. (#2261) * [IE][VPU]: Fix K propagation through Reshape (2021.1) (#2180) * Fix K propagation through Reshape * Add test cases * Revert "[IE TESTS] dynavic batch for mvn layer (#1010)" (#2256) This reverts commit2e3378c50f. * Fixed KW warning and review issues (#2262) * [IE][VPU]: update firmware 1381 (#2236) * Reverting devicePriorities to be vector and respect the order, as opposed to the incorrect (recent?) refactoring that introduced the unordered_map that effectively ignores the priorities (#2251) * update OpenCV version to 4.5.0 (#2260) * Add VPUX configuration to compile_tool (#2248) * [IE][TESTS] Fix compareRawBuffers and compareBlobData methods (#2246) Use `<=` comparison instead of `<` with thresholds. This allows to use `0` threshold for bit-exact comparison. * [IE][VPU]: KW fixes (#2186) * Some KW fixes * Fix printTo in vpu ngraph transformations * Fix for static PartialShape detection algorithm (#2177) * Fixes for Interpolate-4. (#2281) * Update get_ov_update_message.py (#2286) * Clone a specific tag for pybind11 (#2296) * [Scripts] Fix setting PYTHONPATH logic (#2305) * setupvars.sh: Added logic for exporting path env in case if it not defined * setupvars: Removed duplicated colon * install_openvino_dependencies: Updated copyrights setupvars.bat: Updated notification about incorrect Python version. Removed checking ICC2019 setupvars.sh: Removed logic with choosing higher version of installed Python. Added dynamic detecting python3 major and minor version for setting path. Add checking minimum required Python version(now 3.6) * Added python3-gi package and fixed libglib2.0-0 package location. (#2294) * [IE TESTS] CoreThreading_LoadNetwork tests were disabled for GPU plugin (#2245) (#2283) * setupvars: Updated notifications, fixed calling python in Windows case (#2318) * Updated operations specification documents (2021.1) (#2268) * Updated documentation structure and remove incorrect added files for Acosh-1, Asinh-1 and Atanh-1 * Fixed broken links * Fixed c samples build (#2278) (#2304) * Fixed c samples build fixed CVS-38816 - Failure to build samples in C * Fixed issue with gflags * Revert "[IE][VPU]: Fix K propagation through Reshape (2021.1) (#2180)" (#2322) This reverts commitd604a03ac0. * Added ONNX Resize-11 and ONNX Resize-13 to supported frameworks layers list. (#2325) * Implement `run_executable.py` to run `TimeTests` several times (#2125) (#2188) CI passed * install_NEO_OCL_driver: Updated exit codes, messages. Updated way to remove old driver on Ubuntu (#2333) * Bump cmake version to 3.13 (#2339) * install_NEO_OCL_driver: Added checking of installed packages before trying to remove them. Added quotes for echo. (#2350) * convert to doxygen comments * add doxygen doc build configurations (#2191) Co-authored-by: Nikolay Tyukaev <ntyukaev_lo@jenkins.inn.intel.com> * [DOCS] Added an evaluate method for custom operation (#2272) * Added an evaluate method for custom operation * Fixed comments * Downgrade cmake for samples (#2372) * Downgrade cmake for samples Downgraded cmake version to default version for Ubuntu 18.04 * Updated supported python version The minimal python version in 2021.1 is 3.5 * Added notes about cmake requirements for samples and demo * Install dependency refactoring. (#2381) * Updated Transformation development doc (#2370) * Delete xfail for resolved known issue (#2385) * Fix layout links for dl streamer and c api (#2375) * fix layouts * change the dl-streamer link Co-authored-by: Nikolay Tyukaev <ntyukaev_lo@jenkins.inn.intel.com> * Added link options for cross-compilation (#2397) * Added new GSG for macOS, made minor changes in Windows GSG (#2070) (#2405) * Added new GSG for macOS, made minor changes in Windows GSG * Update get_started_macos.md Co-authored-by: Anastasiya Ageeva <anastasiya.ageeva@intel.com> * Fixed docs build on Windows (#2383) * layouts and code comments * Replace absolute links to docs.openvinotoolkit.org by relative ones (#2439) * Replaced direct links to docs.openvinotoolkit.org with relative links * Replaced direct links to docs.openvinotoolkit.org with relative links. Added GSGs for Win and macOS * Minor fixes in GSGs * Replaced direct links to docs.openvinotoolkit.org with relative links * Removed links to OpenVINO markdown files that contain anchor - they don't work in the current implementation of the doc process * Fixed Notes * Removed links to OpenVINO markdown files that contain anchor - they don't work in the current implementation of the doc process * fixed link to installing-openvino-linux.md * Update the menu to align with POT doc headers (#2433) * Update the menu to align with POT doc headers It changes the menu to align with Post-training Optimization Toolkit documentation titles. * Corrected one title Run Examples => How to Run Examples * Added closing braсket (#2466) Fixed syntax error (b4b03b1) * Remove the deprecation notice (#2314) * Removed deprecation notice * Removed the note from other files * [DOCS] Update Installation Guide - GPU steps (#2308) * Initial commit * fixing lists * Update installing-openvino-linux.md * Get rid of the note * Added the scrrenshot * Update installing-openvino-linux.md * fixes * separate layout * [Docs] Update MO What's new description (#2481) * Azure CI: Add separated pipelines for Windows, Linux, Mac * Feature/azaytsev/benchmarks 2021 1 (#2501) * Initial changes for 2021.1 * Inserted Graphtool scripts, updated configurations info * Updated FAQ and minor changes to performance_benchmarks.md * Updated for 2021.1 * Updated * incorporated review comments * incorporated review comments for FAQ * fixed link * Update build-instruction.md for MacOsX (#2457) * Update build-instruction.md for MacOsX * Removed call of install_dependencies.sh from the steps * Changed layouts * Feature/azaytsev/cvs-38240 (#2469) * Updated for 2020 version, replaced Ubuntu 16.04 with Ubuntu 20.04 * Updated the release package numbers * Removed FPGA from the documentation * Updated according to the comments in the ticket CVS-37827 (#2448) * Updated according to CVS-38225 * some changes * Update docs for speech libs and demos (#2518) * Made changes to benchmarks according to review comments * Remove `--collect_results_only` (#2523) * Remove `--collect_results_only` from MemCheckTests * Remove CLI keys from README * Added logo info to the Legal_Information, updated Ubuntu, CentOS supported versions * Updated supported Intel® Core™ processors list * Fixed table formatting * [Jenkinsfile] Bump infra (#2546) * [GNA] Documentation updates for 2021.1 (#2460) * [GNA] Documentation updates for 2021.1 * Take Mike's comments into account * More fixes according to review * Fix processor generation names * update api layouts * Added new index page with overview * Changed CMake and Python versions * Fixed links * some layout changes * some layout changes * nGraph Python API tutorial (#2500) * nGraph Python API tutorial * Tweaks * Code review comments * Code review comments * some layout changes * COnverted svg images to png * layouts * update layout * Added a label for nGraph_Python_API.md * fixed links * Fixed image * First draft of nGraph documentation (#2271) * First draft of nGraph documentation * updated according to review comments * Updated * Reviewed the nGraph Transformation section, added missing images * Update nGraph_dg.md * Delete python_api.md Removed since there is already the nGraph_Python_API.md document with a comprehensive overview. Co-authored-by: Andrey Zaytsev <andrey.zaytsev@intel.com> Co-authored-by: CCR\avladimi <anastasiya.ageeva@intel.com> * Feature/azaytsev/docs 2021 1 (#2560) * Removed FPGA from the documentation * Updated according to CVS-38225 * Added logo info to the Legal_Information, updated Ubuntu, CentOS supported versions * Updated supported Intel® Core™ processors list * Added new index page with overview * Changed CMake and Python versions * Fixed links * COnverted svg images to png * Added a label for nGraph_Python_API.md * fixed links * Fixed image * Update SW requirements in build instructions and change latest release to 2021.1 (#2565) * removed links to ../IE_DG/Introduction.md * Removed links to tools overview page as removed * some changes * Remove link to Integrate_your_kernels_into_IE.md * remove openvino_docs_IE_DG_Graph_debug_capabilities from layout as it was removed * Fixed links to images (#2569) * update layouts * Added deprecation note for PassConfig class (#2593) * Post-release fixes and installation path changes * Added pip install documentation (#2465) * Added pip install documentation * Change references * tiny fixes of links * Update installing-openvino-pip.md Co-authored-by: Alina Alborova <alina.alborova@intel.com> * Update OpenVino ONNX CI check (#2599) * Update OpenVino ONNX CI * Change parallel execution to single * Enlarge timeout * Remove timeout * Add timeout to test execution * Added PIP installation and Build from Source to the layout * Fixed formatting issue, removed broken link * Renamed section EXAMPLES to RESOURCES according to review comments * add mo faq navigation by url param * Skip hanging test case of OpenVino ONNX CI (#2608) * Update OpenVino ONNX CI * Change parallel execution to single * Enlarge timeout * Remove timeout * Add timeout to test execution * Skip hanging test * Add description to skip issue * Removed DLDT description * Replaced wrong links * MInor fix for path to the cpp samples * fixes * Update ops.py * Fix style * Improve pip installation guide (#2644) * Improve pip installation guide * Updated after comments * Feature/ntyukaev/separate layout (#2629) * convert to doxygen comments * layouts and code comments * separate layout * Changed layouts * Removed FPGA from the documentation * Updated according to CVS-38225 * some changes * Made changes to benchmarks according to review comments * Added logo info to the Legal_Information, updated Ubuntu, CentOS supported versions * Updated supported Intel® Core™ processors list * Fixed table formatting * update api layouts * Added new index page with overview * Changed CMake and Python versions * Fixed links * some layout changes * some layout changes * some layout changes * COnverted svg images to png * layouts * update layout * Added a label for nGraph_Python_API.md * fixed links * Fixed image * removed links to ../IE_DG/Introduction.md * Removed links to tools overview page as removed * some changes * Remove link to Integrate_your_kernels_into_IE.md * remove openvino_docs_IE_DG_Graph_debug_capabilities from layout as it was removed * update layouts * Post-release fixes and installation path changes * Added PIP installation and Build from Source to the layout * Fixed formatting issue, removed broken link * Renamed section EXAMPLES to RESOURCES according to review comments * add mo faq navigation by url param * Removed DLDT description * Replaced wrong links * MInor fix for path to the cpp samples * fixes * Update ops.py * Fix style Co-authored-by: Nikolay Tyukaev <ntyukaev_lo@jenkins.inn.intel.com> Co-authored-by: Tyukaev <nikolay.tyukaev@intel.com> Co-authored-by: aalborov <alina.alborova@intel.com> Co-authored-by: Rafal Blaczkowski <rafal.blaczkowski@intel.com> Co-authored-by: Alexander Zhogov <alexander.zhogov@intel.com> * Fixed CVS-35316 (#2072) (#2670) Co-authored-by: Anastasiya Ageeva <anastasiya.ageeva@intel.com> * [install_dependencies.sh] install latest cmake if current version is lower 3.13 (#2695) (#2701) * [install_dependencies.sh] install latest cmake if current version is lower 3.13 * add shellcheck for Ubuntu * install python 2.7 for Ubuntu * Removed redundant file * Exclude files that we didn't changed from merging Co-authored-by: Sergey Shlyapnikov <sergey.shlyapnikov@intel.com> Co-authored-by: Denis Orlov <denis.orlov@intel.com> Co-authored-by: Kamil Magierski <kamil.magierski@intel.com> Co-authored-by: Anna Alberska <anna.alberska@intel.com> Co-authored-by: Edward Shogulin <edward.shogulin@intel.com> Co-authored-by: Artyom Anokhov <artyom.anokhov@intel.com> Co-authored-by: Tomasz Dołbniak <tomasz.dolbniak@intel.com> Co-authored-by: Ilya Churaev <ilya.churaev@intel.com> Co-authored-by: Roman Vyunov (Intel) <roman.vyunov@intel.com> Co-authored-by: Maksim Doronin <maksim.doronin@intel.com> Co-authored-by: Svetlana Dolinina <svetlana.a.dolinina@intel.com> Co-authored-by: Evgeny Talanin <evgeny.talanin@intel.com> Co-authored-by: Evgenya Stepyreva <evgenya.stepyreva@intel.com> Co-authored-by: Maxim Kurin <maxim.kurin@intel.com> Co-authored-by: Nikolay Shchegolev <nikolay.shchegolev@intel.com> Co-authored-by: Andrew Bakalin <andrew.bakalin@intel.com> Co-authored-by: Gorokhov Dmitriy <dmitry.gorokhov@intel.com> Co-authored-by: Evgeny Latkin <evgeny.latkin@intel.com> Co-authored-by: Maxim Shevtsov <maxim.y.shevtsov@intel.com> Co-authored-by: Alexey Suhov <alexey.suhov@intel.com> Co-authored-by: Alexander Novak <sasha-novak@yandex.ru> Co-authored-by: Vladislav Vinogradov <vlad.vinogradov@intel.com> Co-authored-by: Vladislav Volkov <vladislav.volkov@intel.com> Co-authored-by: Vladimir Gavrilov <vladimir.gavrilov@intel.com> Co-authored-by: Zoe Cayetano <zoe.cayetano@intel.com> Co-authored-by: Dmitrii Denisov <dmitrii.denisov@intel.com> Co-authored-by: Irina Efode <irina.efode@intel.com> Co-authored-by: Evgeny Lazarev <evgeny.lazarev@intel.com> Co-authored-by: Mikhail Ryzhov <mikhail.ryzhov@intel.com> Co-authored-by: Vitaliy Urusovskij <vitaliy.urusovskij@intel.com> Co-authored-by: Nikolay Tyukaev <ntyukaev_lo@jenkins.inn.intel.com> Co-authored-by: Nikolay Tyukaev <nikolay.tyukaev@intel.com> Co-authored-by: Gleb Kazantaev <gleb.kazantaev@intel.com> Co-authored-by: Rafal Blaczkowski <rafal.blaczkowski@intel.com> Co-authored-by: Ilya Lavrenov <ilya.lavrenov@intel.com> Co-authored-by: Anastasiya Ageeva <anastasiya.ageeva@intel.com> Co-authored-by: Maksim Proshin <mvproshin@gmail.com> Co-authored-by: Alina Alborova <alina.alborova@intel.com> Co-authored-by: Maxim Vafin <maxim.vafin@intel.com> Co-authored-by: azhogov <alexander.zhogov@intel.com> Co-authored-by: Alina Kladieva <alina.kladieva@intel.com> Co-authored-by: Michał Karzyński <4430709+postrational@users.noreply.github.com> Co-authored-by: Anton Romanov <anton.romanov@intel.com>
28 KiB
Build OpenVINO™ Inference Engine
Contents
- Introduction
- Build on Linux* Systems
- Build for Raspbian* Stretch OS
- Build on Windows* Systems
- Build on macOS* Systems
- Build on Android* Systems
- Use Custom OpenCV Builds for Inference Engine
- Add Inference Engine to Your Project
- (Optional) Additional Installation Steps for the Intel® Movidius™ Neural Compute Stick and Neural Compute Stick 2
- Next Steps
- Additional Resources
Introduction
The Inference Engine can infer models in different formats with various input and output formats.
The open source version of Inference Engine includes the following plugins:
| PLUGIN | DEVICE TYPES |
|---|---|
| CPU plugin | Intel® Xeon® with Intel® AVX2 and AVX512, Intel® Core™ Processors with Intel® AVX2, Intel® Atom® Processors with Intel® SSE |
| GPU plugin | Intel® Processor Graphics, including Intel® HD Graphics and Intel® Iris® Graphics |
| GNA plugin | Intel® Speech Enabling Developer Kit, Amazon Alexa* Premium Far-Field Developer Kit, Intel® Pentium® Silver processor J5005, Intel® Celeron® processor J4005, Intel® Core™ i3-8121U processor |
| MYRIAD plugin | Intel® Movidius™ Neural Compute Stick powered by the Intel® Movidius™ Myriad™ 2, Intel® Neural Compute Stick 2 powered by the Intel® Movidius™ Myriad™ X |
| Heterogeneous plugin | Heterogeneous plugin enables computing for inference on one network on several Intel® devices. |
Build on Linux* Systems
The software was validated on:
- Ubuntu* 18.04 (64-bit) with default GCC* 7.5.0
- Ubuntu* 20.04 (64-bit) with default GCC* 9.3.0
- CentOS* 7.6 (64-bit) with default GCC* 4.8.5
Software Requirements
- CMake* 3.13 or higher
- GCC* 4.8 or higher to build the Inference Engine
- Python 3.6 or higher for Inference Engine Python API wrapper
- (Optional) Install Intel® Graphics Compute Runtime for OpenCL™ Driver package 19.41.14441.
Note
: Building samples and demos from the Intel® Distribution of OpenVINO™ toolkit package requires CMake* 3.10 or higher.
Build Steps
- Clone submodules:
cd openvino git submodule update --init --recursive - Install build dependencies using the
install_build_dependencies.shscript in the project root folder.chmod +x install_build_dependencies.sh./install_build_dependencies.sh - By default, the build enables the Inference Engine GPU plugin to infer models
on your Intel® Processor Graphics. This requires you to
Install Intel® Graphics Compute Runtime for OpenCL™ Driver package 19.41.14441
before running the build. If you don't want to use the GPU plugin, use the
-DENABLE_CLDNN=OFFCMake build option and skip the installation of the Intel® Graphics Compute Runtime for OpenCL™ Driver. - Create a build folder:
mkdir build && cd build
- Inference Engine uses a CMake-based build system. In the created
builddirectory, runcmaketo fetch project dependencies and create Unix makefiles, then runmaketo build the project:
cmake -DCMAKE_BUILD_TYPE=Release ..
make --jobs=$(nproc --all)
Additional Build Options
You can use the following additional build options:
-
The default build uses an internal JIT GEMM implementation.
-
To switch to an OpenBLAS* implementation, use the
GEMM=OPENBLASoption withBLAS_INCLUDE_DIRSandBLAS_LIBRARIESCMake options to specify a path to the OpenBLAS headers and library. For example, the following options on CentOS*:-DGEMM=OPENBLAS -DBLAS_INCLUDE_DIRS=/usr/include/openblas -DBLAS_LIBRARIES=/usr/lib64/libopenblas.so.0. -
To switch to the optimized MKL-ML* GEMM implementation, use
-DGEMM=MKLand-DMKLROOT=<path_to_MKL>CMake options to specify a path to unpacked MKL-ML with theincludeandlibfolders. MKL-ML* package can be downloaded from the Intel® MKL-DNN repository. -
Threading Building Blocks (TBB) is used by default. To build the Inference Engine with OpenMP* threading, set the
-DTHREADING=OMPoption. -
Required versions of TBB and OpenCV packages are downloaded automatically by the CMake-based script. If you want to use the automatically downloaded packages but you already have installed TBB or OpenCV packages configured in your environment, you may need to clean the
TBBROOTandOpenCV_DIRenvironment variables before running thecmakecommand, otherwise they will not be downloaded and the build may fail if incompatible versions were installed. -
If the CMake-based build script can not find and download the OpenCV package that is supported on your platform, or if you want to use a custom build of the OpenCV library, refer to the Use Custom OpenCV Builds section for details.
-
To build the Python API wrapper:
- Install all additional packages listed in the
/inference-engine/ie_bridges/python/requirements.txtfile:pip install -r requirements.txt - Use the
-DENABLE_PYTHON=ONoption. To specify an exact Python version, use the following options:-DPYTHON_EXECUTABLE=`which python3.7` \ -DPYTHON_LIBRARY=/usr/lib/x86_64-linux-gnu/libpython3.7m.so \ -DPYTHON_INCLUDE_DIR=/usr/include/python3.7
- Install all additional packages listed in the
-
To switch the CPU and GPU plugins off/on, use the
cmakeoptions-DENABLE_MKL_DNN=ON/OFFand-DENABLE_CLDNN=ON/OFFrespectively. -
nGraph-specific compilation options:
-DNGRAPH_ONNX_IMPORT_ENABLE=ONenables the building of the nGraph ONNX importer.-DNGRAPH_DEBUG_ENABLE=ONenables additional debug prints.
Build for Raspbian Stretch* OS
Note
: Only the MYRIAD plugin is supported.
Hardware Requirements
-
Raspberry Pi* 2 or 3 with Raspbian* Stretch OS (32-bit). Check that it's CPU supports ARMv7 instruction set (
uname -mcommand returnsarmv7l).Note
: Despite the Raspberry Pi* CPU is ARMv8, 32-bit OS detects ARMv7 CPU instruction set. The default
gcccompiler applies ARMv6 architecture flag for compatibility with lower versions of boards. For more information, run thegcc -Q --help=targetcommand and refer to the description of the-march=option.
You can compile the Inference Engine for Raspberry Pi* in one of the two ways:
- Native Compilation, which is the simplest way, but time-consuming
- Cross Compilation Using Docker*, which is the recommended way
Native Compilation
Native compilation of the Inference Engine is the most straightforward solution. However, it might take at least one hour to complete on Raspberry Pi* 3.
- Install dependencies:
sudo apt-get update
sudo apt-get install -y git cmake libusb-1.0-0-dev
- Go to the cloned
openvinorepository:
cd openvino
- Initialize submodules:
git submodule update --init --recursive
- Create a build folder:
mkdir build && cd build
- Build the Inference Engine:
cmake -DCMAKE_BUILD_TYPE=Release \
-DENABLE_SSE42=OFF \
-DTHREADING=SEQ \
-DENABLE_GNA=OFF .. && make
Cross Compilation Using Docker*
This compilation was tested on the following configuration:
- Host: Ubuntu* 18.04 (64-bit, Intel® Core™ i7-6700K CPU @ 4.00GHz × 8)
- Target: Raspbian* Stretch (32-bit, ARMv7, Raspberry Pi* 3)
- Install Docker*:
sudo apt-get install -y docker.io
- Add a current user to
dockergroup:
sudo usermod -a -G docker $USER
Log out and log in for this to take effect.
- Create a directory named
ie_cross_armhfand add a text file namedDockerfilewith the following content:
FROM debian:stretch
USER root
RUN dpkg --add-architecture armhf && \
apt-get update && \
apt-get install -y --no-install-recommends \
build-essential \
crossbuild-essential-armhf \
git \
wget \
libusb-1.0-0-dev:armhf \
libgtk-3-dev:armhf \
libavcodec-dev:armhf \
libavformat-dev:armhf \
libswscale-dev:armhf \
libgstreamer1.0-dev:armhf \
libgstreamer-plugins-base1.0-dev:armhf \
libpython3-dev:armhf \
python3-pip \
python-minimal \
python-argparse
RUN wget https://www.cmake.org/files/v3.14/cmake-3.14.3.tar.gz && \
tar xf cmake-3.14.3.tar.gz && \
(cd cmake-3.14.3 && ./bootstrap --parallel=$(nproc --all) && make --jobs=$(nproc --all) && make install) && \
rm -rf cmake-3.14.3 cmake-3.14.3.tar.gz
It uses the Debian* Stretch (Debian 9) OS for compilation because it is a base of the Raspbian* Stretch.
- Build a Docker* image:
docker image build -t ie_cross_armhf ie_cross_armhf
- Run Docker* container with mounted source code folder from host:
docker run -it -v /absolute/path/to/openvino:/openvino ie_cross_armhf /bin/bash
-
While in the container:
- Go to the cloned
openvinorepository:
cd openvino- Create a build folder:
mkdir build && cd build- Build the Inference Engine:
cmake -DCMAKE_BUILD_TYPE=Release \ -DCMAKE_TOOLCHAIN_FILE="../cmake/arm.toolchain.cmake" \ -DTHREADS_PTHREAD_ARG="-pthread" \ -DENABLE_SSE42=OFF \ -DTHREADING=SEQ \ -DENABLE_GNA=OFF .. && make --jobs=$(nproc --all) - Go to the cloned
-
Press Ctrl+D to exit from Docker. You can find the resulting binaries in the
openvino/bin/armv7l/directory and the OpenCV* installation in theopenvino/inference-engine/temp.
Note
: Native applications that link to cross-compiled Inference Engine library require an extra compilation flag
-march=armv7-a.
Additional Build Options
You can use the following additional build options:
-
Required versions of OpenCV packages are downloaded automatically by the CMake-based script. If you want to use the automatically downloaded packages but you already have installed OpenCV packages configured in your environment, you may need to clean the
OpenCV_DIRenvironment variable before running thecmakecommand; otherwise they won't be downloaded and the build may fail if incompatible versions were installed. -
If the CMake-based build script cannot find and download the OpenCV package that is supported on your platform, or if you want to use a custom build of the OpenCV library, see: Use Custom OpenCV Builds for details.
-
To build Python API wrapper, install
libpython3-dev:armhfandpython3-pippackages usingapt-get; then installnumpyandcythonpython modules viapip3, adding the following options:-DENABLE_PYTHON=ON \ -DPYTHON_EXECUTABLE=/usr/bin/python3.5 \ -DPYTHON_LIBRARY=/usr/lib/arm-linux-gnueabihf/libpython3.5m.so \ -DPYTHON_INCLUDE_DIR=/usr/include/python3.5 -
nGraph-specific compilation options:
-DNGRAPH_ONNX_IMPORT_ENABLE=ONenables the building of the nGraph ONNX importer.-DNGRAPH_DEBUG_ENABLE=ONenables additional debug prints.
Build on Windows* Systems
The software was validated on:
- Microsoft* Windows* 10 (64-bit) with Visual Studio 2019
Software Requirements
- CMake*3.13 or higher
- Microsoft* Visual Studio 2017, 2019
- (Optional) Intel® Graphics Driver for Windows* (26.20) driver package.
- Python 3.6 or higher for Inference Engine Python API wrapper
Note
: Building samples and demos from the Intel® Distribution of OpenVINO™ toolkit package requires CMake* 3.10 or higher.
Build Steps
-
Clone submodules:
git submodule update --init --recursive -
By default, the build enables the Inference Engine GPU plugin to infer models on your Intel® Processor Graphics. This requires you to [download and install the Intel® Graphics Driver for Windows (26.20) driver package before running the build. If you don't want to use the GPU plugin, use the
-DENABLE_CLDNN=OFFCMake build option and skip the installation of the Intel® Graphics Driver. -
Create build directory:
mkdir build -
In the
builddirectory, runcmaketo fetch project dependencies and generate a Visual Studio solution.For Microsoft* Visual Studio 2017:
cmake -G "Visual Studio 15 2017 Win64" -DCMAKE_BUILD_TYPE=Release ..
For Microsoft* Visual Studio 2019:
cmake -G "Visual Studio 16 2019" -A x64 -DCMAKE_BUILD_TYPE=Release ..
-
Build generated solution in Visual Studio or run
cmake --build . --config Releaseto build from the command line. -
Before running the samples, add paths to the TBB and OpenCV binaries used for the build to the
%PATH%environment variable. By default, TBB binaries are downloaded by the CMake-based script to the<openvino_repo>/inference-engine/temp/tbb/binfolder, OpenCV binaries to the<openvino_repo>/inference-engine/temp/opencv_4.5.0/opencv/binfolder.
Additional Build Options
-
Internal JIT GEMM implementation is used by default.
-
To switch to OpenBLAS GEMM implementation, use the
-DGEMM=OPENBLASCMake option and specify path to OpenBLAS using the-DBLAS_INCLUDE_DIRS=<OPENBLAS_DIR>\includeand-DBLAS_LIBRARIES=<OPENBLAS_DIR>\lib\libopenblas.dll.aoptions. Download a prebuilt OpenBLAS* package via the OpenBLAS link. mingw64* runtime dependencies can be downloaded via the mingw64* runtime dependencies link. -
To switch to the optimized MKL-ML* GEMM implementation, use the
-DGEMM=MKLand-DMKLROOT=<path_to_MKL>CMake options to specify a path to unpacked MKL-ML with theincludeandlibfolders. MKL-ML* package can be downloaded from the Intel® MKL-DNN repository for Windows. -
Threading Building Blocks (TBB) is used by default. To build the Inference Engine with OpenMP* threading, set the
-DTHREADING=OMPoption. -
Required versions of TBB and OpenCV packages are downloaded automatically by the CMake-based script. If you want to use the automatically-downloaded packages but you already have installed TBB or OpenCV packages configured in your environment, you may need to clean the
TBBROOTandOpenCV_DIRenvironment variables before running thecmakecommand; otherwise they won't be downloaded and the build may fail if incompatible versions were installed. -
If the CMake-based build script can not find and download the OpenCV package that is supported on your platform, or if you want to use a custom build of the OpenCV library, refer to the Use Custom OpenCV Builds section for details.
-
To switch off/on the CPU and GPU plugins, use the
cmakeoptions-DENABLE_MKL_DNN=ON/OFFand-DENABLE_CLDNN=ON/OFFrespectively. -
To build the Python API wrapper, use the
-DENABLE_PYTHON=ONoption. To specify an exact Python version, use the following options:-DPYTHON_EXECUTABLE="C:\Program Files\Python37\python.exe" ^ -DPYTHON_LIBRARY="C:\Program Files\Python37\libs\python37.lib" ^ -DPYTHON_INCLUDE_DIR="C:\Program Files\Python37\include" -
nGraph-specific compilation options:
-DNGRAPH_ONNX_IMPORT_ENABLE=ONenables the building of the nGraph ONNX importer.-DNGRAPH_DEBUG_ENABLE=ONenables additional debug prints.
Building Inference Engine with Ninja* Build System
call "C:\Program Files (x86)\IntelSWTools\compilers_and_libraries_2018\windows\bin\ipsxe-comp-vars.bat" intel64 vs2017
set CXX=icl
set CC=icl
:: clean TBBROOT value set by ipsxe-comp-vars.bat, required TBB package will be downloaded by openvino cmake script
set TBBROOT=
cmake -G Ninja -Wno-dev -DCMAKE_BUILD_TYPE=Release ..
cmake --build . --config Release
Build on macOS* Systems
Note
: The current version of the OpenVINO™ toolkit for macOS* supports inference on Intel CPUs only.
The software was validated on:
- macOS* 10.15, 64-bit
Software Requirements
- CMake* 3.13 or higher
- Clang* compiler from Xcode* 10.1 or higher
- Python* 3.6 or higher for the Inference Engine Python API wrapper
Note
: Building samples and demos from the Intel® Distribution of OpenVINO™ toolkit package requires CMake* 3.10 or higher.
Build Steps
- Clone submodules:
cd openvino git submodule update --init --recursive - Create a build folder:
mkdir build && cd build
- Inference Engine uses a CMake-based build system. In the created
builddirectory, runcmaketo fetch project dependencies and create Unix makefiles, then runmaketo build the project:
cmake -DCMAKE_BUILD_TYPE=Release ..
make --jobs=$(nproc --all)
Additional Build Options
You can use the following additional build options:
-
Internal JIT GEMM implementation is used by default.
-
To switch to the optimized MKL-ML* GEMM implementation, use
-DGEMM=MKLand-DMKLROOT=<path_to_MKL>cmake options to specify a path to unpacked MKL-ML with theincludeandlibfolders. MKL-ML* [package for Mac] can be downloaded here -
Threading Building Blocks (TBB) is used by default. To build the Inference Engine with OpenMP* threading, set the
-DTHREADING=OMPoption. -
Required versions of TBB and OpenCV packages are downloaded automatically by the CMake-based script. If you want to use the automatically downloaded packages but you already have installed TBB or OpenCV packages configured in your environment, you may need to clean the
TBBROOTandOpenCV_DIRenvironment variables before running thecmakecommand, otherwise they won't be downloaded and the build may fail if incompatible versions were installed. -
If the CMake-based build script can not find and download the OpenCV package that is supported on your platform, or if you want to use a custom build of the OpenCV library, refer to the Use Custom OpenCV Builds section for details.
-
To build the Python API wrapper, use the
-DENABLE_PYTHON=ONoption. To specify an exact Python version, use the following options:- If you installed Python through Homebrew*, set the following flags:
-DPYTHON_EXECUTABLE=/usr/local/Cellar/python/3.7.7/Frameworks/Python.framework/Versions/3.7/bin/python3.7m \ -DPYTHON_LIBRARY=/usr/local/Cellar/python/3.7.7/Frameworks/Python.framework/Versions/3.7/lib/libpython3.7m.dylib \ -DPYTHON_INCLUDE_DIR=/usr/local/Cellar/python/3.7.7/Frameworks/Python.framework/Versions/3.7/include/python3.7m- If you installed Python another way, you can use the following commands to find where the
dylibandinclude_dirare located, respectively:
find /usr/ -name 'libpython*m.dylib' find /usr/ -type d -name python3.7m -
nGraph-specific compilation options:
-DNGRAPH_ONNX_IMPORT_ENABLE=ONenables the building of the nGraph ONNX importer.-DNGRAPH_DEBUG_ENABLE=ONenables additional debug prints.
Build on Android* Systems
This section describes how to build Inference Engine for Android x86 (64-bit) operating systems.
Software Requirements
- CMake* 3.13 or higher
- Android NDK (this guide has been validated with r20 release)
Note
: Building samples and demos from the Intel® Distribution of OpenVINO™ toolkit package requires CMake* 3.10 or higher.
Build Steps
- Download and unpack Android NDK: https://developer.android.com/ndk/downloads. Let's assume that
~/Downloadsis used as a working folder.
cd ~/Downloads
wget https://dl.google.com/android/repository/android-ndk-r20-linux-x86_64.zip
unzip android-ndk-r20-linux-x86_64.zip
mv android-ndk-r20 android-ndk
- Clone submodules
cd openvino
git submodule update --init --recursive
- Create a build folder:
mkdir build
- Change working directory to
buildand runcmaketo create makefiles. Then runmake.
cd build
cmake .. \
-DCMAKE_TOOLCHAIN_FILE=~/Downloads/android-ndk/build/cmake/android.toolchain.cmake \
-DANDROID_ABI=x86_64 \
-DANDROID_PLATFORM=21 \
-DANDROID_STL=c++_shared \
-DENABLE_OPENCV=OFF
make --jobs=$(nproc --all)
ANDROID_ABIspecifies target architecture (x86_64)ANDROID_PLATFORM- Android API versionANDROID_STLspecifies that shared C++ runtime is used. Copy~/Downloads/android-ndk/sources/cxx-stl/llvm-libc++/libs/x86_64/libc++_shared.sofrom Android NDK along with built binaries
Use Custom OpenCV Builds for Inference Engine
Note
: The recommended and tested version of OpenCV is 4.4.0.
Required versions of OpenCV packages are downloaded automatically during the building Inference Engine library. If the build script can not find and download the OpenCV package that is supported on your platform, you can use one of the following options:
-
Download the most suitable version from the list of available pre-build packages from https://download.01.org/opencv/2020/openvinotoolkit from the
<release_version>/inference_enginedirectory. -
Use a system-provided OpenCV package (e.g with running the
apt install libopencv-devcommand). The following modules must be enabled:imgcodecs,videoio,highgui. -
Get the OpenCV package using a package manager: pip, conda, conan etc. The package must have the development components included (header files and CMake scripts).
-
Build OpenCV from source using the build instructions on the OpenCV site.
After you got the built OpenCV library, perform the following preparation steps before running the Inference Engine build:
- Set the
OpenCV_DIRenvironment variable to the directory where theOpenCVConfig.cmakefile of you custom OpenCV build is located. - Disable the package automatic downloading with using the
-DENABLE_OPENCV=OFFoption for CMake-based build script for Inference Engine.
Add Inference Engine to Your Project
For CMake projects, set the InferenceEngine_DIR environment variable:
export InferenceEngine_DIR=/path/to/openvino/build/
Then you can find Inference Engine by find_package:
find_package(InferenceEngine)
include_directories(${InferenceEngine_INCLUDE_DIRS})
target_link_libraries(${PROJECT_NAME} ${InferenceEngine_LIBRARIES} dl)
(Optional) Additional Installation Steps for the Intel® Movidius™ Neural Compute Stick and Neural Compute Stick 2
Note
: These steps are only required if you want to perform inference on Intel® Movidius™ Neural Compute Stick or the Intel® Neural Compute Stick 2 using the Inference Engine MYRIAD Plugin. See also Intel® Neural Compute Stick 2 Get Started.
For Linux, Raspbian* Stretch OS
- Add the current Linux user to the
usersgroup; you will need to log out and log in for it to take effect:
sudo usermod -a -G users "$(whoami)"
- To perform inference on Intel® Movidius™ Neural Compute Stick and Intel® Neural Compute Stick 2, install the USB rules as follows:
cat <<EOF > 97-myriad-usbboot.rules
SUBSYSTEM=="usb", ATTRS{idProduct}=="2150", ATTRS{idVendor}=="03e7", GROUP="users", MODE="0666", ENV{ID_MM_DEVICE_IGNORE}="1"
SUBSYSTEM=="usb", ATTRS{idProduct}=="2485", ATTRS{idVendor}=="03e7", GROUP="users", MODE="0666", ENV{ID_MM_DEVICE_IGNORE}="1"
SUBSYSTEM=="usb", ATTRS{idProduct}=="f63b", ATTRS{idVendor}=="03e7", GROUP="users", MODE="0666", ENV{ID_MM_DEVICE_IGNORE}="1"
EOF
sudo cp 97-myriad-usbboot.rules /etc/udev/rules.d/
sudo udevadm control --reload-rules
sudo udevadm trigger
sudo ldconfig
rm 97-myriad-usbboot.rules
Next Steps
Congratulations, you have built the Inference Engine. To get started with the OpenVINO™, proceed to the Get Started guides:
Notice
To enable some additional nGraph features and use your custom nGraph library with the OpenVINO™ binary package, make sure the following:
- nGraph library was built with the same version which is used in the Inference Engine.
- nGraph library and the Inference Engine were built with the same compilers. Otherwise you might face application binary interface (ABI) problems.
To prepare your custom nGraph library for distribution, which includes collecting all headers, copy
binaries, and so on, use the install CMake target.
This target collects all dependencies, prepares the nGraph package and copies it to a separate directory.
Additional Resources
- OpenVINO™ Release Notes
- Introduction to Intel® Deep Learning Deployment Toolkit
- Inference Engine Samples Overview
- Inference Engine Developer Guide
- Model Optimizer Developer Guide
* Other names and brands may be claimed as the property of others.