Skip to content

openvino-inference-engine: add Intel NPU Plugin support#47

Open
liux2085 wants to merge 1 commit intointel:mainfrom
liux2085:main
Open

openvino-inference-engine: add Intel NPU Plugin support#47
liux2085 wants to merge 1 commit intointel:mainfrom
liux2085:main

Conversation

@liux2085
Copy link

@liux2085 liux2085 commented Feb 5, 2026

  1. Added submodules for NPU Plugin: level-zero, level-zero-npu-extensions
    and yaml-cpp.

  2. Removed the hardcoded -DENABLE_INTEL_NPU=OFF. Add a new
    PACKAGECONFIG option intel-npu to toggle NPU plugin support.

  3. Included a patch file ("0001-Fix-intel-NPU-plugin-build-issue-with-GCC15.patch")
    to address GCC15 build errors by explicitly including "" where necessary.

  4. Fix debug source paths in generated NPU dispatcher sources.

The Intel NPU plugin file will be installed to
"/usr/lib64/openvino-2025.3.0/libopenvino_intel_npu_plugin.so".

1) Added submodules for NPU Plugin: level-zero, level-zero-npu-extensions
   and yaml-cpp.

2) Removed the hardcoded -DENABLE_INTEL_NPU=OFF. Add a new
   PACKAGECONFIG option intel-npu to toggle NPU plugin support.

3) Included a patch file ("0001-Fix-intel-NPU-plugin-build-issue-with-GCC15.patch")
   to address GCC15 build errors by explicitly including "<cstdint>" where necessary.

4) Fix debug source paths in generated NPU dispatcher sources.

The Intel NPU plugin file will be installed to
"/usr/lib64/openvino-2025.3.0/libopenvino_intel_npu_plugin.so".

Signed-off-by: Yongxin Liu <yongxin.liu@windriver.com>
@yktyagi yktyagi requested a review from Copilot February 5, 2026 10:52
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR adds Intel NPU (Neural Processing Unit) plugin support to the OpenVINO inference engine recipe by introducing required dependencies and configuration options.

Changes:

  • Added three new git submodule dependencies for NPU plugin: level-zero, level-zero-npu-extensions, and yaml-cpp
  • Introduced a new intel-npu PACKAGECONFIG option to enable/disable NPU plugin support
  • Included a GCC15 compatibility patch that adds missing <cstdint> includes to NPU plugin source files

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.

File Description
recipes-core/opencv/openvino-inference-engine_2025.3.0.bb Adds NPU submodule dependencies, removes hardcoded NPU disable flag, adds intel-npu PACKAGECONFIG option, and implements debug source path fix for NPU dispatcher sources
recipes-core/opencv/files/0001-Fix-intel-NPU-plugin-build-issue-with-GCC15.patch Fixes GCC15 build errors by adding <cstdint> includes to NPU plugin header files

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

chmod +x ${WORKDIR}/qemuwrapper
}

NPU_INSTALL_CMD = "find ${B}/src/plugins/intel_npu/src/plugin/cross-compiled/ -type f -name \"*_disp.cpp\" -exec sed -i -e \"s%${S}%${TARGET_DBGSRC_DIR}%g\" {} + || bberror \"Failed to update dispatcher source paths\""
Copy link

Copilot AI Feb 5, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The NPU_INSTALL_CMD contains a complex shell command with multiple special characters and escaping. Consider extracting this into a separate shell function or script file for better readability and maintainability.

Copilot uses AI. Check for mistakes.
Copy link
Contributor

@kkepka kkepka left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi @liux2085,
thank you for this contribution, much appreciated.

Comment on lines +45 to +53
SRC_URI += "git://github.com/oneapi-src/level-zero.git;protocol=https;destsuffix=${BB_GIT_DEFAULT_DESTSUFFIX}/thirdparty/level_zero/level-zero;name=level-zero;nobranch=1 \
git://github.com/intel/level-zero-npu-extensions.git;protocol=https;destsuffix=${BB_GIT_DEFAULT_DESTSUFFIX}/src/plugins/intel_npu/thirdparty/level-zero-ext;name=level-zero-ext;nobranch=1 \
git://github.com/jbeder/yaml-cpp.git;protocol=https;destsuffix=${BB_GIT_DEFAULT_DESTSUFFIX}/src/plugins/intel_npu/thirdparty/yaml-cpp;name=yaml-cpp;nobranch=1 \
file://0001-Fix-intel-NPU-plugin-build-issue-with-GCC15.patch \
"
SRCREV_level-zero = "9402907a3ce6987871325e4e1329e053b8e5cf2b"
SRCREV_level-zero-ext = "f8bba8915e0a5fe8317f7aa48007ecc5a8c179ca"
SRCREV_yaml-cpp = "da82fd982c260e7f335ce5acbceff24b270544d1"
SRCREV_FORMAT += "_level-zero_level-zero-ext_yaml-cpp"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you please consider using system libraries before cloning them into a recipe?

Copy link
Author

@liux2085 liux2085 Feb 7, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi @kkepka,

Thanks for your review.

  1. Regarding level-zero
    The level-zero package is currently provided by meta-intel, while meta-openvino does not declare a dependency on meta-intel.
    Do you want me to add meta-intel to LAYERDEPENDS of meta-openvino, or is there a preferred alternative?

  2. Regarding yaml-cpp
    Please refer to the following code snippet:

<src/plugins/intel_npu/thirdparty/CMakeLists.txt>

if(ENABLE_INTEL_NPU_PROTOPIPE)
    set(YAML_BUILD_SHARED_LIBS OFF)
    add_subdirectory(yaml-cpp EXCLUDE_FROM_ALL)
    # NB: Suppress warnings in yaml-cpp
    if(SUGGEST_OVERRIDE_SUPPORTED)
        target_compile_options(yaml-cpp PRIVATE -Wno-suggest-override)
    endif()
endif()

OpenVINO does not use a system-provided yaml-cpp for the Intel NPU plugin.
Instead, it vendors yaml-cpp as a third-party component and builds it directly from source as part of the OpenVINO build.

Key points:

set(YAML_BUILD_SHARED_LIBS OFF) forces static library generation (libyaml-cpp.a).

add_subdirectory(yaml-cpp EXCLUDE_FROM_ALL) builds yaml-cpp only when the NPU protopipe is enabled, and it is not exposed as a general project dependency.

The resulting libyaml-cpp.a is linked statically into the NPU plugin, avoiding any runtime dependency on a system yaml-cpp package.

Because of this, no yaml-cpp recipe or runtime dependency is required in the Yocto image.

This design is intentional to keep the NPU plugin self-contained and to avoid ABI or version mismatches with system-provided yaml-cpp.

Please let me know if this aligns with your understanding or if you prefer a different integration approach.

Thanks,
Yongxin

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi Yongxin,
thank you for detailed response. Please give me some time to cross check with Openvino and NPU engineers to find out what would be best way across the stack.
Best regards, KK

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yaml-cpp is in meta-oe ref: https://layers.openembedded.org/layerindex/recipe/163426/
Perhaps you can depend on the meta-oe layer ?

Having multiple sources is an issue for maintinence and CVE handling.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants