Skip to content

Commit

Permalink
[NPU] Use run-time ze_loader for npu plugin (#27659)
Browse files Browse the repository at this point in the history
### Details:
 - *Not build or export ze_loader*
- *Create level-zero-headers to export ze headers that needed by extra
modules*

### Tickets:
 - *157614*

---------

Signed-off-by: Xin Wang <[email protected]>
  • Loading branch information
XinWangIntel authored Dec 4, 2024
1 parent 5cd59b8 commit 99d7cd4
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 18 deletions.
1 change: 0 additions & 1 deletion .github/workflows/linux_conditional_compilation.yml
Original file line number Diff line number Diff line change
Expand Up @@ -212,7 +212,6 @@ jobs:
tar -cvf - \
tests/ov_cpu_func_tests \
tests/libopenvino_template_extension.so \
tests/libze_loader.so* \
tests/libhwloc* \
tests/libtbb* \
tests/functional_test_utils/layer_tests_summary/* \
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/windows_conditional_compilation.yml
Original file line number Diff line number Diff line change
Expand Up @@ -237,7 +237,7 @@ jobs:
Compress-Archive @compress
$compress = @{
Path = "${{ env.OPENVINO_REPO }}/bin/intel64/${{ env.CMAKE_BUILD_TYPE }}/ov_cpu_func_tests.exe", "${{ env.BUILD_DIR }}/bin/${{ env.CMAKE_BUILD_TYPE }}/ze_loader.dll", "${{ env.OPENVINO_REPO }}/bin/intel64/${{ env.CMAKE_BUILD_TYPE }}/openvino_template_extension.dll", "${{ env.OPENVINO_REPO }}/src/tests/test_utils/functional_test_utils/layer_tests_summary", "${{ env.INSTALL_DIR }}/runtime/3rdparty/tbb"
Path = "${{ env.OPENVINO_REPO }}/bin/intel64/${{ env.CMAKE_BUILD_TYPE }}/ov_cpu_func_tests.exe", "${{ env.OPENVINO_REPO }}/bin/intel64/${{ env.CMAKE_BUILD_TYPE }}/openvino_template_extension.dll", "${{ env.OPENVINO_REPO }}/src/tests/test_utils/functional_test_utils/layer_tests_summary", "${{ env.INSTALL_DIR }}/runtime/3rdparty/tbb"
CompressionLevel = "Optimal"
DestinationPath = "${{ env.BUILD_DIR }}/openvino_tests.zip"
}
Expand Down
1 change: 0 additions & 1 deletion src/plugins/intel_npu/src/backend/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@ target_link_libraries(${TARGET_NAME}
PRIVATE
openvino::npu_al
openvino::npu_common
LevelZero::LevelZero
)

#
Expand Down
1 change: 0 additions & 1 deletion src/plugins/intel_npu/src/compiler_adapter/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@ target_link_libraries(${TARGET_NAME}
PRIVATE
openvino::npu_al
openvino::npu_common
LevelZero::LevelZero
)

#
Expand Down
21 changes: 7 additions & 14 deletions src/plugins/intel_npu/src/utils/src/zero/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,13 @@ ov_add_clang_format_target(${TARGET_NAME}_clang FOR_TARGETS ${TARGET_NAME})
add_library(openvino::npu_zero_utils ALIAS ${TARGET_NAME})
set_target_properties(${TARGET_NAME} PROPERTIES EXPORT_NAME npu_zero_utils)

add_library(level-zero-headers INTERFACE)
set_property(TARGET level-zero-headers APPEND PROPERTY INTERFACE_INCLUDE_DIRECTORIES $<BUILD_INTERFACE:${OpenVINO_SOURCE_DIR}/thirdparty/level_zero/level-zero/include>)
add_library(LevelZero::Headers ALIAS level-zero-headers)

target_include_directories(${TARGET_NAME}
PUBLIC
$<TARGET_PROPERTY:LevelZero::LevelZero,INTERFACE_INCLUDE_DIRECTORIES>
$<TARGET_PROPERTY:LevelZero::Headers,INTERFACE_INCLUDE_DIRECTORIES>
$<TARGET_PROPERTY:LevelZero::NPUExt,INTERFACE_INCLUDE_DIRECTORIES>
$<BUILD_INTERFACE:${NPU_UTILS_SOURCE_DIR}/include>)

Expand All @@ -35,16 +39,5 @@ ov_developer_package_export_targets(TARGET openvino::npu_zero_utils
ov_developer_package_export_targets(TARGET level-zero-ext)
ov_install_static_lib(level-zero-ext ${NPU_PLUGIN_COMPONENT})

if(TARGET ze_loader)
ov_developer_package_export_targets(TARGET ze_loader)
ov_install_static_lib(ze_loader ${NPU_PLUGIN_COMPONENT})

# TODO: remove once https://github.com/oneapi-src/level-zero/pull/243 is merged
ov_developer_package_export_targets(TARGET utils)
ov_install_static_lib(utils ${NPU_PLUGIN_COMPONENT})

# Support tests to run with ze_loader
install(TARGETS ze_loader
RUNTIME DESTINATION tests COMPONENT tests EXCLUDE_FROM_ALL
LIBRARY DESTINATION tests COMPONENT tests EXCLUDE_FROM_ALL)
endif()
ov_developer_package_export_targets(TARGET level-zero-headers)
ov_install_static_lib(level-zero-headers ${NPU_PLUGIN_COMPONENT})

0 comments on commit 99d7cd4

Please sign in to comment.