openvinotoolkit / openvino

OpenVINO™ is an open-source toolkit for optimizing and deploying AI inference
https://docs.openvino.ai
Apache License 2.0
7.34k stars 2.29k forks source link

[Build]: OpenVINO Compilation Error: cv::gapi::onnx::Params missing cfgSessionOptions and cfgOptLevel #27469

Open Hooray0012 opened 2 weeks ago

Hooray0012 commented 2 weeks ago

OpenVINO Version

2024.4.0

Operating System

Ubuntu 22.04 (LTS)

Hardware Architecture

x86 (64 bits)

Target Platform

OpenCV Version: 4.10.0

Build issue description

Description:

When attempting to compile OpenVINO from source, I encountered an error in openvino/src/plugins/intel_npu/tools/protopipe/src/simulation/simulation.cpp related to missing member functions in cv::gapi::onnx::Params. Specifically, cfgSessionOptions and cfgOptLevel appear to be undefined, causing the compilation to fail.

Additional Note:

During the build process, there were many code style warnings in openvino/src/plugins/intel_npu, such as unnecessary semicolons and redundant virtual keywords.

I have to manual modifications to pass the style checks.

Such as :

/home/hr/openvino/src/plugins/intel_npu/tools/protopipe/src/utils/data_providers.hpp
Category 'readability/inheritance' errors found: 1
Total errors found: 1

and :

/home/hr/openvino/src/plugins/intel_npu/tools/protopipe/src/graph.cpp:62:  You don't need a ; after a }  [readability/braces] [4]
/home/hr/openvino/src/plugins/intel_npu/tools/protopipe/src/graph.cpp:115:  You don't need a ; after a }  [readability/braces] [4]
Done processing /home/hr/openvino/openvino/src/plugins/intel_npu/tools/protopipe/src/graph.cpp
Category 'readability/braces' errors found: 2
Total errors found: 2

and so on.

Build script or step-by-step to reproduce

git clone https://github.com/openvinotoolkit/openvino.git cd openvino git submodule update --init --recursive sudo ./install_build_dependencies.sh mkdir build && cd build cmake -DCMAKE_BUILD_TYPE=Release .. cmake --build . --parallel 8

Relevant log output

/home/hr/openvino/src/plugins/intel_npu/tools/protopipe/src/simulation/simulation.cpp: In function ‘cv::gapi::GNetPackage getNetPackage(const string&, const ONNXRTParams&)’:
/home/hr/openvino/src/plugins/intel_npu/tools/protopipe/src/simulation/simulation.cpp:81:13: error: ‘class cv::gapi::onnx::Params<cv::gapi::Generic>’ has no member named ‘cfgSessionOptions’
   81 |     network.cfgSessionOptions(params.session_options);
      |             ^~~~~~~~~~~~~~~~~
/home/hr/openvino/src/plugins/intel_npu/tools/protopipe/src/simulation/simulation.cpp:83:17: error: ‘class cv::gapi::onnx::Params<cv::gapi::Generic>’ has no member named ‘cfgOptLevel’
   83 |         network.cfgOptLevel(params.opt_level.value());
      |                 ^~~~~~~~~~~
[ 70%] Building CXX object src/plugins/intel_gpu/src/kernel_selector/CMakeFiles/openvino_intel_gpu_kernels.dir/kernels/convolution/convolution_kernel_b_fs_zyx_fsv16.cpp.o
gmake[2]: *** [src/plugins/intel_npu/tools/protopipe/CMakeFiles/protopipe.dir/build.make:342:src/plugins/intel_npu/tools/protopipe/CMakeFiles/protopipe.dir/src/simulation/simulation.cpp.o] error 1
gmake[1]: *** [CMakeFiles/Makefile2:6168:src/plugins/intel_npu/tools/protopipe/CMakeFiles/protopipe.dir/all] error 2

Issue submission checklist

yury-gorbachev commented 2 weeks ago

@dmatveev - FYI

TolyaTalamanov commented 2 weeks ago

@Hooray0012 could you try to specify addition flag into your cmake command, please?

cmake -DENABLE_INTEL_NPU_PROTOPIPE=OFF ..

Also, it seems there is opencv in your environment, that's why protopipe tool was enabled, could you elaborate what opencv version you're using, please?

Hooray0012 commented 2 weeks ago

Thank you for the guide. I was able to bypass the issue by disabling the protopipe tool in the build process. Additionally, my current OpenCV version is 4.10.0.