@@ -18,6 +18,9 @@ inputs:
1818 required : false
1919 sycl_compiler :
2020 required : false
21+ build_unified_runtime_locally :
22+ required : false
23+ default : ' true'
2124
2225
2326runs :
5255 tar -I 'zstd' -xf /sycl-prebuilt/e2e_binaries.tar.zst -C build-e2e
5356 tar -I 'zstd' -xf /sycl-prebuilt/e2e_sources.tar.zst -C llvm
5457
58+ - name : Checkout unified-runtime source
59+ if : inputs.build_unified_runtime_locally == 'true'
60+ uses : actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
61+ with :
62+ path : unified-runtime-src
63+ sparse-checkout : |
64+ unified-runtime/
65+ ref : ${{ inputs.ref || github.sha }}
66+
67+ - name : Provide lit binary for UR tests
68+ if : inputs.build_unified_runtime_locally == 'true'
69+ shell : bash
70+ run : |
71+ if command -v lit >/dev/null 2>&1; then
72+ exit 0
73+ fi
74+
75+ mkdir -p "$HOME/.local/bin"
76+
77+ if [ -x "$PWD/toolchain/bin/llvm-lit" ]; then
78+ ln -sfn "$PWD/toolchain/bin/llvm-lit" "$HOME/.local/bin/lit"
79+ echo "$HOME/.local/bin" >> $GITHUB_PATH
80+ exit 0
81+ fi
82+
83+ if command -v llvm-lit >/dev/null 2>&1; then
84+ ln -sfn "$(command -v llvm-lit)" "$HOME/.local/bin/lit"
85+ echo "$HOME/.local/bin" >> $GITHUB_PATH
86+ exit 0
87+ fi
88+
89+ python3 -m pip install --user lit
90+ echo "$HOME/.local/bin" >> $GITHUB_PATH
91+
92+ - name : Build unified-runtime with container CUDA
93+ if : inputs.build_unified_runtime_locally == 'true'
94+ shell : bash
95+ run : |
96+ cd unified-runtime-src
97+ ln -sfn "$PWD/../toolchain" dpcpp_compiler
98+ cmake -S unified-runtime -B build \
99+ -DCMAKE_C_COMPILER=gcc \
100+ -DCMAKE_CXX_COMPILER=g++ \
101+ -DCMAKE_BUILD_TYPE=Release \
102+ -DUR_ENABLE_TRACING=ON \
103+ -DUR_DEVELOPER_MODE=ON \
104+ -DUR_BUILD_TESTS=ON \
105+ -DUR_BUILD_ADAPTER_L0_V2=ON \
106+ -DUR_STATIC_LOADER=OFF \
107+ -DUR_STATIC_ADAPTER_L0_V2=OFF \
108+ -DUR_DPCXX=./dpcpp_compiler/bin/clang++ \
109+ -DUR_SYCL_LIBRARY_DIR=./dpcpp_compiler/lib \
110+ -DUR_CONFORMANCE_NVIDIA_ARCH="sm_75" \
111+ -DCMAKE_INSTALL_PREFIX=./install
112+ cmake --build build
113+ cmake --install build
114+
115+ - name : Install built unified-runtime
116+ if : inputs.build_unified_runtime_locally == 'true'
117+ shell : bash
118+ run : |
119+ # Install the locally-built UR libraries over the prebuilt ones
120+ mkdir -p "$PWD/toolchain/lib/plugins"
121+ cp unified-runtime-src/install/lib/libur_adapter_cuda.so* "$PWD/toolchain/lib/" 2>/dev/null || true
122+ cp unified-runtime-src/install/lib/libur_loader.so* "$PWD/toolchain/lib/" 2>/dev/null || true
123+ cp unified-runtime-src/install/lib/plugins/* "$PWD/toolchain/lib/plugins/" 2>/dev/null || true
124+ cp unified-runtime-src/build/lib/libur_adapter_cuda.so* "$PWD/toolchain/lib/" 2>/dev/null || true
125+ cp unified-runtime-src/build/lib/libur_loader.so* "$PWD/toolchain/lib/" 2>/dev/null || true
126+ cp unified-runtime-src/build/lib/plugins/* "$PWD/toolchain/lib/plugins/" 2>/dev/null || true
127+ # Also ensure the built libs are in LD_LIBRARY_PATH
128+ echo LD_LIBRARY_PATH="$PWD/unified-runtime-src/install/lib:$PWD/unified-runtime-src/build/lib:$LD_LIBRARY_PATH" >> $GITHUB_ENV
129+
55130 - name : Deduce E2E CMake options
56131 if : inputs.testing_mode != 'run-only'
57132 id : cmake_opts
0 commit comments