OpenVINO™ is an open source toolkit for optimizing and deploying AI inference
C++ aicomputer-visiondeep-learningdeploy-aidiffusion-modelsgenerative-aigood-first-issueinferencellm-inferencenatural-language-processingnlpopenvinooptimize-aiperformance-boostrecommendation-systemspeech-recognitionstable-diffusiontransformersyolo
Update install component and destination for plugin_compiler_lib (#33392)
Wenjing Kang60a697f6987d
diff --git a/src/plugins/intel_npu/cmake/download_compiler_libs.cmake b/src/plugins/intel_npu/cmake/download_compiler_libs.cmakeindex 87d90ca7dc9..89009aa84e9 100644--- a/src/plugins/intel_npu/cmake/download_compiler_libs.cmake+++ b/src/plugins/intel_npu/cmake/download_compiler_libs.cmake@@ -11,20 +11,12 @@# LINUX:# ubuntu22.04: npu_compiler_vcl_ubuntu_22_04-7_5_0-a1ae54e9.tar.gz# ubuntu24.04: npu_compiler_vcl_ubuntu_24_04-7_5_0-a1ae54e9.tar.gz-function(download_and_extract url zip_file extracted_dir modify_proxy)+function(download_and_extract url zip_file extracted_dir)# Check if the prebuilt Plugin compiler libraries not existif(NOT EXISTS "${extracted_dir}")# Download the prebuilt Plugin compiler libraries, if failure, show error message and exitif(NOT "${url}" STREQUAL "")- if(modify_proxy STREQUAL "MODIFY")- # Update proxy to enable download for windows url- set(original_NO_PROXY $ENV{NO_PROXY})- set(original_no_proxy $ENV{no_proxy})- set(ENV{NO_PROXY} "")- set(ENV{no_proxy} "")- endif()-message(STATUS "${url} is not empty")message(STATUS "Downloading prebuilt Plugin compiler libraries from ${url}")file(DOWNLOAD "${url}" "${zip_file}"@@ -33,12 +25,6 @@ function(download_and_extract url zip_file extracted_dir modify_proxy)STATUS download_statusSHOW_PROGRESS)- if(modify_proxy STREQUAL "MODIFY")- # Restore proxy- set(ENV{NO_PROXY} ${original_NO_PROXY})- set(ENV{no_proxy} ${original_no_proxy})- endif()-list(GET download_status 0 download_result)if(NOT download_result EQUAL 0)message(FATAL_ERROR "Download failed!\nStatus: ${download_status}\nLog: ${log_output}")@@ -111,13 +97,19 @@ if(ENABLE_INTEL_NPU_COMPILER)set(PLUGIN_COMPILER_VERSION_PATCH 0)set(PLUGIN_COMPILER_VERSION "${PLUGIN_COMPILER_VERSION_MAJOR}_${PLUGIN_COMPILER_VERSION_MINOR}_${PLUGIN_COMPILER_VERSION_PATCH}")message(STATUS "The prebuilt compiler version is ${PLUGIN_COMPILER_VERSION_MAJOR}.${PLUGIN_COMPILER_VERSION_MINOR}.${PLUGIN_COMPILER_VERSION_PATCH}")+ # The destinations are the same. CMAKE_BUILD_TYPE is added based on the option USE_BUILD_TYPE_SUBFOLDER+ if(USE_BUILD_TYPE_SUBFOLDER)+ set(NPU_COMPILER_LIB_DESTINATION ${CMAKE_LIBRARY_OUTPUT_DIRECTORY})+ else()+ set(NPU_COMPILER_LIB_DESTINATION "${CMAKE_LIBRARY_OUTPUT_DIRECTORY}/${CMAKE_BUILD_TYPE}")+ endif()if(WIN32)set(PLUGIN_COMPILER_LIBS_DIR "${CMAKE_CURRENT_SOURCE_DIR}/temp/plugin_compiler_lib/win")set(PLUGIN_COMPILER_LIBS_URL "https://storage.openvinotoolkit.org/dependencies/thirdparty/windows/npu_compiler_vcl_windows_2022-7_5_0-a1ae54e9.zip")set(PLUGIN_COMPILER_LIBS_ZIP "${PLUGIN_COMPILER_LIBS_DIR}/npu_compiler_vcl_windows_2022-${PLUGIN_COMPILER_VERSION}-a1ae54e9.zip")set(PLUGIN_COMPILER_LIBS_DIR_UNZIPPED "${PLUGIN_COMPILER_LIBS_DIR}/npu_compiler_vcl_windows_2022-${PLUGIN_COMPILER_VERSION}-a1ae54e9")- download_and_extract("${PLUGIN_COMPILER_LIBS_URL}" "${PLUGIN_COMPILER_LIBS_ZIP}" "${PLUGIN_COMPILER_LIBS_DIR_UNZIPPED}" "MODIFY")+ download_and_extract("${PLUGIN_COMPILER_LIBS_URL}" "${PLUGIN_COMPILER_LIBS_ZIP}" "${PLUGIN_COMPILER_LIBS_DIR_UNZIPPED}")set(PLUGIN_COMPILER_LIB_PATH "${PLUGIN_COMPILER_LIBS_DIR_UNZIPPED}/cid/lib")configure_file(@@ -127,8 +119,8 @@ if(ENABLE_INTEL_NPU_COMPILER))set(PLUGIN_COMPILER_LIB "${PLUGIN_COMPILER_LIB_PATH}/openvino_intel_npu_compiler.dll")file(COPY "${PLUGIN_COMPILER_LIB}"- DESTINATION "${CMAKE_LIBRARY_OUTPUT_DIRECTORY}/${CMAKE_BUILD_TYPE}")- message(STATUS "Copying prebuilt Plugin compiler libraries openvino_intel_npu_compiler.dll to ${CMAKE_LIBRARY_OUTPUT_DIRECTORY} for windows")+ DESTINATION "${NPU_COMPILER_LIB_DESTINATION}")+ message(STATUS "Copying prebuilt Plugin compiler libraries openvino_intel_npu_compiler.dll to ${NPU_COMPILER_LIB_DESTINATION} for windows")else()# Check if the operating system is Linux and not macOSif(UNIX AND NOT APPLE)@@ -144,7 +136,7 @@ if(ENABLE_INTEL_NPU_COMPILER)set(PLUGIN_COMPILER_LIBS_TAR "${PLUGIN_COMPILER_LIBS_DIR}/npu_compiler_vcl_ubuntu_22_04-${PLUGIN_COMPILER_VERSION}-a1ae54e9.tar.gz")set(PLUGIN_COMPILER_LIBS_DIR_EXTRACTED "${PLUGIN_COMPILER_LIBS_DIR}/npu_compiler_vcl_ubuntu_22_04-${PLUGIN_COMPILER_VERSION}-a1ae54e9")- download_and_extract("${PLUGIN_COMPILER_LIBS_URL}" "${PLUGIN_COMPILER_LIBS_TAR}" "${PLUGIN_COMPILER_LIBS_DIR_EXTRACTED}" "NONE")+ download_and_extract("${PLUGIN_COMPILER_LIBS_URL}" "${PLUGIN_COMPILER_LIBS_TAR}" "${PLUGIN_COMPILER_LIBS_DIR_EXTRACTED}")set(PLUGIN_COMPILER_LIB_PATH "${PLUGIN_COMPILER_LIBS_DIR_EXTRACTED}/cid/lib/")configure_file(@@ -153,8 +145,8 @@ if(ENABLE_INTEL_NPU_COMPILER)COPYONLY)set(PLUGIN_COMPILER_LIB "${PLUGIN_COMPILER_LIB_PATH}/libopenvino_intel_npu_compiler.so")- file(COPY "${PLUGIN_COMPILER_LIB}" DESTINATION "${CMAKE_LIBRARY_OUTPUT_DIRECTORY}")- message(STATUS "Copying prebuilt Plugin compiler libraries libopenvino_intel_npu_compiler.so to ${CMAKE_LIBRARY_OUTPUT_DIRECTORY} for Ubuntu 22.04")+ file(COPY "${PLUGIN_COMPILER_LIB}" DESTINATION "${NPU_COMPILER_LIB_DESTINATION}")+ message(STATUS "Copying prebuilt Plugin compiler libraries libopenvino_intel_npu_compiler.so to ${NPU_COMPILER_LIB_DESTINATION} for Ubuntu 22.04")elseif(OS_VERSION STREQUAL "24.04")message(STATUS "This is Ubuntu 24.04")set(PLUGIN_COMPILER_LIBS_DIR "${CMAKE_CURRENT_SOURCE_DIR}/temp/compiler_libs/ubuntu24.04")@@ -162,7 +154,7 @@ if(ENABLE_INTEL_NPU_COMPILER)set(PLUGIN_COMPILER_LIBS_TAR "${PLUGIN_COMPILER_LIBS_DIR}/npu_compiler_vcl_ubuntu_24_04-${PLUGIN_COMPILER_VERSION}-a1ae54e9.tar.gz")set(PLUGIN_COMPILER_LIBS_DIR_EXTRACTED "${PLUGIN_COMPILER_LIBS_DIR}/npu_compiler_vcl_ubuntu_24_04-${PLUGIN_COMPILER_VERSION}-a1ae54e9")- download_and_extract("${PLUGIN_COMPILER_LIBS_URL}" "${PLUGIN_COMPILER_LIBS_TAR}" "${PLUGIN_COMPILER_LIBS_DIR_EXTRACTED}" "NONE")+ download_and_extract("${PLUGIN_COMPILER_LIBS_URL}" "${PLUGIN_COMPILER_LIBS_TAR}" "${PLUGIN_COMPILER_LIBS_DIR_EXTRACTED}")set(PLUGIN_COMPILER_LIB_PATH "${PLUGIN_COMPILER_LIBS_DIR_EXTRACTED}/cid/lib/")configure_file(${PLUGIN_COMPILER_LIB_PATH}/libnpu_driver_compiler.so@@ -170,8 +162,8 @@ if(ENABLE_INTEL_NPU_COMPILER)COPYONLY)set(PLUGIN_COMPILER_LIB "${PLUGIN_COMPILER_LIB_PATH}/libopenvino_intel_npu_compiler.so")- file(COPY "${PLUGIN_COMPILER_LIB}" DESTINATION "${CMAKE_LIBRARY_OUTPUT_DIRECTORY}")- message(STATUS "Copying prebuilt Plugin compiler libraries libopenvino_intel_npu_compiler.so to ${CMAKE_LIBRARY_OUTPUT_DIRECTORY} for Ubuntu 24.04")+ file(COPY "${PLUGIN_COMPILER_LIB}" DESTINATION "${NPU_COMPILER_LIB_DESTINATION}")+ message(STATUS "Copying prebuilt Plugin compiler libraries libopenvino_intel_npu_compiler.so to ${NPU_COMPILER_LIB_DESTINATION} for Ubuntu 24.04")endif()else()message(STATUS "This is a different Linux distribution: ${OS_NAME}, skip downloading prebuilt Plugin compiler libraries. Can not use plugin compiler libraries!")@@ -181,5 +173,5 @@ if(ENABLE_INTEL_NPU_COMPILER)endif()install(FILES ${PLUGIN_COMPILER_LIB}- DESTINATION ${OV_CPACK_RUNTIMEDIR} COMPONENT ${NPU_INTERNAL_COMPONENT})+ DESTINATION ${OV_CPACK_PLUGINSDIR} COMPONENT ${NPU_PLUGIN_COMPONENT})endif()