public inbox for git-commits@fedoraproject.org
help / color / mirror / Atom feed
* [rpms/openvino] origin/pr/7/head: enable intel-npu-compiler
@ 2026-06-10 16:59 Ali Erdinc Koroglu
0 siblings, 0 replies; only message in thread
From: Ali Erdinc Koroglu @ 2026-06-10 16:59 UTC (permalink / raw)
To: git-commits
A new commit has been pushed.
Repo : rpms/openvino
Branch : origin/pr/7/head
Commit : 04123d9530f9b34f18434c31f0bbc1507e0caac3
Author : Ali Erdinc Koroglu <aekoroglu@linux.intel.com>
Date : 2025-08-17T17:04:38+03:00
Stats : +309/-31 in 7 file(s)
URL : https://src.fedoraproject.org/rpms/openvino/c/04123d9530f9b34f18434c31f0bbc1507e0caac3?branch=origin/pr/7/head
Log:
enable intel-npu-compiler
---
diff --git a/.gitignore b/.gitignore
index 5e0eb53..ccbcc46 100644
--- a/.gitignore
+++ b/.gitignore
@@ -2,3 +2,8 @@
/mlas-*.tar.gz
/onednn-*.tar.gz
/level-zero-npu-extensions-*.tar.gz
+/npu_compiler-*.tar.gz
+/npu_plugin_elf-*.tar.gz
+/npu-plugin-llvm-*.tar.gz
+/npu-nn-cost-model-*.tar.gz
+/flatbuffers-*.tar.gz
diff --git a/npu-compiler-disable-git.patch b/npu-compiler-disable-git.patch
new file mode 100644
index 0000000..8f7a57d
--- /dev/null
+++ b/npu-compiler-disable-git.patch
@@ -0,0 +1,22 @@
+--- a/cmake/flatbuffers.cmake 2025-04-10 09:12:29.077773814 +0300
++++ b/cmake/flatbuffers.cmake 2025-04-10 09:12:57.012364853 +0300
+@@ -64,7 +64,7 @@
+
+ endfunction()
+
+-find_package(Git REQUIRED)
++#find_package(Git REQUIRED)
+ function(vpux_gf_version_generate SRC_DIR DST_DIR)
+
+ execute_process(
+--- a/src/vpux_compiler/CMakeLists.txt 2025-04-08 21:10:11.545626446 +0300
++++ b/src/vpux_compiler/CMakeLists.txt 2025-04-08 21:10:52.600509266 +0300
+@@ -51,7 +51,7 @@
+ # Embed VPUNN models
+ #
+
+-find_package(Git REQUIRED)
++#find_package(Git REQUIRED)
+
+ execute_process(
+ COMMAND ${GIT_EXECUTABLE} lfs pull
diff --git a/npu-compiler-fix-install.patch b/npu-compiler-fix-install.patch
new file mode 100644
index 0000000..472393a
--- /dev/null
+++ b/npu-compiler-fix-install.patch
@@ -0,0 +1,47 @@
+--- a/src/vpux_driver_compiler/CMakeLists.txt
++++ b/src/vpux_driver_compiler/CMakeLists.txt
+@@ -16,7 +16,7 @@ include_directories(${CMAKE_CURRENT_SOURCE_DIR}/include)
+ add_subdirectory(src)
+ add_subdirectory(test)
+
+-install(
++#[[install(
+ FILES
+ "${InferenceEngineVPUXPlugin_SOURCE_DIR}/src/vpux_driver_compiler/CHANGES.txt"
+ DESTINATION cid
+@@ -26,4 +26,4 @@ install(
+ FILES
+ "${InferenceEngineVPUXPlugin_SOURCE_DIR}/src/vpux_driver_compiler/README.md"
+ DESTINATION cid
+- COMPONENT ${CID_COMPONENT})
++ COMPONENT ${CID_COMPONENT})]]
+--- a/src/vpux_driver_compiler/src/loader/CMakeLists.txt
++++ b/src/vpux_driver_compiler/src/loader/CMakeLists.txt
+@@ -75,7 +75,7 @@ ov_add_api_validator_post_build_step(TARGET ${TARGET_NAME})
+ # loader folder | -> include/ | -> vpux_headers/ -> 1 hpp
+ # | | -> vpux_loader/ -> 1 hpp
+
+-install(DIRECTORY "${LOADER_DIR_INC}/vpux_headers"
++#[[install(DIRECTORY "${LOADER_DIR_INC}/vpux_headers"
+ DESTINATION cid/vpux_elf/loader/include/
+ COMPONENT ${CID_COMPONENT})
+
+@@ -207,4 +207,4 @@ install(TARGETS npu_elf
+ CONFIGURATIONS RelWithDebInfo
+ LIBRARY DESTINATION cid/vpux_elf/lib/RelWithDebInfo COMPONENT ${CID_COMPONENT}
+ ARCHIVE DESTINATION cid/vpux_elf/lib/RelWithDebInfo COMPONENT ${CID_COMPONENT}
+- RUNTIME DESTINATION cid/vpux_elf/lib/RelWithDebInfo COMPONENT ${CID_COMPONENT})
++ RUNTIME DESTINATION cid/vpux_elf/lib/RelWithDebInfo COMPONENT ${CID_COMPONENT})]]
+--- a/src/vpux_compiler/CMakeLists.txt 2025-05-05 19:36:13.333749375 +0300
++++ b/src/vpux_compiler/CMakeLists.txt 2025-05-05 19:37:04.718216709 +0300
+@@ -241,8 +241,8 @@
+
+ # Note not included in OpenVINOTargets export!
+
+-if(BUILD_SHARED_LIBS)
++#[[if(BUILD_SHARED_LIBS)
+ install(TARGETS ${TARGET_NAME}
+ ARCHIVE DESTINATION ${OV_CPACK_ARCHIVEDIR} COMPONENT ${VPUX_INTERNAL_COMPONENT}
+ LIBRARY DESTINATION ${OV_CPACK_RUNTIMEDIR} COMPONENT ${VPUX_INTERNAL_COMPONENT})
+-endif()
++endif()]]
diff --git a/npu-compiler-thirdparty-CMakeLists.txt b/npu-compiler-thirdparty-CMakeLists.txt
new file mode 100644
index 0000000..ac751b7
--- /dev/null
+++ b/npu-compiler-thirdparty-CMakeLists.txt
@@ -0,0 +1,85 @@
+#
+# Copyright (C) 2022 Intel Corporation.
+# SPDX-License-Identifier: Apache 2.0
+#
+
+set(BUILD_SHARED_LIBS OFF)
+
+#
+# LLVM/MLIR
+#
+if(NOT ENABLE_PREBUILT_LLVM_MLIR_LIBS)
+ set_llvm_flags()
+ add_subdirectory(llvm-project/llvm EXCLUDE_FROM_ALL)
+ set(MLIR_SOURCE_DIR "${CMAKE_CURRENT_SOURCE_DIR}/llvm-project/mlir/include")
+ set(MLIR_BINARY_DIR "${CMAKE_CURRENT_BINARY_DIR}/llvm-project/llvm/tools/mlir/include")
+ include_directories(SYSTEM ${MLIR_SOURCE_DIR} ${MLIR_BINARY_DIR})
+endif()
+
+#
+# flatbuffers
+#
+
+if(CMAKE_SOURCE_DIR STREQUAL OpenVINO_SOURCE_DIR AND
+ ENABLE_OV_TF_LITE_FRONTEND AND (NOT ENABLE_SYSTEM_FLATBUFFERS OR NOT Flatbuffers_FOUND))
+ # we are building NPU plugin via -DOPENVINO_EXTRA_MODULES
+ # and flatbuffers is already built as part of OpenVINO in case of
+ # building in a single tree
+else()
+ set(FLATBUFFERS_BUILD_TESTS OFF CACHE BOOL "" FORCE)
+ set(FLATBUFFERS_INSTALL OFF CACHE BOOL "" FORCE)
+ set(FLATBUFFERS_BUILD_FLATC ON CACHE BOOL "" FORCE)
+
+ add_subdirectory(flatbuffers EXCLUDE_FROM_ALL)
+
+ # FIXME: this flag is forced while building in a single tree with OV
+ # but code cannot be compiled with the flag
+ if(NOT MSVC)
+ target_compile_options(flatbuffers PRIVATE -Wno-suggest-override)
+ target_compile_options(flatc PRIVATE -Wno-suggest-override)
+ if ((CMAKE_CXX_COMPILER_ID STREQUAL "Clang") AND (CMAKE_CXX_COMPILER_VERSION VERSION_GREATER_EQUAL 13))
+ target_compile_options(flatbuffers PRIVATE -Wno-unused-but-set-variable)
+ target_compile_options(flatc PRIVATE -Wno-unused-but-set-variable)
+ endif()
+ endif()
+
+ vpux_add_native_tool(flatc "${CMAKE_CURRENT_SOURCE_DIR}/flatbuffers"
+ CMAKE_ARGS
+ "FLATBUFFERS_BUILD_TESTS:BOOL=OFF"
+ "FLATBUFFERS_INSTALL:BOOL=OFF"
+ "FLATBUFFERS_BUILD_FLATC:BOOL=ON"
+ )
+endif()
+
+#
+# npu_elf
+#
+
+if (ENABLE_NPU_MONO)
+ if (NOT TARGET npu_elf)
+ message(FATAL_ERROR "elf/vpux_elf target must exist since ENABLE_NPU_MONO is ON")
+ endif()
+ # TODO remove:
+ # `src/vpux_compiler/include/vpux/compiler/dialect/NPUReg37XX/api`
+ # `src/vpux_compiler/include/vpux/compiler/NPU40XX/dialect/NPUReg40XX/api`
+ # after integration finishes
+else()
+ # Legacy no-monorepo scenario
+ add_subdirectory(elf/vpux_elf EXCLUDE_FROM_ALL)
+ target_include_directories(npu_elf PRIVATE
+ "${IE_MAIN_VPUX_PLUGIN_SOURCE_DIR}/src/vpux_compiler/include/vpux/compiler/NPU37XX/dialect/NPUReg37XX/firmware_headers/details"
+ "${IE_MAIN_VPUX_PLUGIN_SOURCE_DIR}/src/vpux_compiler/include/vpux/compiler/NPU40XX/dialect/NPUReg40XX/firmware_headers/details")
+
+ target_include_directories(vpux_elf PRIVATE
+ "${IE_MAIN_VPUX_PLUGIN_SOURCE_DIR}/src/vpux_compiler/include/vpux/compiler/NPU37XX/dialect/NPUReg37XX/firmware_headers/details"
+ "${IE_MAIN_VPUX_PLUGIN_SOURCE_DIR}/src/vpux_compiler/include/vpux/compiler/NPU40XX/dialect/NPUReg40XX/firmware_headers/details")
+endif()
+
+#
+# nn cost model
+#
+
+set(VPUNN_BUILD_SHARED_LIB OFF CACHE BOOL "" FORCE)
+set(VPUNN_BUILD_EXAMPLES OFF CACHE BOOL "" FORCE)
+set(VPUNN_BUILD_TESTS OFF CACHE BOOL "" FORCE)
+add_subdirectory(vpucostmodel EXCLUDE_FROM_ALL)
diff --git a/npu-compiler-vpux-driver-compiler.patch b/npu-compiler-vpux-driver-compiler.patch
new file mode 100644
index 0000000..6781d08
--- /dev/null
+++ b/npu-compiler-vpux-driver-compiler.patch
@@ -0,0 +1,27 @@
+--- a/src/vpux_driver_compiler/src/vpux_compiler_l0/CMakeLists.txt 2025-04-14 23:36:56.812899341 -0700
++++ b/src/vpux_driver_compiler/src/vpux_compiler_l0/CMakeLists.txt 2025-04-16 09:58:44.751662645 -0700
+@@ -80,12 +85,12 @@
+ COMPONENT ${CID_COMPONENT})
+ else()
+ install(TARGETS ${TARGET_NAME}
+- LIBRARY DESTINATION cid/lib
++ LIBRARY DESTINATION lib64
+ COMPONENT ${CID_COMPONENT})
+ endif()
+
+ install(
+ FILES
+ "${InferenceEngineVPUXPlugin_SOURCE_DIR}/src/vpux_driver_compiler/include/npu_driver_compiler.h"
+- DESTINATION cid
++ DESTINATION include
+ COMPONENT ${CID_COMPONENT})
+--- a/src/vpux_driver_compiler/CMakeLists.txt 2025-04-14 21:03:09.221779635 -0700
++++ b/src/vpux_driver_compiler/CMakeLists.txt 2025-04-14 23:36:46.771479407 -0700
+@@ -12,6 +12,7 @@
+ ov_cpack_add_component(${CID_COMPONENT})
+
+ include_directories(${CMAKE_CURRENT_SOURCE_DIR}/include)
++include_directories(${CMAKE_CURRENT_SOURCE_DIR}/../vpux_compiler/include)
+
+ add_subdirectory(src)
+ add_subdirectory(test)
diff --git a/openvino.spec b/openvino.spec
index df20931..314c31c 100644
--- a/openvino.spec
+++ b/openvino.spec
@@ -1,4 +1,4 @@
-%define so_ver 2510
+%global so_ver 2510
%global desc %{expand: \
OpenVINO is an open-source toolkit for optimizing and deploying deep learning
models from cloud to edge. It accelerates deep learning inference across
@@ -40,38 +40,54 @@ Summary: Toolkit for optimizing and deploying AI inference
License: Apache-2.0 AND MIT AND BSL-1.0 AND HPND AND BSD-3-Clause AND (GPL-2.0-only OR BSD-3-Clause)
URL: https://github.com/openvinotoolkit/openvino
Source0: %url/archive/%{version}/%{name}-%{version}.tar.gz
-Source1: https://github.com/openvinotoolkit/oneDNN/archive/5baba714e16e11309774a62783f363cad30e97c7/onednn-5baba71.tar.gz
-Source2: https://github.com/openvinotoolkit/mlas/archive/d1bc25ec4660cddd87804fcf03b2411b5dfb2e94/mlas-d1bc25e.tar.gz
-Source3: https://github.com/intel/level-zero-npu-extensions/archive/c0156a3390ae39671ff8f2a6f5471f04bb65bb12/level-zero-npu-extensions-c0156a3.tar.gz
-Source4: dependencies.cmake
-Source5: pyproject.toml
+Source1: dependencies.cmake
+Source2: pyproject.toml
+Source3: https://github.com/openvinotoolkit/oneDNN/archive/5baba714e16e11309774a62783f363cad30e97c7/onednn-5baba71.tar.gz
+Source4: https://github.com/openvinotoolkit/mlas/archive/d1bc25ec4660cddd87804fcf03b2411b5dfb2e94/mlas-d1bc25e.tar.gz
+Source5: https://github.com/intel/level-zero-npu-extensions/archive/c0156a3390ae39671ff8f2a6f5471f04bb65bb12/level-zero-npu-extensions-c0156a3.tar.gz
+Source6: https://github.com/openvinotoolkit/npu_compiler/archive/npu_ud_2025_12_rc2/npu_compiler-npu_ud_2025_12_rc2.tar.gz
+Source7: npu-compiler-thirdparty-CMakeLists.txt
+Source8: https://github.com/openvinotoolkit/npu_plugin_elf/archive/ce501d3059c81fd6bd0ad7165ab823838fa5d851/npu_plugin_elf-ce501d3.tar.gz
+Source9: https://github.com/intel/npu-nn-cost-model/archive/a965531d3d3a37748cc5ab7feac342b35baaf7b4/npu-nn-cost-model-a965531.tar.gz
+Source10: https://github.com/intel/npu-plugin-llvm/arhcive/0d1145010d6d2ba48a945c824ed0ca03254b94ed/npu-plugin-llvm-0d11450.tar.gz
+Source11: https://github.com/google/flatbuffers/archive/6df40a2471737b27271bdd9b900ab5f3aec746c7/flatbuffers-6df40a2.tar.gz
Patch0: openvino-fedora.patch
Patch1: npu-level-zero.patch
+Patch2: npu-compiler-disable-git.patch
+Patch3: npu-compiler-fix-install.patch
+Patch4: npu-compiler-vpux-driver-compiler.patch
ExclusiveArch: x86_64
BuildRequires: cmake
+%if 0%{?fedora} >= 42 || 0%{?rhel} > 10
+BuildRequires: gcc14
+BuildRequires: gcc14-c++
+%else
BuildRequires: gcc
BuildRequires: gcc-c++
-BuildRequires: flatbuffers-compiler
-BuildRequires: flatbuffers-devel
+%endif
BuildRequires: gflags-devel
BuildRequires: glibc-devel
+BuildRequires: flatbuffers-compiler
+BuildRequires: flatbuffers-devel
BuildRequires: json-devel
+BuildRequires: libedit-devel
+BuildRequires: libffi-devel
+BuildRequires: libxml2-devel
BuildRequires: oneapi-level-zero-devel
-BuildRequires: openblas-devel
BuildRequires: patchelf
BuildRequires: pugixml-devel
BuildRequires: pybind11-devel
BuildRequires: python3-devel
BuildRequires: python3-onnx
BuildRequires: python3-pip
+BuildRequires: python3-numpy
BuildRequires: python3-setuptools
BuildRequires: python3-pytest
BuildRequires: python3-wheel
BuildRequires: snappy-devel
-BuildRequires: numpy
BuildRequires: zlib-ng-compat-devel
BuildRequires: xbyak-devel
BuildRequires: yaml-cpp-devel
@@ -81,19 +97,12 @@ BuildRequires: protobuf-devel
BuildRequires: opencv-devel
BuildRequires: OpenCL-ICD-Loader-devel
BuildRequires: opencl-headers
-# forked version of OpenVINO oneDNN does not have a proper version
-Provides: bundled(onednn)
-# MLAS upstream does not have any release
-Provides: bundled(mlas)
-# level-zero-npu-extensions upstream does not have any release
-Provides: bundled(level-zero-npu-extensions)
Requires: lib%{name}-ir-frontend = %{version}
Requires: lib%{name}-pytorch-frontend = %{version}
Requires: lib%{name}-onnx-frontend = %{version}
Requires: lib%{name}-paddle-frontend = %{version}
Requires: lib%{name}-tensorflow-frontend = %{version}
Requires: lib%{name}-tensorflow-lite-frontend = %{version}
-Requires: numpy
Recommends: %{name}-plugins = %{version}
%description
@@ -109,7 +118,14 @@ applications that use %{name}.
%package plugins
Summary: OpenVINO Plugins
+# forked version of OpenVINO oneDNN does not have a proper version
+Provides: bundled(onednn)
+# Intel MLAS
+Provides: bundled(mlas)
+# Intel level-zero-npu-extensions
+Provides: bundled(level-zero-npu-extensions)
Requires: %{name}%{?_isa} = %{version}-%{release}
+Requires: python3-opencv
%description plugins
The OpenVINO plugins package provides support for various hardware devices.
@@ -127,6 +143,7 @@ into memory.
%package -n lib%{name}-pytorch-frontend
Summary: OpenVINO PyTorch Frontend
Requires: %{name}%{?_isa} = %{version}-%{release}
+Requires: python3-torch
%description -n lib%{name}-pytorch-frontend
The PyTorch Frontend is a C++ based OpenVINO Frontend component that is
@@ -169,9 +186,31 @@ a TensorFlow model to an ov::Model object that further can be serialized into
the Intermediate Representation (IR) format with lower latency and smaller
binary size on mobile and edge devices.
+%package -n intel-npu-compiler
+Summary: OpenVINO NPU Compiler
+# Intel npu-compiler
+Provides: bundled(npu_compiler)
+# intel VPUNN cost model
+Provides: bundled(npu-nn-cost-model)
+# Intel npu-plugin-elf
+Provides: bundled(npu_plugin_elf)
+# Intel npu-plugin-llvm
+Provides: bundled(npu-plugin-llvm)
+# Flatbuffer for npu_compiler
+Provides: bundled(flatbuffers)
+Requires: %{name}%{?_isa} = %{version}-%{release}
+Requires: intel-npu-driver
+
+%description -n intel-npu-compiler
+Intel NPU device is an AI inference accelerator integrated with Intel client
+CPUs, starting from Intel Core Ultra generation of CPUs (formerly known as
+Meteor Lake). It enables energy-efficient execution of artificial neural
+network tasks.}
+
%package -n python3-%{name}
Summary: OpenVINO Python API
Requires: %{name}%{?_isa} = %{version}-%{release}
+Requires: python3-numpy
%description -n python3-%{name}
OpenVINO Python API allowing users to use the OpenVINO library in their Python
@@ -179,34 +218,33 @@ code. Python API provides bindings to basic and advanced APIs from OpenVINO
runtime.
%prep
-# autosetup without patching, since we need to patch one of the bundled libraries
%autosetup -N
+%patch -P 0 -p1
# Remove the thirdparty deps
rm -rf thirdparty/*
-cp %{SOURCE4} thirdparty/
+cp %{SOURCE1} thirdparty/
+
+# python:prep
+sed -i '/openvino-telemetry/d' src/bindings/python/requirements.txt
+sed -i 's/numpy>=1.16.6,<2.3.0/numpy>=1.16.6/' src/bindings/python/requirements.txt
+cp %{SOURCE2} src/bindings/python
# Intel-cpu-plugin thirdparty deps
-tar xf %{SOURCE1}
+tar xf %{SOURCE3}
cp -r oneDNN-*/* src/plugins/intel_cpu/thirdparty/onednn
-# autopatch will apply all the patches, now that we have unpacked enough of the bundled libraries
-%autopatch -p1
-tar xf %{SOURCE2}
+tar xf %{SOURCE4}
cp -r mlas-*/* src/plugins/intel_cpu/thirdparty/mlas
# Intel-npu-plugin thirdparty deps
rm -rf src/plugins/intel_npu/thirdparty/yaml-cpp
-tar xf %{SOURCE3}
+tar xf %{SOURCE5}
cp -r level-*/* src/plugins/intel_npu/thirdparty/level-zero-ext
+%patch -P 1 -p1
# intel-gpu-plugin cache.json
sed -i -e 's|CACHE_JSON_INSTALL_DIR ${OV_CPACK_PLUGINSDIR}|CACHE_JSON_INSTALL_DIR %{_datadir}/%{name}|g' src/plugins/intel_gpu/src/kernel_selector/CMakeLists.txt
-# python:prep
-sed -i '/openvino-telemetry/d' src/bindings/python/requirements.txt
-sed -i 's/numpy>=1.16.6,<2.3.0/numpy>=1.16.6/' src/bindings/python/requirements.txt
-cp %{SOURCE5} src/bindings/python
-
# gcc 15 include cstdint
sed -i '/#include <vector>.*/a#include <cstdint>' src/core/include/openvino/core/type/bfloat16.hpp
sed -i '/#include <vector>.*/a#include <cstdint>' src/core/include/openvino/core/type/float16.hpp
@@ -223,11 +261,43 @@ sed -i '/#include <memory>.*/a#include <cstdint>' src/plugins/intel_cpu/src/util
sed -i '/#include <vector>.*/a#include <cstdint>' src/plugins/intel_npu/tools/protopipe/src/graph.hpp
sed -i '/#include <memory>.*/a#include <cstdint>' src/plugins/intel_npu/tools/protopipe/src/scenario/criterion.hpp
+# Intel-npu-compiler
+tar xf %{SOURCE6} -C thirdparty
+rm -rf thirdparty/npu_compiler-npu_ud_2025_12_rc2/thirdparty/*
+cp %{SOURCE7} thirdparty/npu_compiler-npu_ud_2025_12_rc2/thirdparty/CMakeLists.txt
+%patch -d thirdparty/npu_compiler-npu_ud_2025_12_rc2 -P 2 -p1
+%patch -d thirdparty/npu_compiler-npu_ud_2025_12_rc2 -P 3 -p1
+%patch -d thirdparty/npu_compiler-npu_ud_2025_12_rc2 -P 4 -p1
+# ov::pass::KeepConstPrecision fix
+sed -i -e 's|ov::pass::KeepConstsPrecision|ov::pass::KeepConstPrecision|g' thirdparty/npu_compiler-npu_ud_2025_12_rc2/src/vpux_compiler/src/frontend/IE.cpp
+# disable test
+sed -i '/^add_subdirectory(test)/s/^/#/' thirdparty/npu_compiler-npu_ud_2025_12_rc2/src/vpux_driver_compiler/CMakeLists.txt
+
+# Intel-npu-compiler thirdparty deps
+tar xf %{SOURCE8}
+mv npu_plugin_elf-* thirdparty/npu_compiler-npu_ud_2025_12_rc2/thirdparty/elf
+tar xf %{SOURCE9}
+mv npu-nn-cost-model-* thirdparty/npu_compiler-npu_ud_2025_12_rc2/thirdparty/vpucostmodel
+tar xf %{SOURCE10}
+mv npu-plugin-llvm-* thirdparty/npu_compiler-npu_ud_2025_12_rc2/thirdparty/llvm-project
+# disable atomic builtins
+sed -i '/^include(CheckAtomic)/s/^/#/' thirdparty/npu_compiler-npu_ud_2025_12_rc2/thirdparty/llvm-project/llvm/cmake/config-ix.cmake
+# extract flatbuffers
+tar xf %{SOURCE11}
+mv flatbuffers-* thirdparty/npu_compiler-npu_ud_2025_12_rc2/thirdparty/flatbuffers
+
%build
+export NPU_PLUGIN_HOME="$PWD/thirdparty/npu_compiler-npu_ud_2025_12_rc2"
+export CFLAGS="${CFLAGS/-Werror=format-security/} -Wno-error=stringop-overflow -Wno-error=maybe-uninitialized -Wno-error=dangling-reference -Wno-error=template-id-cdtor"
+export CXXFLAGS="${CXXFLAGS/-Werror=format-security/} -Wno-error=stringop-overflow -Wno-error=maybe-uninitialized -Wno-error=dangling-reference -Wno-error=template-id-cdtor"
+
%cmake \
-DCMAKE_BUILD_TYPE=RelWithDebInfo \
-DCMAKE_POLICY_VERSION_MINIMUM="3.5.0" \
- -DCMAKE_CXX_FLAGS="%{optflags} -Wformat -Wformat-security" \
+%if 0%{?fedora} >= 42 || 0%{?rhel} > 10
+ -DCMAKE_C_COMPILER=gcc-14 \
+ -DCMAKE_CXX_COMPILER=g++-14 \
+%endif
-DCMAKE_COMPILE_WARNING_AS_ERROR=OFF \
-DENABLE_CLANG_FORMAT=OFF \
-DENABLE_PRECOMPILED_HEADERS=OFF \
@@ -260,6 +330,9 @@ sed -i '/#include <memory>.*/a#include <cstdint>' src/plugins/intel_npu/tools/pr
-DENABLE_SYSTEM_LEVEL_ZERO=ON \
-DENABLE_INTEL_NPU=ON \
-DENABLE_NPU_PLUGIN_ENGINE=ON \
+ -DENABLE_ZEROAPI_BACKEND=ON \
+ -DENABLE_INTEL_NPU_INTERNAL=ON \
+ -DENABLE_INTEL_NPU_PROTOPIPE=ON \
-DENABLE_ONEDNN_FOR_GPU=OFF \
-DENABLE_MULTI=ON \
-DENABLE_PROXY=ON \
@@ -278,7 +351,6 @@ sed -i '/#include <memory>.*/a#include <cstdint>' src/plugins/intel_npu/tools/pr
-DENABLE_SYSTEM_LIBS_DEFAULT=ON \
-DENABLE_SYSTEM_OPENCL=ON \
-DENABLE_SYSTEM_PUGIXML=ON \
- -DENABLE_SYSTEM_FLATBUFFERS=ON \
-DENABLE_SYSTEM_SNAPPY=ON \
-DENABLE_SYSTEM_PROTOBUF=ON \
-DProtobuf_LIBRARIES=%{_libdir} \
@@ -293,6 +365,17 @@ sed -i '/#include <memory>.*/a#include <cstdint>' src/plugins/intel_npu/tools/pr
-DENABLE_TESTS=OFF \
-DBUILD_SHARED_LIBS=ON \
-DBLAS_LIBRARIES=%{_libdir} \
+ -DOPENVINO_EXTRA_MODULES=$NPU_PLUGIN_HOME \
+ -DDENABLE_PRIVATE_TESTS=OFF \
+ -DENABLE_NPU_LSP_SERVER=OFF \
+ -DENABLE_PREBUILT_LLVM_MLIR_LIBS=OFF \
+ -DDENABLE_DEVELOPER_BUILD=OFF \
+ -DENABLE_MLIR_COMPILER=ON \
+ -DBUILD_COMPILER_FOR_DRIVER=ON \
+ -DENABLE_DRIVER_COMPILER_ADAPTER=OFF \
+ -DENABLE_SOURCE_PACKAGE=OFF \
+ -DLibEdit_LIBRARIES=%{_libdir}/libedit.so \
+ -DLibEdit_INCLUDE_DIRS=%{_includedir}/histedit.h \
%cmake_build
%install
@@ -320,6 +403,7 @@ LD_LIBRARY_PATH=$LD_LIBRARY_PATH:%{buildroot}%{_libdir} PYTHONPATH=%{buildroot}%
%files devel
%{_includedir}/%{name}
+%{_includedir}/npu_driver_compiler.h
%{_libdir}/lib%{name}.so
%{_libdir}/lib%{name}_c.so
%{_libdir}/lib%{name}_pytorch_frontend.so
@@ -367,6 +451,9 @@ LD_LIBRARY_PATH=$LD_LIBRARY_PATH:%{buildroot}%{_libdir} PYTHONPATH=%{buildroot}%
%{_libdir}/lib%{name}_tensorflow_lite_frontend.so.%{version}
%{_libdir}/lib%{name}_tensorflow_lite_frontend.so.%{so_ver}
+%files -n intel-npu-compiler
+%{_libdir}/libnpu_driver_compiler.so
+
%files -n python3-%{name}
%{python3_sitearch}/%{name}
%{python3_sitearch}/%{name}-%{version}.dist-info
diff --git a/sources b/sources
index 4d1b416..a4e1a3c 100644
--- a/sources
+++ b/sources
@@ -2,3 +2,8 @@ SHA512 (openvino-2025.1.0.tar.gz) = ae3432e9caf5df1ec292a029c3708a294447070fa02e
SHA512 (onednn-5baba71.tar.gz) = 72f1a11623f8cabb2605eb734b891f36b16876ac7c940947807c4d574c7e6031dd064de5ebc7d2042c02989c1f38b55499d8c16d70a52d35dfbe74047d0ea3ce
SHA512 (mlas-d1bc25e.tar.gz) = 8d6dd319924135b7b22940d623305bf200b812ae64cde79000709de4fad429fbd43794301ef16e6f10ed7132777b7a73e9f30ecae7c030aea80d57d7c0ce4500
SHA512 (level-zero-npu-extensions-c0156a3.tar.gz) = 33ebdaec13dd05d6cf51e79f0e91a3c68621c428061423e243eb998c9ebe123ee90f6b4edc749d7fa2206c729058afff945177e8c90a05d36220f076e067c22c
+SHA512 (npu_compiler-npu_ud_2025_12_rc2.tar.gz) = ab8999ecc63b7a17a52b7e07008b8e0396a97d58130908de039cca628c57a3bacc76ef9aac5e1060702b641130fe5340d44eed9c7deeb254a3ce52eb0151e4df
+SHA512 (npu_plugin_elf-ce501d3.tar.gz) = acb168762c0660deaeb7214a4dc931317725005ec5533173fb96b3addc80f9a8ff5894e2349897f9d99a22c8852c9e93f2faf08ebda3f07d1f8a25a73c3c41f6
+SHA512 (npu-plugin-llvm-0d11450.tar.gz) = 538fdf3a1832391bf83dbe8bd20caa26b22246a4a298d908abed5dbb3d7b113ae761836ed5e4ffcf9eeca6758c1b4fc9d7e9602fd2f1fb57b855be804079df2c
+SHA512 (npu-nn-cost-model-a965531.tar.gz) = 86c01715de65686fd4761fa0f96e6c83fda94d46bae4b61361e926e5445f27bebf974eae36cbdd0c65fdc92ab903dc58ea9b116e35ccca24ba9b425fbcefc0c2
+SHA512 (flatbuffers-6df40a2.tar.gz) = 895f56fa4730b8505b553f62f8293929f26982f147be6d44fab73064862d3a20a498b4fc18bab979a2421909e501d70d987eccc5e0924e98be676add508da95a
^ permalink raw reply related [flat|nested] only message in thread
only message in thread, other threads:[~2026-06-10 16:59 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-06-10 16:59 [rpms/openvino] origin/pr/7/head: enable intel-npu-compiler Ali Erdinc Koroglu
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox