microsoft / onnxruntime

ONNX Runtime: cross-platform, high performance ML inferencing and training accelerator
https://onnxruntime.ai
MIT License
14.66k stars 2.93k forks source link

[Build] can't build OpenVINO #16593

Closed SimonRelu closed 1 year ago

SimonRelu commented 1 year ago

Describe the issue

I always get the following error: [Couldn't locate OpenVINO] OpenVINO may not have been initialized even though I set up the OpenVINO env:

$setupvars.bat -pyver 3.8
Python 3.8.10
[setupvars.bat] OpenVINO environment initialized

Urgency

No response

Target platform

Windows 11

Build script

.\build.bat --config Release `
           --build_shared_lib `
           --parallel `
           --use_openvino "MULTI:GPU,CPU"`
           --build_wheel `
           --enable_pybind `
           --disable_contrib_ops `
           --skip_tests `
           --skip_onnx_tests `
           --skip_submodule_sync

Error / output

2023-07-05 10:01:00,048 tools_python_utils [INFO] - flatbuffers module is not installed. parse_config will not be available
2023-07-05 10:01:03,839 build [DEBUG] - Command line arguments:
  --build_dir 'C:\Users\adria\simon\onnxbuilder\onnxruntime\\build\Windows' --config Release --build_shared_lib --parallel --use_openvino MULTI:GPU,CPU --build_wheel --enable_pybind --disable_contrib_ops --skip_tests --skip_onnx_tests --skip_submodule_sync
2023-07-05 10:01:03,861 build [DEBUG] - Defaulting to running update, build [and test for native builds].
2023-07-05 10:01:03,868 build [INFO] - Build started
2023-07-05 10:01:03,874 util.run [INFO] - Running subprocess in 'C:\Users\adria\simon\onnxbuilder\onnxruntime'
  'C:\Users\adria\AppData\Local\Programs\Python\Python38\python.exe' -m pip install setuptools wheel pytest 'numpy>=1.16.6' 'sympy>=1.10' packaging cerberus
Requirement already satisfied: setuptools in c:\users\adria\appdata\local\programs\python\python38\lib\site-packages (65.6.3)
Requirement already satisfied: wheel in c:\users\adria\appdata\local\programs\python\python38\lib\site-packages (0.38.4)
Requirement already satisfied: pytest in c:\users\adria\appdata\local\programs\python\python38\lib\site-packages (6.2.4)
Requirement already satisfied: numpy>=1.16.6 in c:\users\adria\appdata\local\programs\python\python38\lib\site-packages (1.23.0)
Requirement already satisfied: sympy>=1.10 in c:\users\adria\appdata\local\programs\python\python38\lib\site-packages (1.12)
Requirement already satisfied: packaging in c:\users\adria\appdata\local\programs\python\python38\lib\site-packages (20.9)
Requirement already satisfied: cerberus in c:\users\adria\appdata\local\programs\python\python38\lib\site-packages (1.3.4)
Requirement already satisfied: colorama in c:\users\adria\appdata\local\programs\python\python38\lib\site-packages (from pytest) (0.4.4)
Requirement already satisfied: py>=1.8.2 in c:\users\adria\appdata\local\programs\python\python38\lib\site-packages (from pytest) (1.11.0)
Requirement already satisfied: attrs>=19.2.0 in c:\users\adria\appdata\local\programs\python\python38\lib\site-packages (from pytest) (21.2.0)
Requirement already satisfied: iniconfig in c:\users\adria\appdata\local\programs\python\python38\lib\site-packages (from pytest) (1.1.1)
Requirement already satisfied: toml in c:\users\adria\appdata\local\programs\python\python38\lib\site-packages (from pytest) (0.10.2)
Requirement already satisfied: atomicwrites>=1.0 in c:\users\adria\appdata\local\programs\python\python38\lib\site-packages (from pytest) (1.4.1)
Requirement already satisfied: pluggy<1.0.0a1,>=0.12 in c:\users\adria\appdata\local\programs\python\python38\lib\site-packages (from pytest) (0.13.1)
Requirement already satisfied: mpmath>=0.19 in c:\users\adria\appdata\local\programs\python\python38\lib\site-packages (from sympy>=1.10) (1.3.0)
Requirement already satisfied: pyparsing>=2.0.2 in c:\users\adria\appdata\local\programs\python\python38\lib\site-packages (from packaging) (2.4.7)

[notice] A new release of pip available: 22.3.1 -> 23.1.2
[notice] To update, run: python.exe -m pip install --upgrade pip
2023-07-05 10:01:06,009 util.run [DEBUG] - Subprocess completed. Return code: 0
2023-07-05 10:01:06,009 build [INFO] - Generating CMake build tree
2023-07-05 10:01:06,010 util.run [INFO] - Running subprocess in 'C:\Users\adria\simon\onnxbuilder\onnxruntime\\build\Windows\Release'
  'C:\Program Files\CMake\bin\cmake.EXE' 'C:\Users\adria\simon\onnxbuilder\onnxruntime\cmake' -Donnxruntime_RUN_ONNX_TESTS=OFF -Donnxruntime_GENERATE_TEST_REPORTS=ON '-DPython_EXECUTABLE=C:\Users\adria\AppData\Local\Programs\Python\Python38\python.exe' '-DPYTHON_EXECUTABLE=C:\Users\adria\AppData\Local\Programs\Python\Python38\python.exe' -Donnxruntime_USE_MIMALLOC=OFF -Donnxruntime_ENABLE_PYTHON=ON -Donnxruntime_BUILD_CSHARP=OFF -Donnxruntime_BUILD_JAVA=OFF -Donnxruntime_BUILD_NODEJS=OFF -Donnxruntime_BUILD_OBJC=OFF -Donnxruntime_BUILD_SHARED_LIB=ON -Donnxruntime_BUILD_APPLE_FRAMEWORK=OFF -Donnxruntime_USE_DNNL=OFF -Donnxruntime_USE_NNAPI_BUILTIN=OFF -Donnxruntime_USE_RKNPU=OFF -Donnxruntime_USE_LLVM=OFF -Donnxruntime_ENABLE_MICROSOFT_INTERNAL=OFF -Donnxruntime_USE_VITISAI=OFF -Donnxruntime_USE_TENSORRT=OFF -Donnxruntime_SKIP_AND_PERFORM_FILTERED_TENSORRT_TESTS=ON -Donnxruntime_USE_TENSORRT_BUILTIN_PARSER=OFF -Donnxruntime_TENSORRT_PLACEHOLDER_BUILDER=OFF -Donnxruntime_USE_TVM=OFF -Donnxruntime_TVM_CUDA_RUNTIME=OFF -Donnxruntime_TVM_USE_HASH=OFF -Donnxruntime_USE_MIGRAPHX=OFF -Donnxruntime_CROSS_COMPILING=OFF -Donnxruntime_DISABLE_CONTRIB_OPS=ON -Donnxruntime_DISABLE_ML_OPS=OFF -Donnxruntime_DISABLE_RTTI=OFF -Donnxruntime_DISABLE_EXCEPTIONS=OFF -Donnxruntime_MINIMAL_BUILD=OFF -Donnxruntime_EXTENDED_MINIMAL_BUILD=OFF -Donnxruntime_MINIMAL_BUILD_CUSTOM_OPS=OFF -Donnxruntime_REDUCED_OPS_BUILD=OFF -Donnxruntime_ENABLE_LANGUAGE_INTEROP_OPS=OFF -Donnxruntime_USE_DML=OFF -Donnxruntime_USE_WINML=OFF -Donnxruntime_BUILD_MS_EXPERIMENTAL_OPS=OFF -Donnxruntime_USE_TELEMETRY=OFF -Donnxruntime_ENABLE_LTO=OFF -Donnxruntime_USE_ACL=OFF -Donnxruntime_USE_ACL_1902=OFF -Donnxruntime_USE_ACL_1905=OFF -Donnxruntime_USE_ACL_1908=OFF -Donnxruntime_USE_ACL_2002=OFF -Donnxruntime_USE_ARMNN=OFF -Donnxruntime_ARMNN_RELU_USE_CPU=ON -Donnxruntime_ARMNN_BN_USE_CPU=ON -Donnxruntime_ENABLE_NVTX_PROFILE=OFF -Donnxruntime_ENABLE_TRAINING=OFF -Donnxruntime_ENABLE_TRAINING_OPS=OFF -Donnxruntime_ENABLE_TRAINING_APIS=OFF -Donnxruntime_ENABLE_CPU_FP16_OPS=OFF -Donnxruntime_USE_NCCL=OFF -Donnxruntime_BUILD_BENCHMARKS=OFF -Donnxruntime_USE_ROCM=OFF -DOnnxruntime_GCOV_COVERAGE=OFF -Donnxruntime_USE_MPI=ON -Donnxruntime_ENABLE_MEMORY_PROFILE=OFF -Donnxruntime_ENABLE_CUDA_LINE_NUMBER_INFO=OFF -Donnxruntime_BUILD_WEBASSEMBLY=OFF -Donnxruntime_BUILD_WEBASSEMBLY_STATIC_LIB=OFF -Donnxruntime_ENABLE_WEBASSEMBLY_EXCEPTION_CATCHING=ON -Donnxruntime_ENABLE_WEBASSEMBLY_API_EXCEPTION_CATCHING=OFF -Donnxruntime_ENABLE_WEBASSEMBLY_EXCEPTION_THROWING=ON -Donnxruntime_ENABLE_WEBASSEMBLY_THREADS=OFF -Donnxruntime_ENABLE_WEBASSEMBLY_DEBUG_INFO=OFF -Donnxruntime_ENABLE_WEBASSEMBLY_PROFILING=OFF -Donnxruntime_ENABLE_EAGER_MODE=OFF -Donnxruntime_ENABLE_LAZY_TENSOR=OFF -Donnxruntime_ENABLE_EXTERNAL_CUSTOM_OP_SCHEMAS=OFF -Donnxruntime_ENABLE_CUDA_PROFILING=OFF -Donnxruntime_ENABLE_ROCM_PROFILING=OFF -Donnxruntime_USE_XNNPACK=OFF -Donnxruntime_USE_CANN=OFF -Donnxruntime_USE_OPENVINO=ON -Donnxruntime_USE_OPENVINO_MYRIAD=OFF -Donnxruntime_USE_OPENVINO_GPU_FP32=OFF -Donnxruntime_USE_OPENVINO_GPU_FP16=OFF -Donnxruntime_USE_OPENVINO_CPU_FP32=OFF -Donnxruntime_USE_OPENVINO_CPU_FP16=OFF -Donnxruntime_USE_OPENVINO_VAD_M=OFF -Donnxruntime_USE_OPENVINO_VAD_F=OFF -Donnxruntime_USE_OPENVINO_MYRIAD_NP=OFF -Donnxruntime_USE_OPENVINO_GPU_FP32_NP=OFF -Donnxruntime_USE_OPENVINO_GPU_FP16_NP=OFF -Donnxruntime_USE_OPENVINO_CPU_FP32_NP=OFF -Donnxruntime_USE_OPENVINO_CPU_FP16_NP=OFF -Donnxruntime_USE_OPENVINO_VAD_M_NP=OFF -Donnxruntime_USE_OPENVINO_VAD_F_NP=OFF -Donnxruntime_USE_OPENVINO_HETERO=OFF -Donnxruntime_USE_OPENVINO_DEVICE=MULTI:GPU,CPU -Donnxruntime_USE_OPENVINO_MULTI=ON -Donnxruntime_USE_OPENVINO_AUTO=OFF -Donnxruntime_USE_FULL_PROTOBUF=ON -DProtobuf_USE_STATIC_LIBS=ON -DCMAKE_TLS_VERIFY=ON -DFETCHCONTENT_QUIET=OFF -DONNX_USE_MSVC_STATIC_RUNTIME=OFF -Dprotobuf_MSVC_STATIC_RUNTIME=OFF -Dgtest_force_shared_crt=ON -Donnxruntime_PYBIND_EXPORT_OPSCHEMA=OFF -A x64 -T host=x64 -G 'Visual Studio 16 2019' -Donnxruntime_ENABLE_MEMLEAK_CHECKER=OFF -DCMAKE_BUILD_TYPE=Release '-DCMAKE_PREFIX_PATH=C:\Users\adria\simon\onnxbuilder\onnxruntime\\build\Windows/Release/installed'
CMake Deprecation Warning at CMakeLists.txt:13 (cmake_policy):
  The OLD behavior for policy CMP0104 will be removed from a future version
  of CMake.

  The cmake-policies(7) manual explains that the OLD behaviors of all
  policies are deprecated and that a policy should be set to OLD only under
  specific short-term circumstances.  Projects should be ported to the NEW
  behavior and not rely on setting a policy to OLD.

-- Selecting Windows SDK version 10.0.22000.0 to target Windows 10.0.22621.
Building ONNX Runtime for Windows 7 and newer
Patch found: C:/Program Files/Git/usr/bin/patch.exe
-- Found Python: C:\Users\adria\AppData\Local\Programs\Python\Python38\python.exe (found suitable version "3.8.10", minimum required is "3.6") found components: Interpreter Development.Module NumPy
Loading Dependencies URLs ...
Loading Dependencies ...
-- Populating abseil_cpp
-- Selecting Windows SDK version 10.0.22000.0 to target Windows 10.0.22621.
-- Configuring done (0.0s)
-- Generating done (0.0s)
-- Build files have been written to: C:/Users/adria/simon/onnxbuilder/onnxruntime/build/Windows/Release/_deps/abseil_cpp-subbuild
Microsoft (R) Build Engine version 16.11.2+f32259642 for .NET Framework
Copyright (C) Microsoft Corporation. All rights reserved.

  1>
-- Abseil source dir:C:/Users/adria/simon/onnxbuilder/onnxruntime/build/Windows/Release/_deps/abseil_cpp-src
-- Populating date
-- Selecting Windows SDK version 10.0.22000.0 to target Windows 10.0.22621.
-- Configuring done (0.0s)
-- Generating done (0.0s)
-- Build files have been written to: C:/Users/adria/simon/onnxbuilder/onnxruntime/build/Windows/Release/_deps/date-subbuild
Microsoft (R) Build Engine version 16.11.2+f32259642 for .NET Framework
Copyright (C) Microsoft Corporation. All rights reserved.

  1>
-- Populating protobuf
-- Selecting Windows SDK version 10.0.22000.0 to target Windows 10.0.22621.
-- Configuring done (0.0s)
-- Generating done (0.0s)
-- Build files have been written to: C:/Users/adria/simon/onnxbuilder/onnxruntime/build/Windows/Release/_deps/protobuf-subbuild
Microsoft (R) Build Engine version 16.11.2+f32259642 for .NET Framework
Copyright (C) Microsoft Corporation. All rights reserved.

  1>
-- 
-- 3.20.2.0
-- Could NOT find ZLIB (missing: ZLIB_LIBRARY ZLIB_INCLUDE_DIR) 
-- Populating nlohmann_json
-- Selecting Windows SDK version 10.0.22000.0 to target Windows 10.0.22621.
-- Configuring done (0.1s)
-- Generating done (0.0s)
-- Build files have been written to: C:/Users/adria/simon/onnxbuilder/onnxruntime/build/Windows/Release/_deps/nlohmann_json-subbuild
Microsoft (R) Build Engine version 16.11.2+f32259642 for .NET Framework
Copyright (C) Microsoft Corporation. All rights reserved.

  1>
-- Using the single-header code from C:/Users/adria/simon/onnxbuilder/onnxruntime/build/Windows/Release/_deps/nlohmann_json-src/single_include/
-- Populating mp11
-- Selecting Windows SDK version 10.0.22000.0 to target Windows 10.0.22621.
-- Configuring done (0.1s)
-- Generating done (0.0s)
-- Build files have been written to: C:/Users/adria/simon/onnxbuilder/onnxruntime/build/Windows/Release/_deps/mp11-subbuild
Microsoft (R) Build Engine version 16.11.2+f32259642 for .NET Framework
Copyright (C) Microsoft Corporation. All rights reserved.

  1>
-- Populating re2
-- Selecting Windows SDK version 10.0.22000.0 to target Windows 10.0.22621.
-- Configuring done (0.1s)
-- Generating done (0.0s)
-- Build files have been written to: C:/Users/adria/simon/onnxbuilder/onnxruntime/build/Windows/Release/_deps/re2-subbuild
Microsoft (R) Build Engine version 16.11.2+f32259642 for .NET Framework
Copyright (C) Microsoft Corporation. All rights reserved.

  1>
-- Populating safeint
-- Selecting Windows SDK version 10.0.22000.0 to target Windows 10.0.22621.
-- Configuring done (0.1s)
-- Generating done (0.0s)
-- Build files have been written to: C:/Users/adria/simon/onnxbuilder/onnxruntime/build/Windows/Release/_deps/safeint-subbuild
Microsoft (R) Build Engine version 16.11.2+f32259642 for .NET Framework
Copyright (C) Microsoft Corporation. All rights reserved.

  1>
-- Populating gsl
-- Selecting Windows SDK version 10.0.22000.0 to target Windows 10.0.22621.
-- Configuring done (0.1s)
-- Generating done (0.0s)
-- Build files have been written to: C:/Users/adria/simon/onnxbuilder/onnxruntime/build/Windows/Release/_deps/gsl-subbuild
Microsoft (R) Build Engine version 16.11.2+f32259642 for .NET Framework
Copyright (C) Microsoft Corporation. All rights reserved.

  1>
-- Populating flatbuffers
-- Selecting Windows SDK version 10.0.22000.0 to target Windows 10.0.22621.
-- Configuring done (0.0s)
-- Generating done (0.0s)
-- Build files have been written to: C:/Users/adria/simon/onnxbuilder/onnxruntime/build/Windows/Release/_deps/flatbuffers-subbuild
Microsoft (R) Build Engine version 16.11.2+f32259642 for .NET Framework
Copyright (C) Microsoft Corporation. All rights reserved.

  1>
-- Populating googletest
-- Selecting Windows SDK version 10.0.22000.0 to target Windows 10.0.22621.
-- Configuring done (0.1s)
-- Generating done (0.0s)
-- Build files have been written to: C:/Users/adria/simon/onnxbuilder/onnxruntime/build/Windows/Release/_deps/googletest-subbuild
Microsoft (R) Build Engine version 16.11.2+f32259642 for .NET Framework
Copyright (C) Microsoft Corporation. All rights reserved.

  1>
-- Found Python: C:\Users\adria\AppData\Local\Programs\Python\Python38\python.exe (found version "3.8.10") found components: Interpreter 
-- Populating pytorch_cpuinfo
-- Selecting Windows SDK version 10.0.22000.0 to target Windows 10.0.22621.
-- Configuring done (0.1s)
-- Generating done (0.0s)
-- Build files have been written to: C:/Users/adria/simon/onnxbuilder/onnxruntime/build/Windows/Release/_deps/pytorch_cpuinfo-subbuild
Microsoft (R) Build Engine version 16.11.2+f32259642 for .NET Framework
Copyright (C) Microsoft Corporation. All rights reserved.

  1>
-- Populating eigen
-- Selecting Windows SDK version 10.0.22000.0 to target Windows 10.0.22621.
-- Configuring done (0.1s)
-- Generating done (0.0s)
-- Build files have been written to: C:/Users/adria/simon/onnxbuilder/onnxruntime/build/Windows/Release/_deps/eigen-subbuild
Microsoft (R) Build Engine version 16.11.2+f32259642 for .NET Framework
Copyright (C) Microsoft Corporation. All rights reserved.

  1>
-- Populating microsoft_wil
-- Selecting Windows SDK version 10.0.22000.0 to target Windows 10.0.22621.
-- Configuring done (0.0s)
-- Generating done (0.0s)
-- Build files have been written to: C:/Users/adria/simon/onnxbuilder/onnxruntime/build/Windows/Release/_deps/microsoft_wil-subbuild
Microsoft (R) Build Engine version 16.11.2+f32259642 for .NET Framework
Copyright (C) Microsoft Corporation. All rights reserved.

  1>
-- Populating onnx
-- Selecting Windows SDK version 10.0.22000.0 to target Windows 10.0.22621.
-- Configuring done (0.0s)
-- Generating done (0.0s)
-- Build files have been written to: C:/Users/adria/simon/onnxbuilder/onnxruntime/build/Windows/Release/_deps/onnx-subbuild
Microsoft (R) Build Engine version 16.11.2+f32259642 for .NET Framework
Copyright (C) Microsoft Corporation. All rights reserved.

  1>
-- Found PythonInterp: C:/Users/adria/AppData/Local/Programs/Python/Python38/python.exe (found version "3.8.10") 
Generated: C:/Users/adria/simon/onnxbuilder/onnxruntime/build/Windows/Release/_deps/onnx-build/onnx/onnx-ml.proto
Generated: C:/Users/adria/simon/onnxbuilder/onnxruntime/build/Windows/Release/_deps/onnx-build/onnx/onnx-operators-ml.proto
Generated: C:/Users/adria/simon/onnxbuilder/onnxruntime/build/Windows/Release/_deps/onnx-build/onnx/onnx-data.proto
-- 
-- ******** Summary ********
--   CMake version             : 3.26.0-rc3
--   CMake command             : C:/Program Files/CMake/bin/cmake.exe
--   System                    : Windows
--   C++ compiler              : C:/Program Files (x86)/Microsoft Visual Studio/2019/Community/VC/Tools/MSVC/14.29.30133/bin/Hostx64/x64/cl.exe
--   C++ compiler version      : 19.29.30148.0
--   CXX flags                 : /DWIN32 /D_WINDOWS /EHsc /EHsc /wd26812 /experimental:external /external:W0 /external:templates- /external:I C:/Users/adria/simon/onnxbuilder/onnxruntime/cmake /external:I C:/Users/adria/simon/onnxbuilder/onnxruntime/build/Windows/Release /MP -DEIGEN_HAS_C99_MATH -DCPUINFO_SUPPORTED /std:c++17 /EHsc /wd26812
--   Build type                : Release
--   Compile definitions       : ORT_ENABLE_STREAM;EIGEN_MPL2_ONLY;EIGEN_HAS_CONSTEXPR;EIGEN_HAS_VARIADIC_TEMPLATES;EIGEN_HAS_CXX11_MATH;EIGEN_HAS_CXX11_ATOMIC;EIGEN_STRONG_INLINE=inline;WINAPI_FAMILY=100;WINVER=0x0601;_WIN32_WINNT=0x0601;NTDDI_VERSION=0x06010000;__STDC_FORMAT_MACROS
--   CMAKE_PREFIX_PATH         : C:\Users\adria\simon\onnxbuilder\onnxruntime\\build\Windows/Release/installed
--   CMAKE_INSTALL_PREFIX      : C:/Program Files/onnxruntime
--   CMAKE_MODULE_PATH         : C:/Users/adria/simon/onnxbuilder/onnxruntime/cmake/external
--
--   ONNX version              : 1.13.0
--   ONNX NAMESPACE            : onnx
--   ONNX_USE_LITE_PROTO       : OFF
--   USE_PROTOBUF_SHARED_LIBS  : OFF
--   Protobuf_USE_STATIC_LIBS  : ON
--   ONNX_DISABLE_EXCEPTIONS   : OFF
--   ONNX_WERROR               : OFF
--   ONNX_BUILD_TESTS          : OFF
--   ONNX_BUILD_BENCHMARKS     : OFF
--
--   Protobuf compiler         :
--   Protobuf includes         :
--   Protobuf libraries        :
--   BUILD_ONNX_PYTHON         : OFF
Finished fetching external dependencies
CMake Error at CMakeLists.txt:1135 (message):
  [Couldn't locate OpenVINO] OpenVINO may not have been initialized

-- Configuring incomplete, errors occurred!
Traceback (most recent call last):
  File "C:\Users\adria\simon\onnxbuilder\onnxruntime\\tools\ci_build\build.py", line 2737, in <module>
    sys.exit(main())
  File "C:\Users\adria\simon\onnxbuilder\onnxruntime\\tools\ci_build\build.py", line 2600, in main
    generate_build_tree(
  File "C:\Users\adria\simon\onnxbuilder\onnxruntime\\tools\ci_build\build.py", line 1330, in generate_build_tree
    run_subprocess(
  File "C:\Users\adria\simon\onnxbuilder\onnxruntime\\tools\ci_build\build.py", line 764, in run_subprocess
    return run(*args, cwd=cwd, capture_stdout=capture_stdout, shell=shell, env=my_env)
  File "C:\Users\adria\simon\onnxbuilder\onnxruntime\tools\python\util\run.py", line 49, in run
    completed_process = subprocess.run(
  File "C:\Users\adria\AppData\Local\Programs\Python\Python38\lib\subprocess.py", line 516, in run
    raise CalledProcessError(retcode, process.args,
subprocess.CalledProcessError: Command '['C:\\Program Files\\CMake\\bin\\cmake.EXE', 'C:\\Users\\adria\\simon\\onnxbuilder\\onnxruntime\\cmake', '-Donnxruntime_RUN_ONNX_TESTS=OFF', '-Donnxruntime_GENERATE_TEST_REPORTS=ON', '-DPython_EXECUTABLE=C:\\Users\\adria\\AppData\\Local\\Programs\\Python\\Python38\\python.exe', '-DPYTHON_EXECUTABLE=C:\\Users\\adria\\AppData\\Local\\Programs\\Python\\Python38\\python.exe', '-Donnxruntime_USE_MIMALLOC=OFF', '-Donnxruntime_ENABLE_PYTHON=ON', '-Donnxruntime_BUILD_CSHARP=OFF', '-Donnxruntime_BUILD_JAVA=OFF', '-Donnxruntime_BUILD_NODEJS=OFF', '-Donnxruntime_BUILD_OBJC=OFF', '-Donnxruntime_BUILD_SHARED_LIB=ON', '-Donnxruntime_BUILD_APPLE_FRAMEWORK=OFF', '-Donnxruntime_USE_DNNL=OFF', '-Donnxruntime_USE_NNAPI_BUILTIN=OFF', '-Donnxruntime_USE_RKNPU=OFF', '-Donnxruntime_USE_LLVM=OFF', '-Donnxruntime_ENABLE_MICROSOFT_INTERNAL=OFF', '-Donnxruntime_USE_VITISAI=OFF', '-Donnxruntime_USE_TENSORRT=OFF', '-Donnxruntime_SKIP_AND_PERFORM_FILTERED_TENSORRT_TESTS=OBLE_WEBASSEMBLY_THREADS=OFF', '-Donnxruntime_ENABLE_WEBASSEMBLY_DEBUG_INFO=OFF', '-Donnxruntime_ENABLE_WEBASSEMBLY_PROFILING=OFF', '-Donnxruntime_ENABLE_EAGER_MODE=OFF', '-Donnxruntime_ENABLE_LAZY_TENSOR=OFF', '-Donnxruntime_ENABLE_EXTERNAL_CUSTOM_OP_SCHEMAS=OFF', '-Donnxruntime_ENABLE_CUDA_PROFILING=OFF', '-Donnxruntime_ENABLE_ROCM_PROFILING=OFF', '-Donnxruntime_USE_XNNPACK=OFF', '-Donnxruntime_USE_CANN=OFF', '-Donnxruntime_USE_OPENVINO=ON', '-Donnxruntime_USE_OPENVINO_MYRIAD=OFF', '-Donnxruntime_USE_OPENVINO_GPU_FP32=OFF', '-Donnxruntime_USE_OPENVINO_GPU_FP16=OFF', '-Donnxruntime_USE_OPENVINO_CPU_FP32=OFF', '-Donnxruntime_USE_OPENVINO_CPU_FP16=OFF', '-Donnxruntime_USE_OPENVINO_VAD_M=OFF', '-Donnxruntime_USE_OPENVINO_VAD_F=OFF', '-Donnxruntime_USE_OPENVINO_MYRIAD_NP=OFF', '-Donnxruntime_USE_OPENVINO_GPU_FP32_NP=OFF', '-Donnxruntime_USE_OPENVINO_GPU_FP16_NP=OFF', '-Donnxruntime_USE_OPENVINO_CPU_FP32_NP=OFF', '-Donnxruntime_USE_OPENVINO_CPU_FP16_NP=OFF', '-Donnxruntime_USE_OPENVINO_VAD_M_NP=OFF', '-Donnxruntime_USE_OPENVINO_VAD_F_NP=OFF', '-Donnxruntime_USE_OPENVINO_HETERO=OFF', '-Donnxruntime_USE_OPENVINO_DEVICE=MULTI:GPU,CPU', '-Donnxruntime_USE_OPENVINO_MULTI=ON', '-Donnxruntime_USE_OPENVINO_AUTO=OFF', '-Donnxruntime_USE_FULL_PROTOBUF=ON', '-DProtobuf_USE_STATIC_LIBS=ON', '-DCMAKE_TLS_VERIFY=ON', '-DFETCHCONTENT_QUIET=OFF', '-DONNX_USE_MSVC_STATIC_RUNTIME=OFF', '-Dprotobuf_MSVC_STATIC_RUNTIME=OFF', '-Dgtest_force_shared_crt=ON', '-Donnxruntime_PYBIND_EXPORT_OPSCHEMA=OFF', '-A', 'x64', '-T', 'host=x64', '-G', 'Visual Studio 16 2019', '-Donnxruntime_ENABLE_MEMLEAK_CHECKER=OFF', '-DCMAKE_BUILD_TYPE=Release', '-DCMAKE_PREFIX_PATH=C:\\Users\\adria\\simon\\onnxbuilder\\onnxruntime\\\\build\\Windows/Release/installed']' returned non-zero exit status 1.

Visual Studio Version

2019

GCC / Compiler Version

No response

baijumeswani commented 1 year ago

The build error seems to be coming from these lines:

https://github.com/microsoft/onnxruntime/blob/d8792f80408255272a407d59d457fdcbb674a9b5/cmake/CMakeLists.txt#L1182-L1184

Could you try setting the ENV variable INTEL_OPENVINO_DIR to the path of your OpenVINO toolkit installation and try again?

SimonRelu commented 1 year ago

Hey, thank you for the reply. When I do that I get the following error:

CMake Error at onnxruntime_providers.cmake:793 (find_package):
  By not providing "FindInferenceEngine.cmake" in CMAKE_MODULE_PATH this
  project has asked CMake to find a package configuration file provided by
  "InferenceEngine", but CMake did not find one.

  Could not find a package configuration file provided by "InferenceEngine"
  with any of the following names:

    InferenceEngineConfig.cmake
    inferenceengine-config.cmake

  Add the installation prefix of "InferenceEngine" to CMAKE_PREFIX_PATH or
  set "InferenceEngine_DIR" to a directory containing one of the above files.
  If "InferenceEngine" provides a separate development package or SDK, be
  sure it has been installed.

I install openvino from here: https://storage.openvinotoolkit.org/repositories/openvino/packages/2023.0.1/windows And I verified that I set the env correctly with:

>ls $env:INTEL_OPENVINO_DIR    

    Directory: C:\Users\holge\simon\onnxbuilder\openvino\w_openvino_toolkit_windows_2023.0.0.10926.b4452d56304_x86_64

Mode                 LastWriteTime         Length Name
----                 -------------         ------ ----
d-----          7/3/2023   5:57 PM                docs
d-----          7/3/2023   5:57 PM                python
d-----          7/3/2023   5:57 PM                runtime
d-----          7/3/2023   5:57 PM                samples
d-----          7/3/2023   5:57 PM                tools
-a----          5/9/2023   8:41 AM           4701 setupvars.bat
baijumeswani commented 1 year ago

Are you following instructions from here: https://onnxruntime.ai/docs/execution-providers/OpenVINO-ExecutionProvider.html#build ?

SimonRelu commented 1 year ago

Yes

baijumeswani commented 1 year ago

jywu-msft any suggestions on how to get a successful onnxruntime with OpenVINO build?

SimonRelu commented 1 year ago

I've tried this on 2 different machines and got the same error twice. I've also tried building on Linux with the same options and that does work. I build against the 1.14.1 tag. I also tried with the latest main and it also fails with the same error.

SimonRelu commented 1 year ago

Seems like it doesn't work with PowerShell but does with command prompt for some reason. Maybe it could be useful to add this disclaimer to the build instructions?

saharfraza commented 1 year ago

Can you close this request