From 071d615444655913bb4a39231ac8fe0036235f78 Mon Sep 17 00:00:00 2001 From: Septimiu Neaga Date: Wed, 6 Nov 2024 16:03:12 +0200 Subject: [PATCH 1/2] Updated build documentation --- .../intel_npu/tools/protopipe/README.md | 86 ++++++++----------- 1 file changed, 36 insertions(+), 50 deletions(-) diff --git a/src/plugins/intel_npu/tools/protopipe/README.md b/src/plugins/intel_npu/tools/protopipe/README.md index 00849ad8bddc9a..a25098b5134bf8 100644 --- a/src/plugins/intel_npu/tools/protopipe/README.md +++ b/src/plugins/intel_npu/tools/protopipe/README.md @@ -515,67 +515,53 @@ Iteration : ## How to build ### Prerequisites -1. Clone `npu-plugin` repository -2. Build OpenCV G-API with OpenVINO/ONNXRT support +1. Build OpenCV G-API with OpenVINO/ONNXRT support #### Build OpenCV G-API with OpenVINO/ONNXRT support -1. Clone OpenCV repo: +1. Clone and build [OpenVINO](https://github.com/openvinotoolkit/openvino) from sources + ``` + mkdir build && cd build + cmake ../ -DCMAKE_BUILD_TYPE=Release \ + -DENABLE_PLUGINS_XML=ON \ + -DCMAKE_INSTALL_PREFIX=install \ + -DENABLE_DEBUG_CAPS=ON \ + -DENABLE_NPU_DEBUG_CAPS=ON .. + + cmake --build . --config Release --target install --parallel + ``` +2. Init OpenVINO enviroment + ``` + source /setupvars.sh + ``` +3. Clone OpenCV repo: ``` git clone https://github.com/opencv/opencv - cd opencv && git checkout 78195bc3df + cd opencv && git checkout 3919f33e21 + ``` +4. Build OpenCV G-API: + ``` + mkdir -p build && cd build + cmake ../ -DBUILD_LIST=gapi \ + -DCMAKE_BUILD_TYPE=Release \ + -DWITH_OPENVINO=ON + cmake --build . --config Release --target opencv_gapi --parallel + ``` + If ONNX support is needed build OpenCV G-API with ONNX support: ``` -2. Build OpenCV G-API: - ``` mkdir -p build && cd build cmake ../ -DBUILD_LIST=gapi \ -DCMAKE_BUILD_TYPE=Release \ -DWITH_OPENVINO=ON \ - -DOpenVINO_DIR= \ -DWITH_ONNX=ON \ -DORT_INSTALL_DIR= cmake --build . --config Release --target opencv_gapi --parallel - ``` -### In-plugin build - -1. Clone and build [OpenVINO](https://github.com/openvinotoolkit/openvino) from sources -2. Build OpenCV G-API with OpenVINO / ONNXRT support -3. Clone `npu-plugin` repository - ``` - git clone https://github.com/openvinotoolkit/npu_plugin - git submodule update --init --recursive - ``` -4. Build `Protopipe` as part of the `npu-plugin` build: - ``` - mkdir build && cd build - cmake ../ -DOpenCV_DIR= -DOpenVINODeveloperPackage_DIR= - cmake --build . --config Release --target protopipe --parallel - ``` - -### Standalone build -1. Build `yaml-cpp` - ``` - mkdir -p yaml-cpp_build cd && yaml-cpp_build - cmake ..//thirdparty/yaml-cpp -DCMAKE_INSTALL_PREFIX=install - cmake --build . --config Release --target install --parallel - ``` -2. Build `gflags` - ``` - git clone https://github.com/gflags/gflags - cd gflags - mkdir -p gflags_build cd && gflags_build - cmake ../ -DCMAKE_INSTALL_PREFIX=install - cmake --build . --config Release --target install --parallel - ``` -3. Build `Protopipe` - ``` - mkdir -b protopipe_build && cd protopipe_build - cmake /tools/protopipe/ \ - -DOpenCV_DIR= \ - -Dgflags_DIR= \ - -DOpenVINO_DIR= \ - - cmake --build . --config Release --target protopipe --parallel - ``` + ``` +5. Build protopipe + ``` + cd + mkdir src/plugins/intel_npu/tools/protopipe/build && cd src/plugins/intel_npu/tools/protopipe/build + cmake ../ -DOpenCV_DIR=/home/sneaga/work/opencv/build -DCMAKE_BUILD_TYPE=Release + cmake --build . --target protopipe --parallel + ``` ### Verify the installation **Note**: Make sure `opencv_*` libraries are visible in the environment: - Windows: From c2e7a7560f56cffd10d57fe72a1782195d9d05b1 Mon Sep 17 00:00:00 2001 From: Septimiu Neaga Date: Tue, 12 Nov 2024 14:41:33 +0200 Subject: [PATCH 2/2] Added back Standalone build --- .../intel_npu/tools/protopipe/README.md | 27 ++++++++++++++++++- 1 file changed, 26 insertions(+), 1 deletion(-) diff --git a/src/plugins/intel_npu/tools/protopipe/README.md b/src/plugins/intel_npu/tools/protopipe/README.md index a25098b5134bf8..5ae258ecf6e9a9 100644 --- a/src/plugins/intel_npu/tools/protopipe/README.md +++ b/src/plugins/intel_npu/tools/protopipe/README.md @@ -559,9 +559,34 @@ Iteration : ``` cd mkdir src/plugins/intel_npu/tools/protopipe/build && cd src/plugins/intel_npu/tools/protopipe/build - cmake ../ -DOpenCV_DIR=/home/sneaga/work/opencv/build -DCMAKE_BUILD_TYPE=Release + cmake ../ -DOpenCV_DIR= -DCMAKE_BUILD_TYPE=Release cmake --build . --target protopipe --parallel ``` +### Standalone build +1. Build `yaml-cpp` + ``` + mkdir -p yaml-cpp_build && cd yaml-cpp_build + cmake /src/plugins/intel_npu/thirdparty/yaml-cpp -DCMAKE_INSTALL_PREFIX=install + cmake --build . --config Release --target install --parallel + ``` +2. Build `gflags` + ``` + git clone https://github.com/gflags/gflags + cd gflags + mkdir -p gflags_build && cd gflags_build + cmake ../ -DCMAKE_INSTALL_PREFIX=install + cmake --build . --config Release --target install --parallel + ``` +3. Build `Protopipe` + ``` + mkdir -p protopipe_build && cd protopipe_build + cmake /src/plugins/intel_npu/tools/protopipe \ + -DOpenCV_DIR= \ + -Dyaml_cpp_DIR= \ + -Dgflags_DIR= \ + + cmake --build . --config Release --target protopipe --parallel + ``` ### Verify the installation **Note**: Make sure `opencv_*` libraries are visible in the environment: - Windows: