Skip to content

Commit a95c12a

Browse files
authored
[CI] Enable HIP and CUDA plugins in GitHub Actions builds (#5087)
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).
1 parent 23e180b commit a95c12a

File tree

2 files changed

+16
-5
lines changed

2 files changed

+16
-5
lines changed

.github/workflows/sycl_linux_build_and_test.yml

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ on:
1717
build_image:
1818
type: string
1919
required: false
20-
default: "ghcr.io/intel/llvm/ubuntu2004_base:latest"
20+
default: "ghcr.io/intel/llvm/ubuntu2004_build:latest"
2121
build_runs_on:
2222
type: string
2323
required: false
@@ -61,7 +61,7 @@ jobs:
6161
\"cc\":\"gcc\",
6262
\"cxx\":\"g++\",
6363
\"build_runs_on\":\"sycl-precommit-linux\",
64-
\"build_image\":\"ghcr.io/intel/llvm/ubuntu2004_base:latest\",
64+
\"build_image\":\"ghcr.io/intel/llvm/ubuntu2004_build:latest\",
6565
\"build_github_cache\":\"false\",
6666
\"build_cache_root\":\"/__w/\",
6767
\"build_cache_suffix\":\"default\",
@@ -104,15 +104,18 @@ jobs:
104104
CACHE_SUFFIX: ${{ fromJSON(needs.configure.outputs.params).build_cache_suffix }}
105105
CACHE_SIZE: ${{ fromJSON(needs.configure.outputs.params).build_cache_size }}
106106
ARGS: ${{ fromJSON(needs.configure.outputs.params).build_configure_extra_args }}
107+
CUDA_LIB_PATH: "/usr/local/cuda/lib64/stubs"
107108
run: |
108109
mkdir -p $CACHE_ROOT/build_cache_$CACHE_SUFFIX
109110
mkdir -p $GITHUB_WORKSPACE/build
110111
cd $GITHUB_WORKSPACE/build
111112
python3 $GITHUB_WORKSPACE/src/buildbot/configure.py -w $GITHUB_WORKSPACE \
112113
-s $GITHUB_WORKSPACE/src -o $GITHUB_WORKSPACE/build -t Release \
113-
--ci-defaults $ARGS --cmake-opt="-DLLVM_CCACHE_BUILD=ON" \
114+
--ci-defaults $ARGS --cuda --hip --hip-amd-arch="gfx906" \
115+
--cmake-opt="-DLLVM_CCACHE_BUILD=ON" \
114116
--cmake-opt="-DLLVM_CCACHE_DIR=$CACHE_ROOT/build_cache_$CACHE_SUFFIX" \
115-
--cmake-opt="-DLLVM_CCACHE_MAXSIZE=$CACHE_SIZE"
117+
--cmake-opt="-DLLVM_CCACHE_MAXSIZE=$CACHE_SIZE" \
118+
--cmake-opt="-DSYCL_PI_TESTS=OFF"
116119
- name: Compile
117120
run: cmake --build $GITHUB_WORKSPACE/build
118121
# TODO allow to optionally disable in-tree checks
@@ -128,6 +131,8 @@ jobs:
128131
- name: check-sycl
129132
if: always()
130133
run: |
134+
# TODO consider moving this to Dockerfile
135+
export LD_LIBRARY_PATH=/usr/local/cuda/compat/:/usr/local/cuda/lib64:$LD_LIBRARY_PATH
131136
cmake --build $GITHUB_WORKSPACE/build --target check-sycl
132137
- name: check-llvm-spirv
133138
if: always()

sycl/unittests/CMakeLists.txt

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,16 @@ string(TOLOWER "${CMAKE_BUILD_TYPE}" build_type_lower)
1111

1212
include(AddSYCLUnitTest)
1313

14+
# TODO PI tests require real hardware and must be moved to intel/llvm-test-suite
15+
option(SYCL_PI_TESTS "Enable PI-specific unit tests" ON)
16+
17+
if (SYCL_PI_TESTS)
18+
add_subdirectory(pi)
19+
endif()
20+
1421
add_subdirectory(allowlist)
1522
add_subdirectory(config)
1623
add_subdirectory(misc)
17-
add_subdirectory(pi)
1824
add_subdirectory(kernel-and-program)
1925
add_subdirectory(queue)
2026
add_subdirectory(scheduler)

0 commit comments

Comments
 (0)