Skip to content

Commit 1aca080

Browse files
committed
Merge branch 'sahar/2022.1_rel-1.11.0' into 2022.1_branch_rel-1.11.0
2 parents b713855 + 93370d9 commit 1aca080

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

43 files changed

+1552
-717
lines changed

cmake/CMakeLists.txt

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1547,9 +1547,12 @@ if (onnxruntime_USE_OPENVINO)
15471547
elseif (${VER} MATCHES "2021.4" OR $ENV{INTEL_OPENVINO_DIR} MATCHES "2021.4")
15481548
set(OPENVINO_VERSION "2021.4")
15491549
add_definitions(-DOPENVINO_2021_4=1)
1550+
elseif (${VER} MATCHES "2022.1" OR $ENV{INTEL_OPENVINO_DIR} MATCHES "2022.1")
1551+
set(OPENVINO_VERSION "2022.1")
1552+
add_definitions(-DOPENVINO_2022_1=1)
15501553
elseif ($ENV{INTEL_OPENVINO_DIR} MATCHES "openvino")
1551-
set(OPENVINO_VERSION "2021.4")
1552-
add_definitions(-DOPENVINO_2021_4=1)
1554+
set(OPENVINO_VERSION "2022.1")
1555+
add_definitions(-DOPENVINO_2022_1=1)
15531556
else()
15541557
message(FATAL_ERROR "Unsupported OpenVINO version: ${INTEL_OPENVINO_DIR}")
15551558
endif()

cmake/onnxruntime_providers.cmake

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -725,16 +725,21 @@ if (onnxruntime_USE_OPENVINO)
725725
# Header paths
726726
find_package(InferenceEngine REQUIRED)
727727
find_package(ngraph REQUIRED)
728-
728+
729+
if (OPENVINO_2022_1)
730+
find_package(OpenVINO REQUIRED COMPONENTS Runtime ONNX)
731+
list (OV_20_LIBS openvino::frontend::onnx openvino::runtime)
732+
endif()
733+
729734
if (WIN32)
730735
unset(CMAKE_MAP_IMPORTED_CONFIG_RELWITHDEBINFO)
731736
endif()
732737

733738
if ((DEFINED ENV{OPENCL_LIBS}) AND (DEFINED ENV{OPENCL_INCS}))
734739
add_definitions(-DIO_BUFFER_ENABLED=1)
735-
list(APPEND OPENVINO_LIB_LIST $ENV{OPENCL_LIBS} ${InferenceEngine_LIBRARIES} ${NGRAPH_LIBRARIES} ngraph::onnx_importer ${PYTHON_LIBRARIES})
740+
list(APPEND OPENVINO_LIB_LIST $ENV{OPENCL_LIBS} ${OV_20_LIBS} ${InferenceEngine_LIBRARIES} ${NGRAPH_LIBRARIES} ngraph::onnx_importer ${PYTHON_LIBRARIES})
736741
else()
737-
list(APPEND OPENVINO_LIB_LIST ${InferenceEngine_LIBRARIES} ${NGRAPH_LIBRARIES} ngraph::onnx_importer ${PYTHON_LIBRARIES})
742+
list(APPEND OPENVINO_LIB_LIST ${OV_20_LIBS} ${InferenceEngine_LIBRARIES} ${NGRAPH_LIBRARIES} ngraph::onnx_importer ${PYTHON_LIBRARIES})
738743
endif()
739744

740745
source_group(TREE ${ONNXRUNTIME_ROOT}/core FILES ${onnxruntime_providers_openvino_cc_srcs})
@@ -747,7 +752,7 @@ if (onnxruntime_USE_OPENVINO)
747752
target_compile_options(onnxruntime_providers_openvino PRIVATE "-Wno-parentheses")
748753
endif()
749754
add_dependencies(onnxruntime_providers_openvino onnxruntime_providers_shared ${onnxruntime_EXTERNAL_DEPENDENCIES})
750-
target_include_directories(onnxruntime_providers_openvino SYSTEM PUBLIC ${ONNXRUNTIME_ROOT} ${CMAKE_CURRENT_BINARY_DIR} ${eigen_INCLUDE_DIRS} ${OPENVINO_INCLUDE_DIR_LIST} ${PYTHON_INCLUDE_DIRS} $ENV{OPENCL_INCS})
755+
target_include_directories(onnxruntime_providers_openvino SYSTEM PUBLIC ${ONNXRUNTIME_ROOT} ${CMAKE_CURRENT_BINARY_DIR} ${eigen_INCLUDE_DIRS} ${OpenVINO_INCLUDE_DIR} ${OPENVINO_INCLUDE_DIR_LIST} ${PYTHON_INCLUDE_DIRS} $ENV{OPENCL_INCS})
751756
target_link_libraries(onnxruntime_providers_openvino ${ONNXRUNTIME_PROVIDERS_SHARED} ${OPENVINO_LIB_LIST} absl::raw_hash_set absl::hash)
752757

