From 0f7a31b4c38a368381ab11a70c6fd47df80a356e Mon Sep 17 00:00:00 2001 From: Maximilian Mueller Date: Wed, 28 Feb 2024 16:47:38 +0100 Subject: [PATCH 1/2] Find openvino based on env variable --- cmake/onnxruntime_providers_openvino.cmake | 1 + 1 file changed, 1 insertion(+) diff --git a/cmake/onnxruntime_providers_openvino.cmake b/cmake/onnxruntime_providers_openvino.cmake index e26f0bfc0b751..be1eacf7d446f 100644 --- a/cmake/onnxruntime_providers_openvino.cmake +++ b/cmake/onnxruntime_providers_openvino.cmake @@ -16,6 +16,7 @@ endif() # Header paths + list(APPEND CMAKE_PREFIX_PATH "$ENV{INTEL_OPENVINO_DIR}/runtime/cmake") find_package(InferenceEngine REQUIRED) find_package(ngraph REQUIRED) From 607cc0ce277f6ad95489473e53c02c35a1be2725 Mon Sep 17 00:00:00 2001 From: Maximilian Mueller Date: Wed, 28 Feb 2024 18:09:04 +0100 Subject: [PATCH 2/2] simplify openvino finder --- cmake/onnxruntime_providers_openvino.cmake | 13 +++---------- 1 file changed, 3 insertions(+), 10 deletions(-) diff --git a/cmake/onnxruntime_providers_openvino.cmake b/cmake/onnxruntime_providers_openvino.cmake index be1eacf7d446f..fbe4a457ca56a 100644 --- a/cmake/onnxruntime_providers_openvino.cmake +++ b/cmake/onnxruntime_providers_openvino.cmake @@ -15,15 +15,8 @@ set(CMAKE_MAP_IMPORTED_CONFIG_RELWITHDEBINFO Release) endif() - # Header paths - list(APPEND CMAKE_PREFIX_PATH "$ENV{INTEL_OPENVINO_DIR}/runtime/cmake") - find_package(InferenceEngine REQUIRED) - find_package(ngraph REQUIRED) - - if (OPENVINO_2022_1 OR OPENVINO_2022_2) find_package(OpenVINO REQUIRED COMPONENTS Runtime ONNX) - list (OV_20_LIBS openvino::frontend::onnx openvino::runtime) - endif() + list(APPEND OV_20_LIBS openvino::frontend::onnx openvino::runtime) if (WIN32) unset(CMAKE_MAP_IMPORTED_CONFIG_RELWITHDEBINFO) @@ -31,9 +24,9 @@ if ((DEFINED ENV{OPENCL_LIBS}) AND (DEFINED ENV{OPENCL_INCS})) add_definitions(-DIO_BUFFER_ENABLED=1) - list(APPEND OPENVINO_LIB_LIST $ENV{OPENCL_LIBS} ${OV_20_LIBS} ${InferenceEngine_LIBRARIES} ${NGRAPH_LIBRARIES} ngraph::onnx_importer ${PYTHON_LIBRARIES}) + list(APPEND OPENVINO_LIB_LIST $ENV{OPENCL_LIBS} ${OV_20_LIBS} ${InferenceEngine_LIBRARIES} ${PYTHON_LIBRARIES}) else() - list(APPEND OPENVINO_LIB_LIST ${OV_20_LIBS} ${InferenceEngine_LIBRARIES} ${NGRAPH_LIBRARIES} ngraph::onnx_importer ${PYTHON_LIBRARIES}) + list(APPEND OPENVINO_LIB_LIST ${OV_20_LIBS} ${InferenceEngine_LIBRARIES} ${PYTHON_LIBRARIES}) endif() source_group(TREE ${ONNXRUNTIME_ROOT}/core FILES ${onnxruntime_providers_openvino_cc_srcs})