From 33c0829f3e3389006662845784980b930faf3b38 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Igor=20Chor=C4=85=C5=BCewicz?= Date: Thu, 25 Jul 2024 23:00:19 -0700 Subject: [PATCH] [UR] Bump UR version and enable dynamic linking with UMF (#13343) Testing PR for: https://github.com/oneapi-src/unified-runtime/pull/1430 --------- Co-authored-by: Krzysztof Swiecicki Co-authored-by: Steffen Larsen --- .github/workflows/docs.yml | 2 +- .github/workflows/release-documentation.yml | 3 +- .github/workflows/release-doxygen.yml | 3 +- .github/workflows/sycl-docs.yml | 2 +- sycl/doc/GetStartedGuide.md | 2 ++ sycl/plugins/unified_runtime/CMakeLists.txt | 33 +++++++++++++++------ sycl/test-e2e/Basic/get_info_aspect.cpp | 6 +++- 7 files changed, 37 insertions(+), 14 deletions(-) diff --git a/.github/workflows/docs.yml b/.github/workflows/docs.yml index 7fefe1038d72e..40a19ecd9411e 100644 --- a/.github/workflows/docs.yml +++ b/.github/workflows/docs.yml @@ -111,7 +111,7 @@ jobs: run: | sudo apt-get update # swig and graphviz are lldb specific dependencies - sudo apt-get install -y cmake ninja-build swig graphviz + sudo apt-get install -y cmake ninja-build swig graphviz libhwloc-dev - name: Build LLVM docs if: steps.docs-changed-subprojects.outputs.llvm_any_changed == 'true' run: | diff --git a/.github/workflows/release-documentation.yml b/.github/workflows/release-documentation.yml index 02ffbb142a940..483f87add90ec 100644 --- a/.github/workflows/release-documentation.yml +++ b/.github/workflows/release-documentation.yml @@ -49,7 +49,8 @@ jobs: graphviz \ python3-github \ ninja-build \ - texlive-font-utils + texlive-font-utils \ + libhwloc-dev pip3 install --user -r ./llvm/docs/requirements.txt - name: Build Documentation diff --git a/.github/workflows/release-doxygen.yml b/.github/workflows/release-doxygen.yml index ef00a438ce7ac..ba6f72a11dcbd 100644 --- a/.github/workflows/release-doxygen.yml +++ b/.github/workflows/release-doxygen.yml @@ -52,7 +52,8 @@ jobs: graphviz \ python3-github \ ninja-build \ - texlive-font-utils + texlive-font-utils \ + libhwloc-dev pip3 install --user -r ./llvm/docs/requirements.txt - name: Build Doxygen diff --git a/.github/workflows/sycl-docs.yml b/.github/workflows/sycl-docs.yml index faff11b9e1ed4..cddf2bb5fe492 100644 --- a/.github/workflows/sycl-docs.yml +++ b/.github/workflows/sycl-docs.yml @@ -25,7 +25,7 @@ jobs: path: repo - name: Install deps run: | - sudo apt-get install -y doxygen graphviz ssh ninja-build + sudo apt-get install -y doxygen graphviz ssh ninja-build libhwloc-dev sudo pip3 install -r repo/llvm/docs/requirements.txt - name: Build Docs run: | diff --git a/sycl/doc/GetStartedGuide.md b/sycl/doc/GetStartedGuide.md index 70d180e686c02..50326f35aa45b 100644 --- a/sycl/doc/GetStartedGuide.md +++ b/sycl/doc/GetStartedGuide.md @@ -43,6 +43,8 @@ and a wide range of compute accelerators such as GPU and FPGA. * `python` - [Download](https://www.python.org/downloads/) * `ninja` - [Download](https://github.com/ninja-build/ninja/wiki/Pre-built-Ninja-packages) +* `hwloc` version 2.3 or later (Linux only) + * libhwloc-dev or hwloc-devel package on linux * C++ compiler * See LLVM's [host compiler toolchain requirements](https://github.com/intel/llvm/blob/sycl/llvm/docs/GettingStarted.rst#host-c-toolchain-both-compiler-and-standard-library) diff --git a/sycl/plugins/unified_runtime/CMakeLists.txt b/sycl/plugins/unified_runtime/CMakeLists.txt index 0096e2029a307..2cd7cc9b10487 100644 --- a/sycl/plugins/unified_runtime/CMakeLists.txt +++ b/sycl/plugins/unified_runtime/CMakeLists.txt @@ -17,7 +17,6 @@ set(SYCL_PI_UR_SOURCE_DIR # Override default to enable building tests from unified-runtime set(UR_BUILD_TESTS OFF CACHE BOOL "Build unit tests.") -set(UMF_ENABLE_POOL_TRACKING ON) if("level_zero" IN_LIST SYCL_ENABLE_PLUGINS) set(UR_BUILD_ADAPTER_L0 ON) @@ -100,13 +99,21 @@ if(SYCL_PI_UR_USE_FETCH_CONTENT) endfunction() set(UNIFIED_RUNTIME_REPO "https://github.com/oneapi-src/unified-runtime.git") - # commit e161516663bd5d14d15532dfaba626d5cdf32ed8 - # Merge: 47633088 febb18bb - # Author: Kenneth Benzie (Benie) - # Date: Wed Jul 24 13:54:43 2024 +0100 - # Merge pull request #1521 from AllanZyne/review/yang/dg2 - # [DeviceSanitizer] Support GPU DG2 & GEN Device - set(UNIFIED_RUNTIME_TAG e161516663bd5d14d15532dfaba626d5cdf32ed8) + # commit 3d8fe8d298cec8db624fc230fa5c0e19865aa6f1 + # Merge: e8c9f3db 0a259f33 + # Author: Piotr Balcer + # Date: Thu Jul 25 15:13:00 2024 +0200 + # Merge pull request #1430 from igchor/umf_dynamic_linking + # Bump UMF version and switch to dynamic linking + set(UNIFIED_RUNTIME_TAG 3d8fe8d298cec8db624fc230fa5c0e19865aa6f1) + + set(UMF_BUILD_EXAMPLES OFF CACHE INTERNAL "EXAMPLES") + # Due to the use of dependentloadflag and no installer for UMF and hwloc we need + # to link statically on windows + if(WIN32) + set(UMF_BUILD_SHARED_LIBRARY OFF CACHE INTERNAL "Build UMF shared library") + set(UMF_LINK_HWLOC_STATICALLY ON CACHE INTERNAL "static HWLOC") + endif() fetch_adapter_source(level_zero ${UNIFIED_RUNTIME_REPO} @@ -192,7 +199,7 @@ set(UNIFIED_RUNTIME_COMMON_INCLUDE_DIR "${UNIFIED_RUNTIME_SOURCE_DIR}/source/com add_library(UnifiedRuntimeLoader ALIAS ur_loader) add_library(UnifiedRuntimeCommon ALIAS ur_common) -add_library(UnifiedMemoryFramework ALIAS umf) +add_library(UnifiedMemoryFramework ALIAS ur_umf) add_library(UnifiedRuntime-Headers INTERFACE) @@ -291,3 +298,11 @@ if ("native_cpu" IN_LIST SYCL_ENABLE_PLUGINS) Some valid SYCL programs may not build or may have low performance.") endif() endif() + +add_dependencies(sycl-runtime-libraries ur_umf) + +# TODO: this is piggy-backing on the existing target component level-zero-sycl-dev +install(TARGETS umf + LIBRARY DESTINATION "lib${LLVM_LIBDIR_SUFFIX}" COMPONENT level-zero-sycl-dev + ARCHIVE DESTINATION "lib${LLVM_LIBDIR_SUFFIX}" COMPONENT level-zero-sycl-dev + RUNTIME DESTINATION "bin" COMPONENT level-zero-sycl-dev) diff --git a/sycl/test-e2e/Basic/get_info_aspect.cpp b/sycl/test-e2e/Basic/get_info_aspect.cpp index fbc7bd7ffa86e..55bf51b7422af 100644 --- a/sycl/test-e2e/Basic/get_info_aspect.cpp +++ b/sycl/test-e2e/Basic/get_info_aspect.cpp @@ -3,7 +3,11 @@ // REQUIRES: gpu, level_zero // RUN: %{build} -o %t.out -// RUN: %{run} %t.out +// RUN: env ZES_ENABLE_SYSMAN=0 %{run} %t.out +// Explicitly set 'ZES_ENABLE_SYSMAN=0'. HWLOC initializes this environment +// variable in its constructor, causing this test to fail, as retrieving +// free memory information is expected not to work in this test. +// For more context, see: https://github.com/oneapi-src/level-zero/issues/36. #include int main() {