753758
if(MSVC)

dockerfiles/Dockerfile.openvino

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
# SPDX-License-Identifier: MIT
44
#--------------------------------------------------------------------------
55

6-
ARG OPENVINO_VERSION=2021.4.2
6+
ARG OPENVINO_VERSION=2022.1.0
77

88

99
# Build stage
@@ -17,8 +17,7 @@ ARG DEVICE=CPU_FP32
1717
ARG ONNXRUNTIME_REPO=https://github.com/microsoft/onnxruntime.git
1818
ARG ONNXRUNTIME_BRANCH=master
1919

20-
ENV InferenceEngine_DIR=${INTEL_OPENVINO_DIR}/deployment_tools/inference_engine/share
21-
ENV ngraph_DIR=${INTEL_OPENVINO_DIR}/deployment_tools/ngraph/cmake
20+
ENV InferenceEngine_DIR=${INTEL_OPENVINO_DIR}/runtime/cmake
2221

2322
USER root
2423
RUN apt update; apt install -y git protobuf-compiler libprotobuf-dev
@@ -52,10 +51,11 @@ RUN apt update; apt install -y unattended-upgrades && \
5251
ARG BUILD_UID=1001
5352
ARG BUILD_USER=onnxruntimedev
5453
RUN adduser --uid $BUILD_UID $BUILD_USER
54+
RUN usermod -a -G video,users ${BUILD_USER}
5555
ENV WORKDIR_PATH /home/${BUILD_USER}
5656
WORKDIR ${WORKDIR_PATH}
5757

5858
USER ${BUILD_USER}
5959
ENV PATH=${WORKDIR_PATH}/miniconda/bin:${WORKDIR_PATH}/cmake-dir/bin:$PATH
60-
ENV IE_PLUGINS_PATH=${INTEL_OPENVINO_DIR}/deployment_tools/inference_engine/lib/intel64
61-
ENV LD_LIBRARY_PATH=/opt/intel/opencl:${INTEL_OPENVINO_DIR}/inference_engine/external/gna/lib:${INTEL_OPENVINO_DIR}/deployment_tools/inference_engine/external/mkltiny_lnx/lib:$INTEL_OPENVINO_DIR/deployment_tools/ngraph/lib:${INTEL_OPENVINO_DIR}/deployment_tools/inference_engine/external/omp/lib:${INTEL_OPENVINO_DIR}/deployment_tools/inference_engine/external/tbb/lib:${IE_PLUGINS_PATH}:${LD_LIBRARY_PATH}
60+
ENV IE_PLUGINS_PATH=${INTEL_OPENVINO_DIR}/runtime/lib/intel64
61+
ENV LD_LIBRARY_PATH=/opt/intel/opencl:${INTEL_OPENVINO_DIR}/runtime/3rdparty/tbb/lib:${IE_PLUGINS_PATH}:${LD_LIBRARY_PATH}

dockerfiles/Dockerfile.openvino-csharp

Lines changed: 18 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -15,15 +15,13 @@ ARG MY_ROOT=/code
1515
ENV PATH /opt/miniconda/bin:/code/cmake-3.21.0-linux-x86_64/bin:$PATH
1616
ENV LD_LIBRARY_PATH=/opt/miniconda/lib:/usr/lib:/usr/lib/x86_64-linux-gnu:$LD_LIBRARY_PATH
1717

18-
ENV INTEL_OPENVINO_DIR=/opt/intel/openvino_2021.4.752
19-
ENV InferenceEngine_DIR=${INTEL_OPENVINO_DIR}/deployment_tools/inference_engine/share
20-
ENV IE_PLUGINS_PATH=${INTEL_OPENVINO_DIR}/deployment_tools/inference_engine/lib/intel64
21-
ENV LD_LIBRARY_PATH=/opt/intel/opencl:${INTEL_OPENVINO_DIR}/inference_engine/external/gna/lib:${INTEL_OPENVINO_DIR}/deployment_tools/inference_engine/external/mkltiny_lnx/lib:$INTEL_OPENVINO_DIR/deployment_tools/ngraph/lib:${INTEL_OPENVINO_DIR}/deployment_tools/inference_engine/external/omp/lib:${INTEL_OPENVINO_DIR}/deployment_tools/inference_engine/external/tbb/lib:${IE_PLUGINS_PATH}:${LD_LIBRARY_PATH}
22-
ENV OpenCV_DIR=${INTEL_OPENVINO_DIR}/opencv/share/OpenCV
23-
ENV LD_LIBRARY_PATH=${INTEL_OPENVINO_DIR}/opencv/lib:${INTEL_OPENVINO_DIR}/opencv/share/OpenCV/3rdparty/lib:${LD_LIBRARY_PATH}
24-
ENV HDDL_INSTALL_DIR=${INTEL_OPENVINO_DIR}/deployment_tools/inference_engine/external/hddl
25-
ENV LD_LIBRARY_PATH=${INTEL_OPENVINO_DIR}/deployment_tools/inference_engine/external/hddl/lib:$LD_LIBRARY_PATH
26-
ENV ngraph_DIR=${INTEL_OPENVINO_DIR}/deployment_tools/ngraph/cmake
18+
ENV INTEL_OPENVINO_DIR=/opt/intel/openvino_2022.1.0.643
19+
ENV InferenceEngine_DIR=${INTEL_OPENVINO_DIR}/runtime/cmake
20+
ENV IE_PLUGINS_PATH=${INTEL_OPENVINO_DIR}/runtime/lib/intel64
21+
ENV LD_LIBRARY_PATH=/opt/intel/opencl:${INTEL_OPENVINO_DIR}/runtime/3rdparty/tbb/lib:${IE_PLUGINS_PATH}:${LD_LIBRARY_PATH}
22+
ENV HDDL_INSTALL_DIR=${INTEL_OPENVINO_DIR}/runtime/3rdparty/hddl
23+
ENV LD_LIBRARY_PATH=${INTEL_OPENVINO_DIR}/runtime/3rdparty/hddl/lib:$LD_LIBRARY_PATH
24+
ENV ngraph_DIR=${INTEL_OPENVINO_DIR}/runtime/cmake
2725
ENV LANG en_US.UTF-8
2826
ENV DEBIAN_FRONTEND=noninteractive
2927

