Skip to content

Commit

Permalink
[CI] Use shared library build for HIP testing in postcommit
Browse files Browse the repository at this point in the history
Signed-off-by: Sarnie, Nick <nick.sarnie@intel.com>
  • Loading branch information
sarnex committed Aug 12, 2024
1 parent ff06bac commit 6237da2
Show file tree
Hide file tree
Showing 5 changed files with 21 additions and 29 deletions.
3 changes: 3 additions & 0 deletions .github/workflows/sycl-linux-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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' }}
Expand Down
29 changes: 5 additions & 24 deletions .github/workflows/sycl-post-commit.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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)
Expand Down Expand Up @@ -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: |
Expand Down
4 changes: 3 additions & 1 deletion buildbot/configure.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
3 changes: 2 additions & 1 deletion devops/scripts/install_build_tools.sh
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,8 @@ apt update && apt install -yqq \
unzip \
jq \
curl \
libhwloc-dev
libhwloc-dev \
lld

pip3 install psutil

11 changes: 8 additions & 3 deletions sycl/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit 6237da2

Please sign in to comment.