diff options
| author | Naveen Saini <naveen.kumar.saini@intel.com> | 2023-11-30 13:20:07 +0800 |
|---|---|---|
| committer | Khem Raj <raj.khem@gmail.com> | 2023-11-29 22:25:05 -0800 |
| commit | 6fbe5001895a132644665fafa8b1676507023b90 (patch) | |
| tree | c7e7c02b359d93716652500e04c015830464fed9 | |
| parent | d5f16f18c3b45b9549edf65a0921883d22503274 (diff) | |
| download | meta-openembedded-6fbe5001895a132644665fafa8b1676507023b90.tar.gz | |
tbb: enable NUMA/Hybrid CPU support
oneTBB relies on HWLOC* to identify the underlying topology
of the system to optimize thread scheduling and memory allocation.
Ref:
https://oneapi-src.github.io/oneTBB/GSG/next_steps.html#hybrid-cpu-and-numa-support
Signed-off-by: Naveen Saini <naveen.kumar.saini@intel.com>
Signed-off-by: Khem Raj <raj.khem@gmail.com>
| -rw-r--r-- | meta-oe/recipes-support/tbb/tbb/0001-hwloc_detection.cmake-remove-cross-compiation-check.patch | 33 | ||||
| -rw-r--r-- | meta-oe/recipes-support/tbb/tbb_2021.11.0.bb | 12 |
2 files changed, 44 insertions, 1 deletions
diff --git a/meta-oe/recipes-support/tbb/tbb/0001-hwloc_detection.cmake-remove-cross-compiation-check.patch b/meta-oe/recipes-support/tbb/tbb/0001-hwloc_detection.cmake-remove-cross-compiation-check.patch new file mode 100644 index 0000000000..640b131703 --- /dev/null +++ b/meta-oe/recipes-support/tbb/tbb/0001-hwloc_detection.cmake-remove-cross-compiation-check.patch | |||
| @@ -0,0 +1,33 @@ | |||
| 1 | From 7ffc1eba8596544d6e3af0fd5f4004fff6d56f84 Mon Sep 17 00:00:00 2001 | ||
| 2 | From: Naveen Saini <naveen.kumar.saini@intel.com> | ||
| 3 | Date: Wed, 29 Nov 2023 15:48:57 +0800 | ||
| 4 | Subject: [PATCH] hwloc_detection.cmake: remove cross-compiation check | ||
| 5 | |||
| 6 | This check is preventing pkgconfig to | ||
| 7 | search for hwloc under cross-compilation. | ||
| 8 | |||
| 9 | pkgconfig able to find hwloc pkg from sysroot. | ||
| 10 | |||
| 11 | Upstream-Status: Inappropriate | ||
| 12 | |||
| 13 | Signed-off-by: Naveen Saini <naveen.kumar.saini@intel.com> | ||
| 14 | --- | ||
| 15 | cmake/hwloc_detection.cmake | 2 -- | ||
| 16 | 1 file changed, 2 deletions(-) | ||
| 17 | |||
| 18 | diff --git a/cmake/hwloc_detection.cmake b/cmake/hwloc_detection.cmake | ||
| 19 | index 47233b17..5a7e84c3 100644 | ||
| 20 | --- a/cmake/hwloc_detection.cmake | ||
| 21 | +++ b/cmake/hwloc_detection.cmake | ||
| 22 | @@ -46,8 +46,6 @@ endforeach() | ||
| 23 | unset(HWLOC_TARGET_NAME) | ||
| 24 | |||
| 25 | if (NOT HWLOC_TARGET_EXPLICITLY_DEFINED AND | ||
| 26 | - # No hwloc auto detection for cross compilation | ||
| 27 | - NOT CMAKE_CROSSCOMPILING AND | ||
| 28 | NOT TBB_DISABLE_HWLOC_AUTOMATIC_SEARCH | ||
| 29 | ) | ||
| 30 | find_package(PkgConfig QUIET) | ||
| 31 | -- | ||
| 32 | 2.37.3 | ||
| 33 | |||
diff --git a/meta-oe/recipes-support/tbb/tbb_2021.11.0.bb b/meta-oe/recipes-support/tbb/tbb_2021.11.0.bb index 1a1d9988bc..f834726bd6 100644 --- a/meta-oe/recipes-support/tbb/tbb_2021.11.0.bb +++ b/meta-oe/recipes-support/tbb/tbb_2021.11.0.bb | |||
| @@ -8,22 +8,25 @@ LICENSE = "Apache-2.0" | |||
| 8 | LIC_FILES_CHKSUM = "file://LICENSE.txt;md5=86d3f3a95c324c9479bd8986968f4327" | 8 | LIC_FILES_CHKSUM = "file://LICENSE.txt;md5=86d3f3a95c324c9479bd8986968f4327" |
| 9 | 9 | ||
| 10 | DEPENDS:append:libc-musl = " libucontext" | 10 | DEPENDS:append:libc-musl = " libucontext" |
| 11 | DEPENDS:append:class-target = " hwloc" | ||
| 11 | 12 | ||
| 12 | PE = "1" | 13 | PE = "1" |
| 13 | 14 | ||
| 14 | BRANCH = "onetbb_2021" | 15 | BRANCH = "onetbb_2021" |
| 15 | SRCREV = "8b829acc65569019edb896c5150d427f288e8aba" | 16 | SRCREV = "8b829acc65569019edb896c5150d427f288e8aba" |
| 16 | SRC_URI = "git://github.com/oneapi-src/oneTBB.git;protocol=https;branch=${BRANCH} \ | 17 | SRC_URI = "git://github.com/oneapi-src/oneTBB.git;protocol=https;branch=${BRANCH} \ |
| 18 | file://0001-hwloc_detection.cmake-remove-cross-compiation-check.patch \ | ||
| 17 | " | 19 | " |
| 18 | S = "${WORKDIR}/git" | 20 | S = "${WORKDIR}/git" |
| 19 | 21 | ||
| 20 | inherit cmake | 22 | inherit cmake pkgconfig |
| 21 | 23 | ||
| 22 | # test build fails, error: 'mallinfo mallinfo()' is deprecated | 24 | # test build fails, error: 'mallinfo mallinfo()' is deprecated |
| 23 | EXTRA_OECMAKE += " \ | 25 | EXTRA_OECMAKE += " \ |
| 24 | -DTBB_TEST=OFF \ | 26 | -DTBB_TEST=OFF \ |
| 25 | -DCMAKE_BUILD_TYPE=Release \ | 27 | -DCMAKE_BUILD_TYPE=Release \ |
| 26 | " | 28 | " |
| 29 | |||
| 27 | # Hard-float 'd' ABI can't be used for a target that doesn't support the D instruction set extension (ignoring target-abi) | 30 | # Hard-float 'd' ABI can't be used for a target that doesn't support the D instruction set extension (ignoring target-abi) |
| 28 | # tmp-glibc/work/riscv64-oe-linux/tbb/1_2021.7.0-r0/recipe-sysroot-native/usr/bin/riscv64-oe-linux/riscv64-oe-linux-ld: /tmp/lto-llvm-264bc2.o: can't link soft-float modules with double-float modules | 31 | # tmp-glibc/work/riscv64-oe-linux/tbb/1_2021.7.0-r0/recipe-sysroot-native/usr/bin/riscv64-oe-linux/riscv64-oe-linux-ld: /tmp/lto-llvm-264bc2.o: can't link soft-float modules with double-float modules |
| 29 | # tmp-glibc/work/riscv64-oe-linux/tbb/1_2021.7.0-r0/recipe-sysroot-native/usr/bin/riscv64-oe-linux/riscv64-oe-linux-ld: failed to merge target specific data of file /tmp/lto-llvm-264bc2.o | 32 | # tmp-glibc/work/riscv64-oe-linux/tbb/1_2021.7.0-r0/recipe-sysroot-native/usr/bin/riscv64-oe-linux/riscv64-oe-linux-ld: failed to merge target specific data of file /tmp/lto-llvm-264bc2.o |
| @@ -49,4 +52,11 @@ LDFLAGS:append:libc-musl = " -lucontext" | |||
| 49 | # The latest version of oneTBB does not support PPC | 52 | # The latest version of oneTBB does not support PPC |
| 50 | COMPATIBLE_MACHINE:powerpc = "(!.*ppc).*" | 53 | COMPATIBLE_MACHINE:powerpc = "(!.*ppc).*" |
| 51 | 54 | ||
| 55 | |||
| 56 | do_install:append:class-target() { | ||
| 57 | # fix for qa check buildpaths | ||
| 58 | sed -i "s#${RECIPE_SYSROOT}##g" ${D}${libdir}/cmake/TBB/TBBTargets.cmake | ||
| 59 | } | ||
| 60 | |||
| 61 | |||
| 52 | BBCLASSEXTEND = "native nativesdk" | 62 | BBCLASSEXTEND = "native nativesdk" |
