Skip to content

Commit

Permalink
[CI] Enable HIP and CUDA plugins in GitHub Actions builds (#5087)
Browse files Browse the repository at this point in the history
Build all supported targets as part of the main build step. The idea is to build compiler toolchain once and distribute binary artifacts across machines to run the required testing.

Also this patch adds option to disable some tests, that require real hardware. Those must be moved to intel/llvm-test-suite, as instructed by [contributing guidelines](https://github.com/intel/llvm/blob/sycl/CONTRIBUTING.md).
  • Loading branch information
alexbatashev authored Dec 14, 2021
1 parent 23e180b commit a95c12a
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 5 deletions.
13 changes: 9 additions & 4 deletions .github/workflows/sycl_linux_build_and_test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ on:
build_image:
type: string
required: false
default: "ghcr.io/intel/llvm/ubuntu2004_base:latest"
default: "ghcr.io/intel/llvm/ubuntu2004_build:latest"
build_runs_on:
type: string
required: false
Expand Down Expand Up @@ -61,7 +61,7 @@ jobs:
\"cc\":\"gcc\",
\"cxx\":\"g++\",
\"build_runs_on\":\"sycl-precommit-linux\",
\"build_image\":\"ghcr.io/intel/llvm/ubuntu2004_base:latest\",
\"build_image\":\"ghcr.io/intel/llvm/ubuntu2004_build:latest\",
\"build_github_cache\":\"false\",
\"build_cache_root\":\"/__w/\",
\"build_cache_suffix\":\"default\",
Expand Down Expand Up @@ -104,15 +104,18 @@ jobs:
CACHE_SUFFIX: ${{ fromJSON(needs.configure.outputs.params).build_cache_suffix }}
CACHE_SIZE: ${{ fromJSON(needs.configure.outputs.params).build_cache_size }}
ARGS: ${{ fromJSON(needs.configure.outputs.params).build_configure_extra_args }}
CUDA_LIB_PATH: "/usr/local/cuda/lib64/stubs"
run: |
mkdir -p $CACHE_ROOT/build_cache_$CACHE_SUFFIX
mkdir -p $GITHUB_WORKSPACE/build
cd $GITHUB_WORKSPACE/build
python3 $GITHUB_WORKSPACE/src/buildbot/configure.py -w $GITHUB_WORKSPACE \
-s $GITHUB_WORKSPACE/src -o $GITHUB_WORKSPACE/build -t Release \
--ci-defaults $ARGS --cmake-opt="-DLLVM_CCACHE_BUILD=ON" \
--ci-defaults $ARGS --cuda --hip --hip-amd-arch="gfx906" \
--cmake-opt="-DLLVM_CCACHE_BUILD=ON" \
--cmake-opt="-DLLVM_CCACHE_DIR=$CACHE_ROOT/build_cache_$CACHE_SUFFIX" \
--cmake-opt="-DLLVM_CCACHE_MAXSIZE=$CACHE_SIZE"
--cmake-opt="-DLLVM_CCACHE_MAXSIZE=$CACHE_SIZE" \
--cmake-opt="-DSYCL_PI_TESTS=OFF"
- name: Compile
run: cmake --build $GITHUB_WORKSPACE/build
# TODO allow to optionally disable in-tree checks
Expand All @@ -128,6 +131,8 @@ jobs:
- name: check-sycl
if: always()
run: |
# TODO consider moving this to Dockerfile
export LD_LIBRARY_PATH=/usr/local/cuda/compat/:/usr/local/cuda/lib64:$LD_LIBRARY_PATH
cmake --build $GITHUB_WORKSPACE/build --target check-sycl
- name: check-llvm-spirv
if: always()
Expand Down
8 changes: 7 additions & 1 deletion sycl/unittests/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,16 @@ string(TOLOWER "${CMAKE_BUILD_TYPE}" build_type_lower)

include(AddSYCLUnitTest)

# TODO PI tests require real hardware and must be moved to intel/llvm-test-suite
option(SYCL_PI_TESTS "Enable PI-specific unit tests" ON)

if (SYCL_PI_TESTS)
add_subdirectory(pi)
endif()

add_subdirectory(allowlist)
add_subdirectory(config)
add_subdirectory(misc)
add_subdirectory(pi)
add_subdirectory(kernel-and-program)
add_subdirectory(queue)
add_subdirectory(scheduler)
Expand Down

0 comments on commit a95c12a

Please sign in to comment.