Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
28 commits
Select commit Hold shift + click to select a range
7de1d64
Add VCLApi and VCLCompilerImpl
XinWangIntel May 26, 2025
3aad6d8
Use vclAllocateExecutionCreate3 to get metadata
XinWangIntel Jul 20, 2025
cc62686
update vcl version check, default compilertype and vcl download link
DanLiu2Intel Sep 28, 2025
8b11ee8
fix export issue and build
DanLiu2Intel Nov 6, 2025
a08feb7
clang-format, add platform update and compiler check
DanLiu2Intel Nov 12, 2025
cbb8de0
remove ENABLE_VCL_FOR_COMPILER and update tile, default compilertype
DanLiu2Intel Nov 13, 2025
047aab1
set device desc empty and auto parse in compile
DanLiu2Intel Nov 13, 2025
baedc2b
update vcl compiler to openvino_intel_npu_compiler
DanLiu2Intel Nov 17, 2025
0338cfe
Merge branch 'master' into serialize-on-plugin-adapter
DanLiu2Intel Nov 17, 2025
8f3f570
fix ie mdk issue for compilerType Inconsistency issues for 3720
DanLiu2Intel Nov 17, 2025
7f16b6e
fix clang-format
DanLiu2Intel Nov 17, 2025
addf8a6
add test component (download openvino_intel_npu_compiler, with the de…
DanLiu2Intel Nov 17, 2025
a523966
fix unit test
DanLiu2Intel Nov 17, 2025
b886bfe
fix SERIALIZATION_WEIGHTS_SIZE_THRESHOLD undeclared identifiers
DanLiu2Intel Nov 18, 2025
deafd69
check option.hpp
DanLiu2Intel Nov 18, 2025
c6e46c5
test
DanLiu2Intel Nov 18, 2025
d4f700e
Merge branch 'master' into serialize-on-plugin-adapter_test-default-MLIR
DanLiu2Intel Nov 18, 2025
c1e4b68
remove USE_BASE_MODEL_SERIALIZER option
DanLiu2Intel Nov 18, 2025
f5a6fd0
remove useless code
DanLiu2Intel Nov 18, 2025
b543711
upodate func name
DanLiu2Intel Nov 18, 2025
de22106
add compilertype to driver
DanLiu2Intel Nov 18, 2025
22c3aa6
fix 3720 platfrom compilerType issue
DanLiu2Intel Nov 18, 2025
ca74e0d
fix device name for device and config are same issue
DanLiu2Intel Nov 18, 2025
27867aa
format and fix platform with auto_dectet
DanLiu2Intel Nov 18, 2025
0b22071
WS iterative working
razvanapetroaie Nov 17, 2025
caab82d
Merge branch 'master' into serialize-on-plugin-adapter_test-default-M…
DanLiu2Intel Nov 19, 2025
d24849a
Starting the one shot implementation & adjusting the code a bit
razvanapetroaie Nov 18, 2025
ab0af02
remove test part
DanLiu2Intel Nov 20, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions src/plugins/intel_npu/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,10 @@ include(cmake/features.cmake)

set(CMAKE_CXX_STANDARD 17)

if(ENABLE_VCL_FOR_COMPILER)
include(cmake/download_compiler_libs.cmake)
endif()

if(ENABLE_NPU_DEBUG_CAPS)
add_compile_definitions(NPU_PLUGIN_DEVELOPER_BUILD)
endif()
Expand Down
179 changes: 179 additions & 0 deletions src/plugins/intel_npu/cmake/download_compiler_libs.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,179 @@
# Copyright (C) 2018-2025 Intel Corporation
# SPDX-License-Identifier: Apache-2.0
#

# Function to download and extract files
function(download_and_extract url zip_file extracted_dir modify_proxy)
# Check if the prebuilt VCL compiler libraries not exist
if(NOT EXISTS "${extracted_dir}")
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()

# Download the prebuilt VCL compiler libraries, if failure, show error message and exit
message(STATUS "Downloading prebuilt VCL compiler libraries from ${url}")
file(DOWNLOAD "${url}" "${zip_file}"
TIMEOUT 3600
LOG log_output
STATUS download_status
SHOW_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}")
else()
message(STATUS "Download completed: ${zip_file}")
endif()

message(STATUS "Unzipping prebuilt VCL compiler libraries to ${extracted_dir}")
# Determine extraction method based on file extension
if("${zip_file}" MATCHES "\\.zip$")
file(ARCHIVE_EXTRACT INPUT "${zip_file}" DESTINATION "${extracted_dir}")
elseif("${zip_file}" MATCHES "\\.tar.gz$")
if(NOT EXISTS "${extracted_dir}")
file(MAKE_DIRECTORY "${extracted_dir}")
message(STATUS "Directory ${extracted_dir} created to unzip.")
endif()
execute_process(COMMAND tar -xzf "${zip_file}" -C "${extracted_dir}")
elseif("${zip_file}" MATCHES "\\.deb$")
execute_process(COMMAND dpkg-deb -x "${zip_file}" "${extracted_dir}")
elseif("${zip_file}" MATCHES "\\.exe$")
set(WINRAR_PATHS
"C:/Program Files/WinRAR"
"C:/Program Files (x86)/WinRAR"
)

set(WINRAR_FOUND FALSE)
set(WINRAR_EXECUTABLE "")

foreach(PATH ${WINRAR_PATHS})
if(EXISTS "${PATH}/WinRAR.exe")
set(WINRAR_FOUND TRUE)
set(WINRAR_EXECUTABLE "${PATH}/WinRAR.exe")
break()
endif()
endforeach()

if(WINRAR_FOUND)
message(STATUS "WinRAR found at: ${WINRAR_EXECUTABLE} and extract ${zip_file} to ${extracted_dir}")
file(MAKE_DIRECTORY "${extracted_dir}")
execute_process(
COMMAND "${WINRAR_EXECUTABLE}" x -y -o+ "${zip_file}" "${extracted_dir}"
RESULT_VARIABLE result
OUTPUT_VARIABLE output
ERROR_VARIABLE error
)

if(result EQUAL 0)
message(STATUS "Extraction successful: ${output}")
else()
#file(REMOVE_RECURSE "${extracted_dir}")
message(STATUS "Extraction failed: ${error}")
endif()
else()
message(FATAL_ERROR "WinRAR not found. Please install WinRAR to proceed.")
endif()
else()
message(FATAL_ERROR "Unsupported file extension for extraction: ${zip_file}")
endif()
file(REMOVE "${zip_file}")
else()
message(STATUS "Prebuilt VCL compiler libraries already exist, skip download")
endif()
endfunction()

if(ENABLE_VCL_FOR_COMPILER)
if(ENABLE_SYSTEM_NPU_VCL_COMPILER)
message(STATUS "Using system NPU VCL compiler libraries, skip download")
else()
message(STATUS "Downloading prebuilt NPU VCL compiler libraries")
if(WIN32)
set(VCL_COMPILER_LIBS_DIR "${CMAKE_CURRENT_SOURCE_DIR}/temp/vcl_compiler_lib/win")
set(VCL_COMPILER_LIBS_URL "https://github.com/openvinotoolkit/npu_compiler/releases/download/npu_ud_2025_38_rc4/w_vpux_compiler_l0_win-7_4_3-Release_dyntbb_postcommit_cid_a826bd92b5e02af092e4d706a762252b1845f777_251010_2218.zip")
set(VCL_COMPILER_LIBS_ZIP "${VCL_COMPILER_LIBS_DIR}/w_vpux_compiler_l0_win-7_4_3-Release_dyntbb_postcommit_cid_a826bd92b5e02af092e4d706a762252b1845f777_251010_2218.zip")
set(VCL_COMPILER_LIBS_DIR_UNZIPPED "${VCL_COMPILER_LIBS_DIR}/cid_a826bd92b5e02af092e4d706a762252b1845f777_251010_2218")

download_and_extract("${VCL_COMPILER_LIBS_URL}" "${VCL_COMPILER_LIBS_ZIP}" "${VCL_COMPILER_LIBS_DIR_UNZIPPED}" "MODIFY")
set(VCL_COMPILER_LIB_PATH "${VCL_COMPILER_LIBS_DIR_UNZIPPED}/cid/lib")

configure_file(
${VCL_COMPILER_LIB_PATH}/npu_driver_compiler.dll
${VCL_COMPILER_LIB_PATH}/openvino_intel_npu_compiler.dll
COPYONLY
)
set(VCL_COMPILER_LIB "${VCL_COMPILER_LIB_PATH}/openvino_intel_npu_compiler.dll")
file(COPY "${VCL_COMPILER_LIB}"
DESTINATION "${CMAKE_LIBRARY_OUTPUT_DIRECTORY}/${CMAKE_BUILD_TYPE}")
message(STATUS "Not Copying prebuilt VCL compiler libraries openvino_intel_npu_compiler.dll to ${CMAKE_LIBRARY_OUTPUT_DIRECTORY} for windows")
else()
# Check if the operating system is Linux and not macOS
if(UNIX AND NOT APPLE)
# Get the OS name and version
execute_process(COMMAND lsb_release -is OUTPUT_VARIABLE OS_NAME OUTPUT_STRIP_TRAILING_WHITESPACE)
execute_process(COMMAND lsb_release -rs OUTPUT_VARIABLE OS_VERSION OUTPUT_STRIP_TRAILING_WHITESPACE)

if(OS_NAME STREQUAL "Ubuntu")
if(OS_VERSION STREQUAL "22.04")
# Ubuntu 22.04-specific settings or actions
set(VCL_COMPILER_LIBS_DIR "${CMAKE_CURRENT_SOURCE_DIR}/temp/vcl_compiler_libs/ubuntu22.04")
set(VCL_COMPILER_LIBS_URL "https://github.com/intel/linux-npu-driver/releases/download/v1.19.0/intel-driver-compiler-npu_1.19.0.20250707-16111289554_ubuntu22.04_amd64.deb")
set(VCL_COMPILER_LIBS_DEB "${VCL_COMPILER_LIBS_DIR}/intel-driver-compiler-npu_1.19.0.20250707-16111289554_ubuntu22.04_amd64.deb")
set(VCL_COMPILER_LIBS_DIR_EXTRACTED "${VCL_COMPILER_LIBS_DIR}/prebuilt_VCL_libs_from_1.19.0.20250707-16111289554_ubuntu22.04")

download_and_extract("${VCL_COMPILER_LIBS_URL}" "${VCL_COMPILER_LIBS_DEB}" "${VCL_COMPILER_LIBS_DIR_EXTRACTED}" "NONE")

set(VCL_COMPILER_LIB_PATH "${VCL_COMPILER_LIBS_DIR_EXTRACTED}/usr/lib/x86_64-linux-gnu")
configure_file(
${VCL_COMPILER_LIB_PATH}/libnpu_driver_compiler.so
${VCL_COMPILER_LIB_PATH}/libopenvino_intel_npu_compiler.so
COPYONLY
)
set(VCL_COMPILER_LIB "${VCL_COMPILER_LIB_PATH}/libopenvino_intel_npu_compiler.so")
file(COPY "${VCL_COMPILER_LIB}"
DESTINATION "${CMAKE_LIBRARY_OUTPUT_DIRECTORY}")
message(STATUS "Not Copying prebuilt VCL compiler libraries libopenvino_intel_npu_compiler.so to ${CMAKE_LIBRARY_OUTPUT_DIRECTORY} for Ubuntu 22.04")
elseif(OS_VERSION STREQUAL "24.04")
message(STATUS "This is Ubuntu 24.04")
# Ubuntu 24.04-specific settings or actions
set(VCL_COMPILER_LIBS_DIR "${CMAKE_CURRENT_SOURCE_DIR}/temp/vcl_compiler_libs/ubuntu24.04")
set(VCL_COMPILER_LIBS_URL "https://github.com/intel/linux-npu-driver/releases/download/v1.19.0/intel-driver-compiler-npu_1.19.0.20250707-16111289554_ubuntu24.04_amd64.deb")
set(VCL_COMPILER_LIBS_DEB "${VCL_COMPILER_LIBS_DIR}/intel-driver-compiler-npu_1.19.0.20250707-16111289554_ubuntu24.04_amd64.deb")
set(VCL_COMPILER_LIBS_DIR_EXTRACTED "${VCL_COMPILER_LIBS_DIR}/prebuilt_VCL_libs_from_1.19.0.20250707-16111289554_ubuntu24.04")

download_and_extract("${VCL_COMPILER_LIBS_URL}" "${VCL_COMPILER_LIBS_DEB}" "${VCL_COMPILER_LIBS_DIR_EXTRACTED}" "NONE")

set(VCL_COMPILER_LIB_PATH "${VCL_COMPILER_LIBS_DIR_EXTRACTED}/usr/lib/x86_64-linux-gnu")
configure_file(
${VCL_COMPILER_LIB_PATH}/libnpu_driver_compiler.so
${VCL_COMPILER_LIB_PATH}/libopenvino_intel_npu_compiler.so
COPYONLY
)
set(VCL_COMPILER_LIB "${VCL_COMPILER_LIB_PATH}/libopenvino_intel_npu_compiler.so")
# file(COPY "${VCL_COMPILER_LIB}"
# DESTINATION "${CMAKE_LIBRARY_OUTPUT_DIRECTORY}")
message(STATUS "Copying prebuilt VCL compiler libraries libopenvino_intel_npu_compiler.so to ${CMAKE_LIBRARY_OUTPUT_DIRECTORY} for Ubuntu 24.04")
else()
message(STATUS "This is another version of Ubuntu: ${OS_VERSION}")
# Other Ubuntu-specific settings or actions
endif()
else()
message(STATUS "This is a different Linux distribution: ${OS_NAME}, skip downloading prebuilt VCL compiler libraries")
# Other Linux-specific settings or actions
endif()
endif()
endif()
endif()

install(FILES ${VCL_COMPILER_LIB}
DESTINATION ${OV_CPACK_RUNTIMEDIR} COMPONENT ${NPU_INTERNAL_COMPONENT})
endif()
3 changes: 3 additions & 0 deletions src/plugins/intel_npu/cmake/features.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -11,3 +11,6 @@ if(NOT ENABLE_NPU_PLUGIN_ENGINE AND ENABLE_TESTS)
endif()

ov_dependent_option(ENABLE_INTEL_NPU_PROTOPIPE "Enable Intel NPU Protopipe tool" ON "ENABLE_INTEL_NPU_INTERNAL" OFF)

ov_option(ENABLE_VCL_FOR_COMPILER "Enable VCL for NPU compiler" ON)
ov_option(ENABLE_SYSTEM_NPU_VCL_COMPILER "Use system VCL compiler libraries" OFF)
Original file line number Diff line number Diff line change
Expand Up @@ -842,7 +842,7 @@ struct COMPILER_TYPE final : OptionBase<COMPILER_TYPE, ov::intel_npu::CompilerTy
}

static ov::intel_npu::CompilerType defaultValue() {
return ov::intel_npu::CompilerType::DRIVER;
return ov::intel_npu::CompilerType::MLIR;
}

static ov::intel_npu::CompilerType parse(std::string_view val) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,13 +21,14 @@ class CompilerAdapterFactory final {
if (engineBackend == nullptr || engineBackend->getName() != "LEVEL0") {
return std::make_unique<PluginCompilerAdapter>(nullptr);
}
std::cout << "===== Creating PluginCompilerAdapter with ZeroInitStructsHolder" << std::endl;
return std::make_unique<PluginCompilerAdapter>(engineBackend->getInitStructs());
}
case ov::intel_npu::CompilerType::DRIVER: {
if (engineBackend == nullptr || engineBackend->getName() != "LEVEL0") {
OPENVINO_THROW("NPU Compiler Adapter must be used with LEVEL0 backend");
}

std::cout << "===== Creating DriverCompilerAdapter with ZeroInitStructsHolder" << std::endl;
return std::make_unique<DriverCompilerAdapter>(engineBackend->getInitStructs());
}
default:
Expand Down
Loading
Loading