From fe0879078b7d73dde03e4cfd7ffeb2b83720931d Mon Sep 17 00:00:00 2001 From: Ilya Lavrenov Date: Tue, 13 Aug 2024 13:58:08 +0400 Subject: [PATCH 01/11] Remove installation of cnpy, zlib as part of samples (#26037) ### Details: - They were used only by speech sample which was removed before 2024.0 --- thirdparty/dependencies.cmake | 16 ---------------- 1 file changed, 16 deletions(-) diff --git a/thirdparty/dependencies.cmake b/thirdparty/dependencies.cmake index 24c4940fedc3f5..5fa49b2cda9c23 100644 --- a/thirdparty/dependencies.cmake +++ b/thirdparty/dependencies.cmake @@ -539,17 +539,6 @@ install(DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/thirdparty/gflags PATTERN src/gflags_completions.sh EXCLUDE PATTERN WORKSPACE EXCLUDE) -file(GLOB zlib_sources ${CMAKE_CURRENT_SOURCE_DIR}/thirdparty/zlib/zlib/*.c - ${CMAKE_CURRENT_SOURCE_DIR}/thirdparty/zlib/zlib/*.h) -install(FILES ${zlib_sources} - DESTINATION ${OV_CPACK_SAMPLESDIR}/cpp/thirdparty/zlib/zlib - COMPONENT ${OV_CPACK_COMP_CPP_SAMPLES} - ${OV_CPACK_COMP_CPP_SAMPLES_EXCLUDE_ALL}) -install(FILES ${CMAKE_CURRENT_SOURCE_DIR}/thirdparty/zlib/CMakeLists.txt - DESTINATION ${OV_CPACK_SAMPLESDIR}/cpp/thirdparty/zlib - COMPONENT ${OV_CPACK_COMP_CPP_SAMPLES} - ${OV_CPACK_COMP_CPP_SAMPLES_EXCLUDE_ALL}) - install(DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/thirdparty/json/nlohmann_json DESTINATION ${OV_CPACK_SAMPLESDIR}/cpp/thirdparty COMPONENT ${OV_CPACK_COMP_CPP_SAMPLES} @@ -571,11 +560,6 @@ install(DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/thirdparty/json/nlohmann_json PATTERN tools EXCLUDE PATTERN wsjcpp.yml EXCLUDE) -install(DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/thirdparty/cnpy - DESTINATION ${OV_CPACK_SAMPLESDIR}/cpp/thirdparty - COMPONENT ${OV_CPACK_COMP_CPP_SAMPLES} - ${OV_CPACK_COMP_CPP_SAMPLES_EXCLUDE_ALL}) - # restore state set(CMAKE_CXX_FLAGS "${_old_CMAKE_CXX_FLAGS}") From 93c481ffb83a75535c8c1789f5ef7d5d15de30a3 Mon Sep 17 00:00:00 2001 From: Mikhail Ryzhov Date: Mon, 29 Jul 2024 10:58:18 +0200 Subject: [PATCH 02/11] [PyPI] include tbb headers to wheel (#25398) ### Details: - Extend dev package by including tbb cmake configuration and headers ### Tickets: - *135444* --- src/bindings/python/wheel/setup.py | 24 +++++++++++++++++++----- 1 file changed, 19 insertions(+), 5 deletions(-) diff --git a/src/bindings/python/wheel/setup.py b/src/bindings/python/wheel/setup.py index 610c4e744e32e3..85483b555d9bbc 100644 --- a/src/bindings/python/wheel/setup.py +++ b/src/bindings/python/wheel/setup.py @@ -193,6 +193,13 @@ "install_dir": "runtime", "binary_dir": OPENVINO_BINARY_DIR, "source_dir": OPENVINO_SOURCE_DIR + }, + "tbb_dev": { + "name": "tbb_dev", + "prefix": f"{BUILD_BASE}/libs.tbb.dev", + "install_dir": "runtime/3rdparty/tbb", + "binary_dir": OPENVINO_BINARY_DIR, + "source_dir": OPENVINO_SOURCE_DIR } } @@ -469,6 +476,8 @@ def copy_package_data(self, src_dirs): os.makedirs(package_dir, exist_ok=True) package_clibs_dir = os.path.join(PACKAGE_DIR, WHEEL_LIBS_INSTALL_DIR) os.makedirs(package_clibs_dir, exist_ok=True) + package_cmake_dir = os.path.join(package_dir, "cmake") + os.makedirs(package_cmake_dir, exist_ok=True) replacements = { # change the path where the libraries are installed (runtime/lib/intel64/Release -> openvino/libs) @@ -490,15 +499,20 @@ def copy_package_data(self, src_dirs): move(file_path, dst_file) self.announce(f"Move {file_path} to {dst_file}", level=3) + # collect all cmake files in one directory + for file_path in Path(src).rglob("*.cmake"): + file_name = os.path.basename(file_path) + if file_path.is_file(): + dst_file = os.path.join(package_cmake_dir, file_name) + self.announce(f"Move {file_path} to {dst_file}", level=3) + move(file_path, dst_file) + self.announce("Patch cmake configurations", level=3) + replace_strings_in_file(dst_file, replacements) + if os.path.isdir(src) and os.listdir(src): # copy the rest of the files to the package directly shutil.copytree(src, dst, dirs_exist_ok=True) - # patch cmake configurations - for file_path in Path(dst).rglob("*.cmake"): - if file_path.is_file(): - replace_strings_in_file(file_path, replacements) - def copy_file(src, dst, verbose=False, dry_run=False): """Custom file copy.""" From 89146d6bf816b4b9c383bfd9b569bc71fea56152 Mon Sep 17 00:00:00 2001 From: Ilya Lavrenov Date: Tue, 13 Aug 2024 10:06:58 +0400 Subject: [PATCH 03/11] Fixed TBB usage inside openvino wheel (#26029) ### Details: - Current patterns don't work for TBB properly --- src/bindings/python/wheel/setup.py | 64 ++++++++++++++++++++---------- 1 file changed, 42 insertions(+), 22 deletions(-) diff --git a/src/bindings/python/wheel/setup.py b/src/bindings/python/wheel/setup.py index 85483b555d9bbc..d595d49106990a 100644 --- a/src/bindings/python/wheel/setup.py +++ b/src/bindings/python/wheel/setup.py @@ -440,27 +440,22 @@ def copy_package_libs(self, src_dirs): package_clibs_dir = os.path.join(PACKAGE_DIR, WHEEL_LIBS_INSTALL_DIR) os.makedirs(package_clibs_dir, exist_ok=True) - for src_dir in src_dirs: - # additional blacklist filter, just to fix cmake install issues - blacklist_patterns = [ # static libraries and PBD files - "^.*\\.a$", "^.*\\.pdb$", - # TBB debug libraries - "^.*_debug\\.dll$", "^.*_debug\\.\\d*\\.dylib$", "^.*_debug\\.so\\.\\d*$", - # hwloc static libs on Windows - "^.*\\.la$"] + # additional blacklist filter, just to fix cmake install issues + blacklist_patterns = [ # static libraries and PBD files + "^.*\\.a$", "^.*\\.pdb$", + # TBB debug libraries + "^.*_debug\\.dll$", "^.*_debug\\.\\d*\\.dylib$", "^.*_debug\\.so\\.\\d*$", + # hwloc static libs on Windows + "^.*\\.la$"] + for src_dir in src_dirs: # copy so / dylib files to WHEEL_LIBS_INSTALL_DIR (clibs) inside python package for file_path in Path(src_dir).rglob("*"): file_name = os.path.basename(file_path) if file_path.is_symlink(): # sanity check for self.resolve_symlinks sys.exit(f"Wheel package content must not contain symlinks {file_path}") - blacklisted = False - for pattern in blacklist_patterns: - if re.match(pattern, file_name) is not None: - blacklisted = True - break - if file_path.is_file() and not blacklisted: + if file_path.is_file() and not is_blacklisted(file_name, blacklist_patterns): dst_file = os.path.join(package_clibs_dir, file_name) copyfile(file_path, dst_file) self.announce(f"Copy {file_path} to {dst_file}", level=3) @@ -479,22 +474,39 @@ def copy_package_data(self, src_dirs): package_cmake_dir = os.path.join(package_dir, "cmake") os.makedirs(package_cmake_dir, exist_ok=True) - replacements = { + openvino_replacements = { # change the path where the libraries are installed (runtime/lib/intel64/Release -> openvino/libs) - r"({_IMPORT_PREFIX})\/(.*)\/(.*.[lib|dylib|so|dll])": rf"\1/{WHEEL_LIBS_INSTALL_DIR}/\3", + r"(\{_IMPORT_PREFIX\})\/(.*)\/(.+\.[lib|dylib|so|dll])": rf"\1/{WHEEL_LIBS_INSTALL_DIR}/\3", # change the path where the include files are installed (runtime/include -> openvino/include) - r"({_IMPORT_PREFIX})\/(.*)\/(include)": rf"\1/{WHEEL_PACKAGE_DIR}/\3", - # change the libs versions (so.2024.3.0 -> so.2430 or 2024.3.0.dylib -> 2430.dylib) - r"(.so)?.(\d\d)(\d\d).(\d+).(\d+)(.dylib)?": r"\1.\3\4\5\6", + r"(\{_IMPORT_PREFIX\})\/(.*)\/(include)": rf"\1/{WHEEL_PACKAGE_DIR}/\3", + # change the OpenVINO libs versions (so.2024.3.0 -> so.2430 or 2024.3.0.dylib -> 2430.dylib) + r"\.(\d\d)(\d\d)\.(\d+)\.(\d+)\.dylib": r".\2\3\4.dylib", + r"\.so\.(\d\d)(\d\d)\.(\d+)\.(\d+)": r".so.\2\3\4", + } + + tbb_replacements = { + # change the path where the TBBConfig.cmake is installed (/lib/cmake/TBB -> openvino/cmake) + r"(\{CMAKE_CURRENT_LIST_FILE\})": r"\1/fake_dir", + # change the path where the libraries are installed (/lib -> openvino/libs) + r"(\{_IMPORT_PREFIX\})\/(.*)\/(.+\.[lib|dylib|so|dll])": rf"\1/{WHEEL_LIBS_INSTALL_DIR}/\3", + # change the path where the include files are installed (/include -> openvino/include) + r"(\{_IMPORT_PREFIX\})\/(.*)(include)": rf"\1/{WHEEL_PACKAGE_DIR}/\3", + # change the TBB libs versions (.12.13.dylib -> .12.dylib) + r"\.(\d+)\.(\d+)\.dylib": r".\1.dylib", + r"\.so\.(\d+)\.(\d+)": r".so.\1", } + # additional blacklist filter, just to fix cmake install issues + blacklist_patterns = [ # TBB cmake files describing debug libraries + "^.*TBBTargets-debug\\.cmake$"] + for src_dir in src_dirs: src, dst = Path(src_dir), Path(package_dir) # move the static libs to the directory with the shared libraries for file_path in Path(src).rglob("*.lib"): file_name = os.path.basename(file_path) - if file_path.is_file(): + if file_path.is_file() and not is_blacklisted(file_name, blacklist_patterns): dst_file = os.path.join(package_clibs_dir, file_name) move(file_path, dst_file) self.announce(f"Move {file_path} to {dst_file}", level=3) @@ -502,18 +514,26 @@ def copy_package_data(self, src_dirs): # collect all cmake files in one directory for file_path in Path(src).rglob("*.cmake"): file_name = os.path.basename(file_path) - if file_path.is_file(): + if file_path.is_file() and not is_blacklisted(file_name, blacklist_patterns): dst_file = os.path.join(package_cmake_dir, file_name) self.announce(f"Move {file_path} to {dst_file}", level=3) move(file_path, dst_file) self.announce("Patch cmake configurations", level=3) - replace_strings_in_file(dst_file, replacements) + replace_strings_in_file(dst_file, + openvino_replacements if file_name.startswith("OpenVINO") else tbb_replacements) if os.path.isdir(src) and os.listdir(src): # copy the rest of the files to the package directly shutil.copytree(src, dst, dirs_exist_ok=True) +def is_blacklisted(file_name, blacklist_patterns): + for pattern in blacklist_patterns: + if re.match(pattern, file_name) is not None: + return True + return False + + def copy_file(src, dst, verbose=False, dry_run=False): """Custom file copy.""" if dry_run: From b8100dbd266d015b53547a1fa52bbaf1d8f5c9e9 Mon Sep 17 00:00:00 2001 From: Ilya Lavrenov Date: Fri, 9 Aug 2024 23:11:22 +0400 Subject: [PATCH 04/11] Unset OV_OPTIONS on each cmake run (#26001) ### Details: - Otherwise, options are duplicated with new cmake reruns --- cmake/developer_package/options.cmake | 2 ++ 1 file changed, 2 insertions(+) diff --git a/cmake/developer_package/options.cmake b/cmake/developer_package/options.cmake index 3ad42f156c706c..2844708340e427 100644 --- a/cmake/developer_package/options.cmake +++ b/cmake/developer_package/options.cmake @@ -8,6 +8,8 @@ if(POLICY CMP0127) cmake_policy(SET CMP0127 NEW) endif() +unset(OV_OPTIONS CACHE) + macro(ov_option variable description value) option(${variable} "${description}" ${value}) list(APPEND OV_OPTIONS ${variable}) From 548f04dc853ee7d241e4693c85a1e8d558dab53d Mon Sep 17 00:00:00 2001 From: Ilya Lavrenov Date: Fri, 9 Aug 2024 10:44:00 +0400 Subject: [PATCH 05/11] Fixed static build for gcc (#25987) ### Details: - *item1* - *...* ### Tickets: - *ticket-id* --- .../reference/scatter_elements_update.hpp | 2 +- .../scatter_elements_update_gpu_test.cpp | 22 ++----------------- 2 files changed, 3 insertions(+), 21 deletions(-) diff --git a/src/core/reference/include/openvino/reference/scatter_elements_update.hpp b/src/core/reference/include/openvino/reference/scatter_elements_update.hpp index 1b25e367f5eed1..2323c03b34a16f 100644 --- a/src/core/reference/include/openvino/reference/scatter_elements_update.hpp +++ b/src/core/reference/include/openvino/reference/scatter_elements_update.hpp @@ -96,7 +96,7 @@ std::function reduction_functor_for( } template <> -std::function reduction_functor_for( +inline std::function reduction_functor_for( const ov::op::v12::ScatterElementsUpdate::Reduction reduction_type) { switch (reduction_type) { case ov::op::v12::ScatterElementsUpdate::Reduction::MAX: diff --git a/src/plugins/intel_gpu/tests/unit/test_cases/scatter_elements_update_gpu_test.cpp b/src/plugins/intel_gpu/tests/unit/test_cases/scatter_elements_update_gpu_test.cpp index fbda0b629970eb..6982b2658334ed 100644 --- a/src/plugins/intel_gpu/tests/unit/test_cases/scatter_elements_update_gpu_test.cpp +++ b/src/plugins/intel_gpu/tests/unit/test_cases/scatter_elements_update_gpu_test.cpp @@ -4,6 +4,8 @@ #include "test_utils.h" +#include "openvino/reference/scatter_elements_update.hpp" + #include #include #include @@ -15,26 +17,6 @@ using namespace cldnn; using namespace ::tests; -#ifdef OPENVINO_STATIC_LIBRARY -namespace ov { -namespace reference { -using Reduction = ov::op::v12::ScatterElementsUpdate::Reduction; - -template -void scatter_elem_update(const DataType *input_data, - const IndicesType *indices, - const DataType *updates, - const int64_t axis, - DataType *out_buf, - const Shape &data_shape, - const Shape &indices_shape, - const Reduction reduction_type = Reduction::NONE, - const bool use_init_val = true); -} -} -#else -#include "openvino/reference/scatter_elements_update.hpp" -#endif template void test_d2411_axisF(bool is_caching_test) { From afb83fa02e7fca7b0d7b28abb8a44a216cc102c7 Mon Sep 17 00:00:00 2001 From: Ilya Lavrenov Date: Fri, 9 Aug 2024 01:56:59 +0400 Subject: [PATCH 06/11] Updated OpenVINO build docs (#25982) ### Details: - *item1* - *...* ### Tickets: - *ticket-id* --- docs/dev/cmake_options_for_custom_compilation.md | 3 +++ docs/dev/static_libaries.md | 14 +++++--------- 2 files changed, 8 insertions(+), 9 deletions(-) diff --git a/docs/dev/cmake_options_for_custom_compilation.md b/docs/dev/cmake_options_for_custom_compilation.md index d370285f99c8b4..5ace401ce091c6 100644 --- a/docs/dev/cmake_options_for_custom_compilation.md +++ b/docs/dev/cmake_options_for_custom_compilation.md @@ -19,6 +19,8 @@ This document provides description and default values for CMake options that can * `ON` is default for x86 platforms; `OFF`, otherwise. * `ENABLE_INTEL_GPU` enables Intel GPU plugin compilation: * `ON` is default for x86 platforms; not available, otherwise. + * `ENABLE_INTEL_NPU` enables Intel NPU plugin compilation: + * `ON` is default for Windows and Linux x86 platforms; not available, otherwise. * `ENABLE_HETERO` enables HETERO plugin build: * `ON` is default. * `ENABLE_MULTI` enables MULTI plugin build: @@ -191,3 +193,4 @@ In this case OpenVINO CMake scripts take `TBBROOT` environment variable into acc [PyTorch]:https://pytorch.org/ [FlatBuffers]:https://google.github.io/flatbuffers/ [oneTBB]:https://github.com/oneapi-src/oneTBB +[JAX]:https://github.com/google/jax diff --git a/docs/dev/static_libaries.md b/docs/dev/static_libaries.md index 0f694cda73f07d..19972a292f3b0c 100644 --- a/docs/dev/static_libaries.md +++ b/docs/dev/static_libaries.md @@ -28,15 +28,15 @@ It is possible because not all interface symbols of OpenVINO Runtime libraries a ## Configure OpenVINO Runtime in the CMake stage The default architecture of OpenVINO Runtime assumes that the following components are subject to dynamic loading during execution: -* (Device) Inference backends (CPU, GPU, MULTI, HETERO, etc.) -* (Model) Frontends (IR, ONNX, PDPD, etc.) -* Preprocessing library (to perform preprocessing, e.g. resize and color space conversions) +* (Device) Inference backends (CPU, GPU, NPU, MULTI, HETERO, etc.) +* (Model) Frontends (IR, ONNX, PDPD, TF, JAX, etc.) With the static OpenVINO Runtime, all these modules should be linked into a final user application and **the list of modules/configuration must be known for the CMake configuration stage**. To minimize the total binary size, you can explicitly turn `OFF` unnecessary components. Use [[CMake Options for Custom Compilation|CMakeOptionsForCustomCompilation ]] as a reference for OpenVINO CMake configuration. For example, to enable only IR v11 reading and CPU inference capabilities, use: ```sh cmake -DENABLE_INTEL_GPU=OFF \ + -DENABLE_INTEL_NPU=OFF \ -DENABLE_TEMPLATE=OFF \ -DENABLE_HETERO=OFF \ -DENABLE_MULTI=OFF \ @@ -46,6 +46,7 @@ cmake -DENABLE_INTEL_GPU=OFF \ -DENABLE_OV_PADDLE_FRONTEND=OFF \ -DENABLE_OV_TF_FRONTEND=OFF \ -DENABLE_OV_TF_LITE_FRONTEND=OFF \ + -DENABLE_OV_JAX_FRONTEND=OFF \ -DENABLE_OV_PYTORCH_FRONTEND=OFF \ -DENABLE_OV_JAX_FRONTEND=OFF \ -DENABLE_INTEL_CPU=ON \ @@ -133,21 +134,16 @@ cmake -DCMAKE_TOOLCHAIN_FILE=/cmake/toolchains/mt.runtime.w * The enabled and tested capabilities of OpenVINO Runtime in a static build: * OpenVINO common runtime - work with `ov::Model`, perform model loading on particular device * MULTI, HETERO, AUTO, and BATCH inference modes - * IR, ONNX, PDPD, and TF frontends to read `ov::Model` + * IR, ONNX, PDPD, TF and TF Lite frontends to read `ov::Model` * Static build support for building static libraries only for OpenVINO Runtime libraries. All other third-party prebuilt dependencies remain in the same format: - * `libGNA` is a shared library. * `TBB` is a shared library; to provide your own TBB build from [[oneTBB source code|https://github.com/oneapi-src/oneTBB]] use `export TBBROOT=` before OpenVINO CMake scripts are run. > **NOTE**: The TBB team does not recommend using oneTBB as a static library, see [[Why onetbb does not like a static library?|https://github.com/oneapi-src/oneTBB/issues/646]] * `TBBBind_2_5` is not available on Windows x64 during a static OpenVINO build (see description for `ENABLE_TBBBIND_2_5` CMake option [[here|CMakeOptionsForCustomCompilation]] to understand what this library is responsible for). So, capabilities enabled by `TBBBind_2_5` are not available. To enable them, build [[oneTBB from source code|https://github.com/oneapi-src/oneTBB]] and provide the path to built oneTBB artifacts via `TBBROOT` environment variable before OpenVINO CMake scripts are run. -* `ov::Op::type_info` static member is deprecated and not available in static build. Don't use `type_info` during implementation of your own custom operations, use `ov::Op::get_type_info_static()` instead. - ## See also * [OpenVINO README](../../README.md) * [OpenVINO Developer Documentation](index.md) * [How to Build OpenVINO](build.md) - - From 5f1e0d752a38bcef964ab83eae69d4d5dae4c256 Mon Sep 17 00:00:00 2001 From: Ilya Lavrenov Date: Wed, 31 Jul 2024 23:22:43 +0400 Subject: [PATCH 07/11] Fixed compilation with clang and libc++ (#25813) ### Details: - *item1* - *...* ### Tickets: - Closes https://github.com/openvinotoolkit/openvino/issues/25420 --- CMakeLists.txt | 3 +++ cmake/developer_package/target_flags.cmake | 23 +++++++++++++++++++--- 2 files changed, 23 insertions(+), 3 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 494a3e4ce21d61..c68e3a611b39ba 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -92,6 +92,9 @@ endif() if(NOT OV_LIBC_VERSION VERSION_EQUAL 0.0) message (STATUS "LIBC_VERSION .......................... " ${OV_LIBC_VERSION}) endif() +if(DEFINED OPENVINO_STDLIB) + message (STATUS "STDLIB ................................ " ${OPENVINO_STDLIB}) +endif() # remove file with exported targets to force its regeneration file(REMOVE "${CMAKE_BINARY_DIR}/OpenVINOTargets.cmake") diff --git a/cmake/developer_package/target_flags.cmake b/cmake/developer_package/target_flags.cmake index c6e3ebb29068fd..6666e349315ae3 100644 --- a/cmake/developer_package/target_flags.cmake +++ b/cmake/developer_package/target_flags.cmake @@ -119,6 +119,23 @@ get_property(OV_GENERATOR_MULTI_CONFIG GLOBAL PROPERTY GENERATOR_IS_MULTI_CONFIG function(ov_detect_libc_type) include(CheckCXXSourceCompiles) + check_cxx_source_compiles(" +# include +# ifndef _GLIBCXX_USE_CXX11_ABI +# error \"GlibCXX ABI is not defined\" +# endif + +int main() { + return 0; +}" + OPENVINO_STDLIB_GNU) + + if(OPENVINO_STDLIB_GNU) + set(OPENVINO_STDLIB "GNU" PARENT_SCOPE) + else() + set(OPENVINO_STDLIB "CPP" PARENT_SCOPE) + endif() + check_cxx_source_compiles(" # ifndef _GNU_SOURCE # define _GNU_SOURCE @@ -140,9 +157,9 @@ function(ov_detect_libc_type) int main() { return 0; }" - OPENVINO_MUSL_LIBC) + OPENVINO_GLIBC_MUSL) - if(OPENVINO_MUSL_LIBC) + if(OPENVINO_GLIBC_MUSL) set(OPENVINO_MUSL_LIBC ON PARENT_SCOPE) else() set(OPENVINO_GNU_LIBC ON PARENT_SCOPE) @@ -213,7 +230,7 @@ ov_libc_version() # Detects default value for _GLIBCXX_USE_CXX11_ABI for current compiler # macro(ov_get_glibcxx_use_cxx11_abi) - if(LINUX) + if(LINUX AND OPENVINO_STDLIB STREQUAL "GNU") ov_get_compiler_definition("_GLIBCXX_USE_CXX11_ABI" OV_GLIBCXX_USE_CXX11_ABI) endif() endmacro() From f55bda60d7382ce961c83ca03f6fad86b3045e83 Mon Sep 17 00:00:00 2001 From: Ilya Lavrenov Date: Thu, 1 Aug 2024 16:59:24 +0400 Subject: [PATCH 08/11] Added version for OpenVINO developer package local version (#25859) ### Details: - To allow to select developer package of specific version - Required for GenAI build as part of OpenVINO extra modules --- cmake/extra_modules.cmake | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/cmake/extra_modules.cmake b/cmake/extra_modules.cmake index 4ad3bb30b3aa0a..0ddafc6773f051 100644 --- a/cmake/extra_modules.cmake +++ b/cmake/extra_modules.cmake @@ -119,6 +119,10 @@ function(_ov_register_extra_modules) add_library(${NS}::${exported_target_clean_name} ALIAS ${exported_target}) endif()\n") endforeach() + + configure_file("${OpenVINO_SOURCE_DIR}/cmake/templates/OpenVINOConfig-version.cmake.in" + "${OpenVINODeveloperPackage_DIR}/OpenVINODeveloperPackageConfig-version.cmake" + @ONLY) endfunction() _ov_generate_fake_developer_package("openvino") From 8fd7744ff8b144fa836e72ce4db02670e770b8a9 Mon Sep 17 00:00:00 2001 From: Ilya Lavrenov Date: Thu, 1 Aug 2024 21:23:30 +0400 Subject: [PATCH 09/11] Allow to override CPACK_ARCHIVE_COMPONENT_INSTALL (#25867) ### Details: - To override by external cmake options - Useful for GenAI to create a single archive --- cmake/developer_package/packaging/archive.cmake | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/cmake/developer_package/packaging/archive.cmake b/cmake/developer_package/packaging/archive.cmake index 853b7649e88ddf..9c14e01ca2eba8 100644 --- a/cmake/developer_package/packaging/archive.cmake +++ b/cmake/developer_package/packaging/archive.cmake @@ -102,5 +102,7 @@ ov_define_component_include_rules() # New in version 3.18 set(CPACK_ARCHIVE_THREADS 8) -# multiple packages are generated -set(CPACK_ARCHIVE_COMPONENT_INSTALL ON) +# multiple packages are generated by default +if(NOT DEFINED CPACK_ARCHIVE_COMPONENT_INSTALL) + set(CPACK_ARCHIVE_COMPONENT_INSTALL ON) +endif() From 892835c7dc02f85e0039681bec614a5d7594d183 Mon Sep 17 00:00:00 2001 From: Ilya Lavrenov Date: Fri, 9 Aug 2024 23:10:35 +0400 Subject: [PATCH 10/11] Supported more newer OS versions (#25992) - *item1* - *...* - *ticket-id* --- .github/dockerfiles/docker_tag | 2 +- .../install-openvino/install-openvino-yum.rst | 10 ++-- .../install_openvino_dependencies.sh | 58 ++++++++++++------- 3 files changed, 42 insertions(+), 28 deletions(-) diff --git a/.github/dockerfiles/docker_tag b/.github/dockerfiles/docker_tag index ae48310adafe6f..b0d65596f73323 100644 --- a/.github/dockerfiles/docker_tag +++ b/.github/dockerfiles/docker_tag @@ -1 +1 @@ -pr-25303 +pr-26077 diff --git a/docs/articles_en/get-started/install-openvino/install-openvino-yum.rst b/docs/articles_en/get-started/install-openvino/install-openvino-yum.rst index b9faf719b73f5c..e5bf8767f51fc0 100644 --- a/docs/articles_en/get-started/install-openvino/install-openvino-yum.rst +++ b/docs/articles_en/get-started/install-openvino/install-openvino-yum.rst @@ -31,11 +31,11 @@ Install OpenVINO™ Runtime on Linux From YUM Repository - RHEL 8.2 and higher - Amazon Linux 2022 and 2023 - - Rocky Linux 8.7, 8.8 and 9.2 - - Alma Linux 8.7, 8.8 and 9.2 - - Oracle Linux 8.7, 8.8 and 9.2 - - Fedora 29 and higher up to 40 - - OpenEuler 20.03 and 22.03 + - Rocky Linux 8.7, 8.8 and 9.2-9.3 + - Alma Linux 8.7, 8.8 and 9.2-9.4 + - Oracle Linux 8.7, 8.8 and 9.2-9.4 + - Fedora 29 and higher up to 41 + - OpenEuler 20.03, 22.03, 23.03 and 24.03 - Anolis OS 8.6 and 8.8 - CentOS Stream 8 and 9 diff --git a/scripts/install_dependencies/install_openvino_dependencies.sh b/scripts/install_dependencies/install_openvino_dependencies.sh index cbf81e00c70f49..238694862120d2 100755 --- a/scripts/install_dependencies/install_openvino_dependencies.sh +++ b/scripts/install_dependencies/install_openvino_dependencies.sh @@ -95,16 +95,17 @@ if [ "$os" == "auto" ] ; then fi case $os in centos7|centos8|centos9|\ - rhel8|rhel9.1|\ + rhel8|rhel9.1|rhel9.2|rhel9.3|rhel9.4|\ opencloudos8.5|opencloudos8.6|opencloudos8.8|opencloudos9.0|opencloudos9.2|\ tencentos3.1|tencentos3.2|tencentos3.3|tencentos4.0|tencentos4.2|\ anolis8.6|anolis8.8|\ - openEuler20.03|openEuler22.03|openEuler23.03|\ - almalinux8.7|almalinux8.8|almalinux9.2|\ + openEuler20.03|openEuler22.03|openEuler23.03|openEuler24.03|\ + almalinux8.7|almalinux8.8|almalinux9.2|almalinux9.3|almalinux9.4|\ amzn2|amzn2022|amzn2023|\ - ol8.7|ol8.8|ol9.2|\ - rocky8.7|rocky8.8|rocky9.2|\ - fedora29|fedora30|fedora31|fedora32|fedora33|fedora34|fedora35|fedora36|fedora37|fedora38|fedora39|fedora40|\ + ol8.7|ol8.8|ol9.2|ol9.3|ol9.4|\ + rocky8.7|rocky8.8|rocky9.2|rocky9.3|rocky9.4|\ + fedora29|fedora30|fedora31|fedora32|fedora33|fedora34|fedora35|fedora36|\ + fedora37|fedora38|fedora39|fedora40|fedora41|\ opensuse-leap15.3|\ raspbian9|debian9|ubuntu18.04|\ raspbian10|debian10|ubuntu20.04|ubuntu20.10|ubuntu21.04|\ @@ -161,19 +162,24 @@ elif [ "$os" == "ubuntu20.04" ] || [ "$os" == "debian10" ] || [ "$os" == "raspbi fi elif [ "$os" == "centos7" ] || [ "$os" == "centos8" ] || [ "$os" == "centos9" ] || - [ "$os" == "rhel8" ] || [ "$os" == "rhel9.1" ] || + [ "$os" == "rhel8" ] || + [ "$os" == "rhel9.1" ] || [ "$os" == "rhel9.2" ] || [ "$os" == "rhel9.3" ] || [ "$os" == "rhel9.4" ] || [ "$os" == "opencloudos8.5" ] || [ "$os" == "opencloudos8.6" ] || [ "$os" == "opencloudos8.8" ] || [ "$os" == "opencloudos9.0" ] || [ "$os" == "opencloudos9.2" ] || [ "$os" == "tencentos3.1" ] || [ "$os" == "tencentos3.2" ] || [ "$os" == "tencentos3.3" ] || [ "$os" == "tencentos4.0" ] || [ "$os" == "tencentos4.2" ] || [ "$os" == "anolis8.6" ] || [ "$os" == "anolis8.8" ] || - [ "$os" == "openEuler20.03" ] || [ "$os" == "openEuler22.03" ] || [ "$os" == "openEuler23.03" ] || + [ "$os" == "openEuler20.03" ] || [ "$os" == "openEuler22.03" ] || [ "$os" == "openEuler23.03" ] || [ "$os" == "openEuler24.03" ] || [ "$os" == "fedora29" ] || [ "$os" == "fedora30" ] || [ "$os" == "fedora31" ] || [ "$os" == "fedora32" ] || [ "$os" == "fedora33" ] || [ "$os" == "fedora34" ] || [ "$os" == "fedora35" ] || [ "$os" == "fedora36" ] || [ "$os" == "fedora37" ] || [ "$os" == "fedora38" ] || [ "$os" == "fedora39" ] || [ "$os" == "fedora40" ] || - [ "$os" == "ol8.7" ] || [ "$os" == "ol8.8" ] || [ "$os" == "ol9.2" ] || - [ "$os" == "rocky8.7" ] || [ "$os" == "rocky8.8" ] || [ "$os" == "rocky9.2" ] || - [ "$os" == "almalinux8.7" ] || [ "$os" == "almalinux8.8" ] || [ "$os" == "almalinux9.2" ] || + [ "$os" == "fedora41" ] || + [ "$os" == "ol8.7" ] || [ "$os" == "ol8.8" ] || + [ "$os" == "ol9.2" ] || [ "$os" == "ol9.3" ] || [ "$os" == "ol9.4" ] || + [ "$os" == "rocky8.7" ] || [ "$os" == "rocky8.8" ] || + [ "$os" == "rocky9.2" ] || [ "$os" == "rocky9.3" ] || [ "$os" == "rocky9.4" ] || + [ "$os" == "almalinux8.7" ] || [ "$os" == "almalinux8.8" ] || + [ "$os" == "almalinux9.2" ] || [ "$os" == "almalinux9.3" ] || [ "$os" == "almalinux9.4" ]|| [ "$os" == "amzn2" ] || [ "$os" == "amzn2022" ] || [ "$os" == "amzn2023" ] ; then arch=$(uname -m) @@ -195,13 +201,17 @@ elif [ "$os" == "centos7" ] || [ "$os" == "centos8" ] || [ "$os" == "centos9" ] if [ "$os" == "fedora29" ] || [ "$os" == "fedora30" ] || [ "$os" == "fedora31" ] || [ "$os" == "fedora32" ] || [ "$os" == "fedora33" ] || [ "$os" == "fedora34" ] || [ "$os" == "fedora35" ] || [ "$os" == "fedora36" ] || [ "$os" == "fedora37" ] || [ "$os" == "fedora38" ] || [ "$os" == "fedora39" ] || [ "$os" == "fedora40" ] || - [ "$os" == "ol8.7" ] || [ "$os" == "ol8.8" ] || [ "$os" == "ol9.2" ] || - [ "$os" == "rocky8.7" ] || [ "$os" == "rocky8.8" ] || [ "$os" == "rocky9.2" ] || - [ "$os" == "almalinux8.7" ] || [ "$os" == "almalinux8.8" ] || [ "$os" == "almalinux9.2" ] || + [ "$os" == "fedora41" ] || + [ "$os" == "ol8.7" ] || [ "$os" == "ol8.8" ] || + [ "$os" == "ol9.2" ] || [ "$os" == "ol9.3" ] || [ "$os" == "ol9.4" ] + [ "$os" == "rocky8.7" ] || [ "$os" == "rocky8.8" ] || + [ "$os" == "rocky9.2" ] || [ "$os" == "rocky9.3" ] || [ "$os" == "rocky9.4" ] || + [ "$os" == "almalinux8.7" ] || [ "$os" == "almalinux8.8" ] || + [ "$os" == "almalinux9.2" ] || [ "$os" == "almalinux9.3" ] || [ "$os" == "almalinux9.4" ] || [ "$os" == "centos8" ] || [ "$os" == "centos9" ] || [ "$os" == "amzn2022" ] || [ "$os" == "amzn2023" ] || [ "$os" == "anolis8.6" ] || [ "$os" == "anolis8.8" ] || - [ "$os" == "openEuler20.03" ] || [ "$os" == "openEuler22.03" ] || [ "$os" == "openEuler23.03" ] ; then + [ "$os" == "openEuler20.03" ] || [ "$os" == "openEuler22.03" ] || [ "$os" == "openEuler23.03" ] || [ "$os" == "openEuler24.03" ] ; then pkgs_python+=(python3 python3-pip) fi @@ -212,7 +222,7 @@ elif [ "$os" == "centos7" ] || [ "$os" == "centos8" ] || [ "$os" == "centos9" ] pkgs_gpu+=("http://mirror.centos.org/centos/8-stream/AppStream/$arch/os/Packages/ocl-icd-2.2.12-1.el8.$arch.rpm") pkgs_python+=(python38 python38-pip) extra_repos+=("https://dl.fedoraproject.org/pub/epel/epel-release-latest-8.noarch.rpm") - elif [ "$os" == "rhel9.1" ] ; then + elif [ "$os" == "rhel9.1" ] || [ "$os" == "rhel9.2" ] || [ "$os" == "rhel9.3" ] || [ "$os" == "rhel9.4" ] ; then pkgs_gpu+=("https://mirror.stream.centos.org/9-stream/AppStream/$arch/os/Packages/ocl-icd-2.2.13-4.el9.$arch.rpm") pkgs_python+=(python3 python3-pip) extra_repos+=("https://dl.fedoraproject.org/pub/epel/epel-release-latest-9.noarch.rpm") @@ -273,16 +283,20 @@ if [ "$os" == "debian9" ] || [ "$os" == "raspbian9" ] || [ "$os" == "ubuntu18.04 apt-get update && apt-get install --no-install-recommends "$iopt" "${pkgs[@]}" elif [ "$os" == "centos7" ] || [ "$os" == "centos8" ] || [ "$os" == "centos9" ] || - [ "$os" == "rhel8" ] || [ "$os" == "rhel9.1" ] || + [ "$os" == "rhel8" ] || + [ "$os" == "rhel9.1" ] || [ "$os" == "rhel9.2" ] || [ "$os" == "rhel9.3" ] || [ "$os" == "rhel9.4" ] || [ "$os" == "anolis8.6" ] || [ "$os" == "anolis8.8" ] || - [ "$os" == "openEuler20.03" ] || [ "$os" == "openEuler22.03" ] || [ "$os" == "openEuler23.03" ] || + [ "$os" == "openEuler20.03" ] || [ "$os" == "openEuler22.03" ] || [ "$os" == "openEuler23.03" ] || [ "$os" == "openEuler24.03" ] || [ "$os" == "fedora29" ] || [ "$os" == "fedora30" ] || [ "$os" == "fedora31" ] || [ "$os" == "fedora32" ] || [ "$os" == "fedora33" ] || [ "$os" == "fedora34" ] || [ "$os" == "fedora35" ] || [ "$os" == "fedora36" ] || [ "$os" == "fedora37" ] || [ "$os" == "fedora38" ] || [ "$os" == "fedora39" ] || [ "$os" == "fedora40" ] || - [ "$os" == "fedora36" ] || [ "$os" == "fedora38" ] || - [ "$os" == "ol8.7" ] || [ "$os" == "ol8.8" ] || [ "$os" == "ol9.2" ] || - [ "$os" == "rocky8.7" ] || [ "$os" == "rocky8.8" ] || [ "$os" == "rocky9.2" ] || - [ "$os" == "almalinux8.7" ] || [ "$os" == "almalinux8.8" ] || [ "$os" == "almalinux9.2" ] || + [ "$os" == "fedora41" ] || + [ "$os" == "ol8.7" ] || [ "$os" == "ol8.8" ] || + [ "$os" == "ol9.2" ] || [ "$os" == "ol9.3" ] || [ "$os" == "ol9.4" ] || + [ "$os" == "rocky8.7" ] || [ "$os" == "rocky8.8" ] || + [ "$os" == "rocky9.2" ] || [ "$os" == "rocky9.3" ] || [ "$os" == "rocky9.4" ] || + [ "$os" == "almalinux8.7" ] || [ "$os" == "almalinux8.8" ] || + [ "$os" == "almalinux9.2" ] || [ "$os" == "almalinux9.3" ] || [ "$os" == "almalinux9.4" ] || [ "$os" == "amzn2" ] || [ "$os" == "amzn2022" ] || [ "$os" == "amzn2023" ] ; then [ -z "$interactive" ] && iopt="--assumeyes" From 9e57e4f04e5ee98c3885a6db24fc6d52c80bb928 Mon Sep 17 00:00:00 2001 From: Ilya Lavrenov Date: Thu, 8 Aug 2024 21:29:30 +0400 Subject: [PATCH 11/11] Static build with both oneDNNs from CPU and GPU (#25962) ### Details: - *item1* - *...* ### Tickets: - 148704 --- cmake/features.cmake | 5 ++- src/plugins/intel_cpu/CMakeLists.txt | 54 ++++++++++++++++++++++++++++ src/plugins/intel_gpu/CMakeLists.txt | 3 ++ 3 files changed, 59 insertions(+), 3 deletions(-) diff --git a/cmake/features.cmake b/cmake/features.cmake index b67501c194cbe1..514c2cb5e8a460 100644 --- a/cmake/features.cmake +++ b/cmake/features.cmake @@ -34,9 +34,8 @@ endif() ov_dependent_option (ENABLE_INTEL_GPU "GPU OpenCL-based plugin for OpenVINO Runtime" ${ENABLE_INTEL_GPU_DEFAULT} "X86_64 OR AARCH64;NOT APPLE;NOT WINDOWS_STORE;NOT WINDOWS_PHONE" OFF) -if (ANDROID OR MINGW OR (CMAKE_COMPILER_IS_GNUCXX AND CMAKE_CXX_COMPILER_VERSION VERSION_LESS 7.0) OR (NOT BUILD_SHARED_LIBS AND ENABLE_INTEL_CPU)) - # oneDNN doesn't support old compilers and android builds for now, so we'll build GPU plugin without oneDNN - # also, in case of static build CPU's and GPU's oneDNNs will conflict, so we are disabling GPU's one in this case +if (ANDROID OR MINGW OR (CMAKE_COMPILER_IS_GNUCXX AND CMAKE_CXX_COMPILER_VERSION VERSION_LESS 7.0)) + # oneDNN doesn't support old compilers and Android builds for now, so we'll build GPU plugin without oneDNN set(ENABLE_ONEDNN_FOR_GPU_DEFAULT OFF) else() set(ENABLE_ONEDNN_FOR_GPU_DEFAULT ON) diff --git a/src/plugins/intel_cpu/CMakeLists.txt b/src/plugins/intel_cpu/CMakeLists.txt index b76b198d30c7ab..dc0fa11f17b72c 100644 --- a/src/plugins/intel_cpu/CMakeLists.txt +++ b/src/plugins/intel_cpu/CMakeLists.txt @@ -34,6 +34,60 @@ elseif(CMAKE_COMPILER_IS_GNUCXX) endif() endif() +if(NOT BUILD_SHARED_LIBS) + # Symbols are located in both src and include folders + file(GLOB_RECURSE onednn_files + "${CMAKE_CURRENT_SOURCE_DIR}/thirdparty/onednn/include/*.cpp" + "${CMAKE_CURRENT_SOURCE_DIR}/thirdparty/onednn/include/*.hpp" + "${CMAKE_CURRENT_SOURCE_DIR}/thirdparty/onednn/include/*.h" + "${CMAKE_CURRENT_SOURCE_DIR}/thirdparty/onednn/include/*.hpp" + "${CMAKE_CURRENT_SOURCE_DIR}/thirdparty/onednn/src/*.cpp" + "${CMAKE_CURRENT_SOURCE_DIR}/thirdparty/onednn/src/*.hpp" + "${CMAKE_CURRENT_SOURCE_DIR}/thirdparty/onednn/src/*.h" + "${CMAKE_CURRENT_SOURCE_DIR}/thirdparty/onednn/src/*.hpp") + + # parse API symbols + foreach(onednn_file IN LISTS onednn_files) + # symbols in form: + # dnnl_status_t DNNL_API dnnl_engine_get_kind + file(STRINGS "${onednn_file}" onednn_symbols_defined_on_single_line + REGEX "DNNL_API[ \*]*dnnl[a-zA-Z0-9_]*") + # symbols in form (cmake has issue with symbols defined on multiple lines and we have to use new pattern): + # dnnl_status_t DNNL_API + # dnnl_engine_get_kind + file(STRINGS "${onednn_file}" onednn_symbols_defined_on_multiple_lines + REGEX "^dnnl[a-zA-Z0-9_]*\\(") + # symbols in form: + # typedef struct dnnl_graph_graph *dnnl_graph_graph_t; + file(STRINGS "${onednn_file}" onednn_symbols_typedef + REGEX "^typedef struct dnnl_.*") + + if(onednn_symbols_defined_on_single_line OR + onednn_symbols_defined_on_multiple_lines OR + onednn_symbols_typedef) + # parse concrete symbols from read line + string(REGEX MATCHALL "dnnl[a-zA-Z0-9_]+" onednn_parsed_symbols + ${onednn_symbols_defined_on_single_line} + ${onednn_symbols_defined_on_multiple_lines} + ${onednn_symbols_typedef}) + list(APPEND onednn_symbols ${onednn_parsed_symbols}) + endif() + endforeach() + + # remove all duplicates + list(REMOVE_DUPLICATES onednn_symbols) + + # also override namespaces + list(APPEND onednn_symbols dnnl oneapi) + + # redefine all collected symbols + foreach(onednn_symbol IN LISTS onednn_symbols) + if(NOT onednn_symbol MATCHES "^#.+") + add_compile_definitions(${onednn_symbol}=ov_cpu_${onednn_symbol}) + endif() + endforeach() +endif() + if (AARCH64 AND NOT APPLE AND CMAKE_COMPILER_IS_GNUCXX AND CMAKE_CXX_COMPILER_VERSION VERSION_GREATER_EQUAL 10.2) # according to https://github.com/ARM-software/ComputeLibrary/issues/1053#issuecomment-1846903707 comment # the 'multi_isa=1' below enables FP32, FP16 and SVE / SVE2 kernels diff --git a/src/plugins/intel_gpu/CMakeLists.txt b/src/plugins/intel_gpu/CMakeLists.txt index dc24e404c74b81..53b4a203301c77 100644 --- a/src/plugins/intel_gpu/CMakeLists.txt +++ b/src/plugins/intel_gpu/CMakeLists.txt @@ -30,6 +30,9 @@ if(CMAKE_CXX_COMPILER_ID STREQUAL "MSVC") ov_add_compiler_flags(/wd4244) # '<': signed/unsigned mismatch ov_add_compiler_flags(/wd4018) + + # see https://github.com/oneapi-src/oneDNN/issues/2028 + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /Zc:__cplusplus") endif() if(ENABLE_GPU_DEBUG_CAPS)