Use custom TBB even on Linux (#24359)

### Details:
- System TBB provides lower performance than newer versions, so we have
to distribute our own one.
This commit is contained in:
Ilya Lavrenov 2024-05-17 09:07:41 +04:00 committed by GitHub
parent fc5e60c77e
commit 92e88b28e7
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
7 changed files with 15 additions and 28 deletions

View File

@ -1 +1 @@
pr-24449
pr-24359

View File

@ -125,7 +125,6 @@ jobs:
-DENABLE_NCC_STYLE=OFF \
-DENABLE_TESTS=ON \
-DENABLE_STRICT_DEPENDENCIES=OFF \
-DENABLE_SYSTEM_TBB=ON \
-DENABLE_SYSTEM_OPENCL=ON \
-DENABLE_PYTHON_PACKAGING=ON \
-DCPACK_GENERATOR=TGZ \
@ -160,7 +159,9 @@ jobs:
- name: Build RPM packages
run: |
cmake -DCPACK_GENERATOR=RPM \
cmake -UTBB* \
-DCPACK_GENERATOR=RPM \
-DENABLE_SYSTEM_TBB=ON \
-DENABLE_TESTS=OFF \
${BUILD_DIR}
cmake --build ${BUILD_DIR} --parallel --target package --verbose

View File

@ -162,7 +162,6 @@ jobs:
-DENABLE_NCC_STYLE=OFF \
-DENABLE_TESTS=ON \
-DENABLE_STRICT_DEPENDENCIES=OFF \
-DENABLE_SYSTEM_TBB=ON \
-DENABLE_SYSTEM_OPENCL=ON \
-DCMAKE_VERBOSE_MAKEFILE=ON \
-DCPACK_GENERATOR=TGZ \
@ -213,6 +212,8 @@ jobs:
/usr/bin/python3.8 -m pip install -U pip
/usr/bin/python3.8 -m pip install -r ${OPENVINO_REPO}/src/bindings/python/wheel/requirements-dev.txt
cmake -UPYTHON* \
-UTBB* \
-DENABLE_SYSTEM_TBB=ON \
-DENABLE_PYTHON_PACKAGING=ON \
-DENABLE_TESTS=OFF \
-DPython3_EXECUTABLE=/usr/bin/python3.8 \

View File

@ -208,11 +208,14 @@ jobs:
install_dependencies/install_openvino_dependencies.sh
popd
cp -v ${OPENVINO_REPO}/temp/tbb/lib/lib* ${INSTALL_TEST_DIR}/tests
pushd ${INSTALL_TEST_DIR}
tar -czvf ${BUILD_DIR}/openvino_tests.tar.gz \
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/*
popd

View File

@ -162,15 +162,7 @@ else()
set(ENABLE_SYSTEM_FLATBUFFERS_DEFAULT ON)
endif()
# users wants to use his own TBB version, specific either via env vars or cmake options
if(DEFINED ENV{TBBROOT} OR DEFINED ENV{TBB_DIR} OR DEFINED TBB_DIR OR DEFINED TBBROOT)
set(ENABLE_SYSTEM_TBB_DEFAULT OFF)
else()
set(ENABLE_SYSTEM_TBB_DEFAULT ${ENABLE_SYSTEM_LIBS_DEFAULT})
endif()
ov_dependent_option (ENABLE_SYSTEM_TBB "Enables use of system TBB" ${ENABLE_SYSTEM_TBB_DEFAULT}
"THREADING MATCHES TBB" OFF)
ov_dependent_option (ENABLE_SYSTEM_TBB "Enables use of system TBB" OFF "THREADING MATCHES TBB" OFF)
ov_option (ENABLE_SYSTEM_PUGIXML "Enables use of system PugiXML" OFF)
# the option is on by default, because we use only flatc compiler and don't use any libraries
ov_dependent_option(ENABLE_SYSTEM_FLATBUFFERS "Enables use of system flatbuffers" ${ENABLE_SYSTEM_FLATBUFFERS_DEFAULT}

View File

@ -124,14 +124,12 @@ if [ "$os" == "raspbian9" ] || [ "$os" == "debian9" ] ; then
# - cmake version is 3.7.2
# which are not supported by OpenVINO
pkgs_core=()
pkgs_gpu=(ocl-icd-libopencl1)
pkgs_python=()
pkgs_dev=(pkg-config g++ gcc libc6-dev make sudo)
elif [ "$os" == "ubuntu18.04" ] ; then
pkgs_core=(libtbb2)
pkgs_gpu=(ocl-icd-libopencl1)
pkgs_python=(python3.8 libpython3.8 python3.8-venv python3-pip)
pkgs_dev=(cmake pkg-config g++ gcc libc6-dev make sudo)
@ -140,18 +138,10 @@ elif [ "$os" == "ubuntu20.04" ] || [ "$os" == "debian10" ] || [ "$os" == "raspbi
[ "$os" == "ubuntu21.10" ] || [ "$os" == "ubuntu22.04" ] || [ "$os" == "debian11" ] || [ "$os" == "raspbian11" ] ||
[ "$os" == "ubuntu22.10" ] || [ "$os" == "ubuntu23.04" ] || [ "$os" == "ubuntu24.04" ] || [ "$os" == "debian12" ] || [ "$os" == "raspbian12" ]; then
pkgs_core=()
pkgs_gpu=(ocl-icd-libopencl1)
pkgs_python=(python3 python3-venv python3-pip)
pkgs_dev=(cmake pkgconf g++ gcc libc6-dev make sudo)
if [ "$os" == "ubuntu22.04" ] || [ "$os" == "ubuntu22.10" ] || [ "$os" == "ubuntu23.04" ] || [ "$os" == "ubuntu24.04" ] ||
[ "$os" == "debian12" ] || [ "$os" == "raspbian12" ] ; then
pkgs_core+=(libtbb12)
else
pkgs_core+=(libtbb2)
fi
if [ "$os" == "debian10" ] || [ "$os" == "raspbian10" ] ; then
pkgs_python+=(libpython3.7)
elif [ "$os" == "ubuntu20.04" ] || [ "$os" == "ubuntu20.10" ] || [ "$os" == "ubuntu21.04" ] ; then
@ -186,7 +176,6 @@ elif [ "$os" == "centos7" ] || [ "$os" == "centos8" ] || [ "$os" == "centos9" ]
amazon-linux-extras install epel python3.8
fi
pkgs_core=()
pkgs_gpu=()
pkgs_python=()
pkgs_dev=(gcc gcc-c++ make glibc libstdc++ libgcc cmake3 sudo)
@ -207,7 +196,6 @@ elif [ "$os" == "centos7" ] || [ "$os" == "centos8" ] || [ "$os" == "centos9" ]
[ "$os" == "amzn2022" ] || [ "$os" == "amzn2023" ] ||
[ "$os" == "anolis8.6" ] || [ "$os" == "anolis8.8" ] ||
[ "$os" == "openEuler20.03" ] || [ "$os" == "openEuler22.03" ] || [ "$os" == "openEuler23.03" ] ; then
pkgs_core+=("tbb.$arch")
pkgs_python+=(python3 python3-pip)
fi
@ -215,18 +203,15 @@ elif [ "$os" == "centos7" ] || [ "$os" == "centos8" ] || [ "$os" == "centos9" ]
pkgs_gpu+=("ocl-icd.$arch")
extra_repos+=("https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm")
elif [ "$os" == "rhel8" ] ; then
pkgs_core+=("https://vault.centos.org/centos/8/AppStream/$arch/os/Packages/tbb-2018.2-9.el8.$arch.rpm")
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
pkgs_core+=("http://mirror.stream.centos.org/9-stream/AppStream/$arch/os/Packages/tbb-2020.3-8.el9.$arch.rpm")
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")
fi
elif [ "$os" == "opensuse-leap15.3" ] ; then
pkgs_core=(libtbb2 libtbbmalloc2)
pkgs_gpu=(libOpenCL1)
pkgs_python=(python39-base python39 python39-venv python39-pip)
pkgs_dev=(cmake pkg-config gcc-c++ gcc make sudo)

View File

@ -4,6 +4,11 @@
# Search OpenVINO Runtime installed
find_package(PkgConfig QUIET)
# TODO: since we started to use custom TBB, looks like openvino.pc cannot refer to custom TBB
# solution: currently disable it
set(PkgConfig_FOUND OFF)
# TODO: fix cross-compilation later
if(PkgConfig_FOUND AND NOT CMAKE_CROSSCOMPILING AND CMAKE_BUILD_TYPE STREQUAL "Release")
pkg_search_module(openvino REQUIRED