@@ -49,19 +47,15 @@ RUN apt update -y && \
4947
/bin/mkdir -p '/usr/local/lib/pkgconfig' && \
5048
# Install OpenVINO
5149
cd ${MY_ROOT} && \
52-
wget https://apt.repos.intel.com/openvino/2021/GPG-PUB-KEY-INTEL-OPENVINO-2021 && \
53-
apt-key add GPG-PUB-KEY-INTEL-OPENVINO-2021 && rm GPG-PUB-KEY-INTEL-OPENVINO-2021 && \
54-
cd /etc/apt/sources.list.d && \
55-
echo "deb https://apt.repos.intel.com/openvino/2021 all main">intel-openvino-2021.list && \
50+
wget https://apt.repos.intel.com/intel-gpg-keys/GPG-PUB-KEY-INTEL-SW-PRODUCTS.PUB && \
51+
apt-key add GPG-PUB-KEY-INTEL-SW-PRODUCTS.PUB && rm GPG-PUB-KEY-INTEL-SW-PRODUCTS.PUB && \
52+
echo "deb https://apt.repos.intel.com/openvino/2022 bionic main" | tee /etc/apt/sources.list.d/intel-openvino-2022.list && \
5653
apt update -y && \
57-
apt -y install intel-openvino-dev-ubuntu18-2021.4.752 && \
54+
apt -y install openvino-2022.1.0 && \
5855
cd ${INTEL_OPENVINO_DIR}/install_dependencies && ./install_openvino_dependencies.sh -y && \
59-
cd ${INTEL_OPENVINO_DIR} && rm -rf documentation data_processing && \
60-
cd deployment_tools/ && rm -rf model_optimizer open_model_zoo demo tools && \
61-
cd inference_engine && rm -rf samples && \
6256
cd /opt/libusb-1.0.22/ && \
6357
/usr/bin/install -c -m 644 libusb-1.0.pc '/usr/local/lib/pkgconfig' && \
64-
cp /opt/intel/openvino_2021/deployment_tools/inference_engine/external/97-myriad-usbboot.rules /etc/udev/rules.d/ && \
58+
cp ${INTEL_OPENVINO_DIR}/runtime/3rdparty/97-myriad-usbboot.rules /etc/udev/rules.d/ && \
6559
ldconfig && \
6660
# Install GPU runtime and drivers
6761
cd ${MY_ROOT} && \
@@ -70,18 +64,18 @@ RUN apt update -y && \
7064
apt update -y && \
7165
apt install -y --no-install-recommends ocl-icd-libopencl1 && \
7266
rm -rf /var/lib/apt/lists/* && \
73-
wget "https://github.com/intel/compute-runtime/releases/download/19.41.14441/intel-gmmlib_19.3.2_amd64.deb" && \
74-
wget "https://github.com/intel/compute-runtime/releases/download/19.41.14441/intel-igc-core_1.0.2597_amd64.deb" && \
75-
wget "https://github.com/intel/compute-runtime/releases/download/19.41.14441/intel-igc-opencl_1.0.2597_amd64.deb" && \
76-
wget "https://github.com/intel/compute-runtime/releases/download/19.41.14441/intel-opencl_19.41.14441_amd64.deb" && \
77-
wget "https://github.com/intel/compute-runtime/releases/download/19.41.14441/intel-ocloc_19.41.14441_amd64.deb" && \
67+
wget "https://github.com/intel/compute-runtime/releases/download/21.38.21026/intel-gmmlib_21.2.1_amd64.deb" && \
68+
wget "https://github.com/intel/intel-graphics-compiler/releases/download/igc-1.0.8708/intel-igc-core_1.0.8708_amd64.deb" && \
69+
wget "https://github.com/intel/intel-graphics-compiler/releases/download/igc-1.0.8708/intel-igc-opencl_1.0.8708_amd64.deb" && \
70+
wget "https://github.com/intel/compute-runtime/releases/download/21.38.21026/intel-opencl_21.38.21026_amd64.deb" && \
71+
wget "https://github.com/intel/compute-runtime/releases/download/21.38.21026/intel-ocloc_21.38.21026_amd64.deb" && \
72+
wget "https://github.com/intel/compute-runtime/releases/download/21.38.21026/intel-level-zero-gpu_1.2.21026_amd64.deb" && \
7873
dpkg -i /tmp/opencl/*.deb && \
7974
ldconfig && \
8075
rm -rf /tmp/opencl && \
8176
# Install Mono
8277
cd ${MY_ROOT} && \
8378
apt install -y gnupg ca-certificates && \
84-
#apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys 3FA7E0328081BFF6A14DA29AA6A19B38D3D831EF && \
8579
curl https://download.mono-project.com/repo/xamarin.gpg | apt-key add - && \
8680
echo "deb https://download.mono-project.com/repo/ubuntu stable-bionic main" | sudo tee /etc/apt/sources.list.d/mono-official-stable.list && \
8781
apt update -y && \

dockerfiles/README.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -152,6 +152,11 @@ If the `device_type` runtime config option is not explicitly specified, CPU will
152152
```
153153
docker run -it --rm --device-cgroup-rule='c 189:* rmw' -v /dev/bus/usb:/dev/bus/usb --device /dev/dri:/dev/dri onnxruntime-gpu:latest
154154
```
155+
If your host system is Ubuntu 20, use the below command to run. Please find the alternative steps [here](https://github.com/openvinotoolkit/docker_ci/blob/master/configure_gpu_ubuntu20.md).
156+
```
157+
docker run -it --rm --device-cgroup-rule='c 189:* rmw' -v /dev/bus/usb:/dev/bus/usb --device /dev/dri:/dev/dri --group-add=$(stat -c "%g" /dev/dri/render*) onnxruntime-gpu:latest
158+
```
159+
155160
### OpenVINO on Myriad VPU Accelerator
156161
157162
1. Build the docker image from the DockerFile in this repository.

include/onnxruntime/core/session/onnxruntime_c_api.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -503,7 +503,7 @@ typedef struct OrtMIGraphXProviderOptions {
503503
*/
504504
typedef struct OrtOpenVINOProviderOptions {
505505
#ifdef __cplusplus
506-
OrtOpenVINOProviderOptions() : device_type{}, enable_vpu_fast_compile{}, device_id{}, num_of_threads{}, use_compiled_network{}, blob_dump_path{}, context{} {}
506+
OrtOpenVINOProviderOptions() : device_type{}, enable_vpu_fast_compile{}, device_id{}, num_of_threads{}, use_compiled_network{}, blob_dump_path{}, context{}, enable_opencl_throttling{} {}
507507
#endif
508508
/** \brief Device type string
509509
*
@@ -516,6 +516,7 @@ typedef struct OrtOpenVINOProviderOptions {
516516
unsigned char use_compiled_network; ///< 0 = disabled, nonzero = enabled
517517
const char* blob_dump_path; // path is set to empty by default
518518
void* context;
519+
unsigned char enable_opencl_throttling; ///< 0 = disabled, nonzero = enabled
519520
} OrtOpenVINOProviderOptions;
520521

521522
struct OrtApi;

onnxruntime/core/providers/openvino/backend_manager.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// Copyright(C) 2019 Intel Corporation
1+
// Copyright (C) 2019-2022 Intel Corporation
22
// Licensed under the MIT License
33

44
#include "core/providers/shared_library/provider_api.h"

onnxruntime/core/providers/openvino/backend_manager.h

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,9 @@
1-
// Copyright(C) 2019 Intel Corporation
1+
// Copyright (C) 2019-2022 Intel Corporation
22
// Licensed under the MIT License
33

44
#pragma once
55

6-
#include <inference_engine.hpp>
7-
6+
#include "ov_interface.h"
87
#include "contexts.h"
98
#include "ibackend.h"
109

0 commit comments

Comments
 (0)