From 6237da2beb29cabf1ced3454d028c71d7051e03b Mon Sep 17 00:00:00 2001 From: "Sarnie, Nick" Date: Wed, 7 Aug 2024 13:58:17 -0700 Subject: [PATCH] [CI] Use shared library build for HIP testing in postcommit Signed-off-by: Sarnie, Nick --- .github/workflows/sycl-linux-build.yml | 3 +++ .github/workflows/sycl-post-commit.yml | 29 +++++--------------------- buildbot/configure.py | 4 +++- devops/scripts/install_build_tools.sh | 3 ++- sycl/CMakeLists.txt | 11 +++++++--- 5 files changed, 21 insertions(+), 29 deletions(-) diff --git a/.github/workflows/sycl-linux-build.yml b/.github/workflows/sycl-linux-build.yml index 17dcc83aeb437..5240f04f6ede8 100644 --- a/.github/workflows/sycl-linux-build.yml +++ b/.github/workflows/sycl-linux-build.yml @@ -231,6 +231,9 @@ jobs: run: | cmake --build $GITHUB_WORKSPACE/build --target install-clang-libraries cmake --build $GITHUB_WORKSPACE/build --target install-llvm-libraries + PREINSTALLED_CLANG_PATH=`which clang` + PREINSTALLED_INSTALL_DIR=`echo $PREINSTALLED_CLANG_PATH | rev | cut -c7- | rev` + cp "${PREINSTALLED_INSTALL_DIR}/lld" $GITHUB_WORKSPACE/build/install/bin/ - name: Pack toolchain if: ${{ always() && !cancelled() && steps.build.conclusion == 'success' }} diff --git a/.github/workflows/sycl-post-commit.yml b/.github/workflows/sycl-post-commit.yml index d1989b33c2484..edc90bb5fecdf 100644 --- a/.github/workflows/sycl-post-commit.yml +++ b/.github/workflows/sycl-post-commit.yml @@ -42,23 +42,8 @@ jobs: cxx: clang++ merge_ref: '' - build-lin-static: - name: Linux (Self build + static libraries + no-assertions) - if: github.repository == 'intel/llvm' - uses: ./.github/workflows/sycl-linux-build.yml - with: - build_cache_root: "/__w/llvm" - build_cache_suffix: sprod_static - build_artifact_suffix: sprod_static - build_configure_extra_args: --no-assertions --hip --cuda --native_cpu --cmake-opt="-DSYCL_ENABLE_STACK_PRINTING=ON" --cmake-opt="-DSYCL_LIB_WITH_DEBUG_SYMBOL=ON" - # Docker image has last nightly pre-installed and added to the PATH - build_image: "ghcr.io/intel/llvm/sycl_ubuntu2204_nightly:build" - cc: clang - cxx: clang++ - merge_ref: '' - e2e-lin: - needs: [build-lin, build-lin-static] + needs: [build-lin] if: ${{ always() && !cancelled() && needs.build-lin.outputs.build_conclusion == 'success' }} strategy: fail-fast: false @@ -75,14 +60,10 @@ jobs: reset_intel_gpu: true - name: AMD/HIP runner: '["Linux", "amdgpu"]' - image: ghcr.io/intel/llvm/ubuntu2204_build:latest-0300ac924620a51f76c4929794637b82790f12ab + image: ghcr.io/intel/llvm/ubuntu2204_build:latest image_options: -u 1001 --device=/dev/dri --device=/dev/kfd target_devices: ext_oneapi_hip:gpu reset_intel_gpu: false - # Use static build because of shared lld packaging issue - sycl_toolchain_artifact: sycl_linux_sprod_static - sycl_toolchain_archive: ${{ needs.build-lin-static.outputs.artifact_archive_name }} - sycl_toolchain_decompress_command: ${{ needs.build-lin-static.outputs.artifact_decompress_command }} # Performance tests below. Specifics: # - only run performance tests (use LIT_FILTER env) # - ask llvm-lit to show all the output, even for PASS (-a) @@ -116,9 +97,9 @@ jobs: ref: ${{ github.sha }} merge_ref: '' - sycl_toolchain_artifact: ${{ matrix.sycl_toolchain_artifact || 'sycl_linux_sprod_shared' }} - sycl_toolchain_archive: ${{ matrix.sycl_toolchain_archive || needs.build-lin.outputs.artifact_archive_name }} - sycl_toolchain_decompress_command: ${{ matrix.sycl_toolchain_decompress_command || needs.build-lin.outputs.artifact_decompress_command }} + sycl_toolchain_artifact: sycl_linux_sprod_shared + sycl_toolchain_archive: ${{ needs.build-lin.outputs.artifact_archive_name }} + sycl_toolchain_decompress_command: ${{ needs.build-lin.outputs.artifact_decompress_command }} build-win: if: | diff --git a/buildbot/configure.py b/buildbot/configure.py index 692a64fd31256..684e7090462d8 100644 --- a/buildbot/configure.py +++ b/buildbot/configure.py @@ -69,7 +69,9 @@ def do_configure(args): sycl_enabled_plugins.append("level_zero") # lld is needed on Windows or for the HIP plugin on AMD - if platform.system() == "Windows" or (args.hip and args.hip_platform == "AMD"): + if platform.system() == "Windows" or ( + args.hip and args.hip_platform == "AMD" and not args.shared_libs + ): llvm_enable_projects += ";lld" libclc_enabled = args.cuda or args.hip or args.native_cpu diff --git a/devops/scripts/install_build_tools.sh b/devops/scripts/install_build_tools.sh index 4e0dcdc57cdc0..55bc2aa5f8fe7 100755 --- a/devops/scripts/install_build_tools.sh +++ b/devops/scripts/install_build_tools.sh @@ -23,7 +23,8 @@ apt update && apt install -yqq \ unzip \ jq \ curl \ - libhwloc-dev + libhwloc-dev \ + lld pip3 install psutil diff --git a/sycl/CMakeLists.txt b/sycl/CMakeLists.txt index aa1f49ff1a6b6..6e5874e7868bb 100644 --- a/sycl/CMakeLists.txt +++ b/sycl/CMakeLists.txt @@ -502,10 +502,15 @@ if("hip" IN_LIST SYCL_ENABLE_PLUGINS) message(FATAL_ERROR "HIP support requires adding \"libclc\" to the CMake argument \"LLVM_ENABLE_PROJECTS\"") endif() - - if(NOT TARGET lld AND "${SYCL_BUILD_PI_HIP_PLATFORM}" STREQUAL "AMD") + find_program( + SYSTEM_LLD + NAMES + lld + DOC "Pre-installed system lld executable" + ) + if(NOT TARGET lld AND "${SYCL_BUILD_PI_HIP_PLATFORM}" STREQUAL "AMD" AND NOT SYSTEM_LLD) message(FATAL_ERROR - "HIP support requires adding \"lld\" to the CMake argument \"LLVM_ENABLE_PROJECTS\"") + "HIP support requires adding \"lld\" to the CMake argument \"LLVM_ENABLE_PROJECTS\" or installing a pre-built lld") endif() add_dependencies(sycl-toolchain ur_adapter_hip)