Skip to content

Commit b96fdbd

Browse files
authored
[UR] Add dockers to UR workflow (#18162)
- [x] wait for #18080 --------- Signed-off-by: rbanka1 <[email protected]>
1 parent b742079 commit b96fdbd

File tree

2 files changed

+96
-36
lines changed

2 files changed

+96
-36
lines changed

.github/workflows/ur-build-hw.yml

Lines changed: 50 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,14 @@ on:
2626
required: false
2727
type: string
2828
default: OFF
29+
docker_image:
30+
required: true
31+
type: string
32+
default: ""
33+
image_options:
34+
required: true
35+
type: string
36+
default: ""
2937
workflow_dispatch:
3038
inputs:
3139
adapter_name:
@@ -51,9 +59,16 @@ on:
5159
required: false
5260
type: string
5361
default: OFF
62+
docker_image:
63+
required: true
64+
type: string
65+
default: ""
66+
image_options:
67+
required: true
68+
type: string
69+
default: ""
5470

55-
permissions:
56-
contents: read
71+
permissions: read-all
5772

5873
env:
5974
UR_LOG_CUDA: "level:error;flush:error"
@@ -83,6 +98,9 @@ jobs:
8398
compiler: [{c: gcc, cxx: g++}]
8499

85100
runs-on: ${{inputs.runner_name}}
101+
container:
102+
image: ${{ inputs.docker_image }}
103+
options: ${{ inputs.image_options }}
86104

87105
steps:
88106
# TODO:
@@ -94,9 +112,15 @@ jobs:
94112
- name: Checkout LLVM
95113
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
96114

97-
# Latest distros do not allow global pip installation
115+
# for some reason it's required to re-configure python for venv to work properly.
116+
- name: Set up Python 3.12
117+
if: ${{ inputs.docker_image == 'ghcr.io/intel/llvm/ubuntu2404_intel_drivers:alldeps' }}
118+
uses: actions/setup-python@a26af69be951a213d495a4c3e4e4022e16d87065 # v5.6.0
119+
with:
120+
python-version: '3.12'
121+
98122
- name: Install UR python dependencies in venv
99-
working-directory: ${{github.workspace}}/unified-runtime
123+
working-directory: ./unified-runtime
100124
run: |
101125
python3 -m venv .venv
102126
. .venv/bin/activate
@@ -106,16 +130,25 @@ jobs:
106130
107131
- name: Download DPC++
108132
run: |
109-
wget -O ${{github.workspace}}/dpcpp_compiler.tar.gz https://github.com/intel/llvm/releases/download/nightly-2024-12-12/sycl_linux.tar.gz
110-
mkdir dpcpp_compiler
111-
tar -xvf ${{github.workspace}}/dpcpp_compiler.tar.gz -C dpcpp_compiler
133+
wget -O dpcpp_compiler.tar.gz https://github.com/intel/llvm/releases/download/nightly-2024-12-12/sycl_linux.tar.gz
134+
mkdir -p dpcpp_compiler
135+
tar -xvf dpcpp_compiler.tar.gz -C dpcpp_compiler
136+
137+
- name: Install OpenCL
138+
if: ${{ inputs.adapter_name == 'OPENCL' }}
139+
run: |
140+
wget -O- https://apt.repos.intel.com/intel-gpg-keys/GPG-PUB-KEY-INTEL-SW-PRODUCTS.PUB \
141+
| gpg --dearmor | sudo tee /usr/share/keyrings/oneapi-archive-keyring.gpg > /dev/null
142+
echo "deb [signed-by=/usr/share/keyrings/oneapi-archive-keyring.gpg] https://apt.repos.intel.com/oneapi all main" | sudo tee /etc/apt/sources.list.d/oneAPI.list
143+
sudo apt-get update
144+
sudo apt-get install -y intel-oneapi-runtime-opencl
112145
113146
- name: Configure Unified Runtime project
114-
working-directory: ${{github.workspace}}/unified-runtime
115147
# ">" is used to avoid adding "\" at the end of each line; this command is quite long
116148
run: >
117149
cmake
118-
-B${{github.workspace}}/build
150+
-S unified-runtime
151+
-B build
119152
-DCMAKE_C_COMPILER=${{matrix.compiler.c}}
120153
-DCMAKE_CXX_COMPILER=${{matrix.compiler.cxx}}
121154
-DCMAKE_BUILD_TYPE=${{matrix.build_type}}
@@ -127,32 +160,32 @@ jobs:
127160
${{ matrix.adapter.other_name != '' && format('-DUR_BUILD_ADAPTER_{0}=ON', matrix.adapter.other_name) || '' }}
128161
-DUR_STATIC_LOADER=${{matrix.adapter.static_Loader}}
129162
-DUR_STATIC_ADAPTER_${{matrix.adapter.name}}=${{matrix.adapter.static_adapter}}
130-
-DUR_DPCXX=${{github.workspace}}/dpcpp_compiler/bin/clang++
131-
-DUR_SYCL_LIBRARY_DIR=${{github.workspace}}/dpcpp_compiler/lib
132-
-DCMAKE_INSTALL_PREFIX=${{github.workspace}}/install
163+
-DUR_DPCXX=./dpcpp_compiler/bin/clang++
164+
-DUR_SYCL_LIBRARY_DIR=./dpcpp_compiler/lib
165+
-DCMAKE_INSTALL_PREFIX=./install
133166
${{ matrix.adapter.name == 'HIP' && '-DUR_CONFORMANCE_AMD_ARCH=gfx1030' || '' }}
134167
${{ matrix.adapter.name == 'HIP' && '-DUR_HIP_PLATFORM=AMD' || '' }}
135168
136169
- name: Build
137170
# This is so that device binaries can find the sycl runtime library
138-
run: cmake --build ${{github.workspace}}/build -j $(nproc)
171+
run: cmake --build build -j $(nproc)
139172

140173
- name: Install
141174
# This is to check that install command does not fail
142-
run: cmake --install ${{github.workspace}}/build
175+
run: cmake --install build
143176

144177
- name: Test adapter specific
145178
env:
146179
ZE_ENABLE_LOADER_DEBUG_TRACE: 1
147-
run: ctest -C ${{matrix.build_type}} --test-dir ${{github.workspace}}/build --output-on-failure -L "adapter-specific" -E "memcheck" --timeout 600 -VV
180+
run: ctest -C ${{matrix.build_type}} --test-dir build --output-on-failure -L "adapter-specific" -E "memcheck" --timeout 600 -VV
148181
# Don't run adapter specific tests when building multiple adapters
149182
if: ${{ matrix.adapter.other_name == '' }}
150183

151184
- name: Test adapters
152185
env:
153186
ZE_ENABLE_LOADER_DEBUG_TRACE: 1
154-
run: env UR_CTS_ADAPTER_PLATFORM="${{matrix.adapter.platform}}" ctest -C ${{matrix.build_type}} --test-dir ${{github.workspace}}/build --output-on-failure -L "conformance" --timeout 600 -VV
187+
run: env UR_CTS_ADAPTER_PLATFORM="${{matrix.adapter.platform}}" ctest -C ${{matrix.build_type}} --test-dir build --output-on-failure -L "conformance" --timeout 600 -VV
155188

156189
- name: Get information about platform
157190
if: ${{ always() }}
158-
run: ${{github.workspace}}/unified-runtime/.github/scripts/get_system_info.sh
191+
run: ./unified-runtime/.github/scripts/get_system_info.sh

.github/workflows/ur-precommit.yml

Lines changed: 46 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -52,27 +52,54 @@ jobs:
5252
if: ${{ always() && !cancelled() && contains(needs.detect_changes.outputs.filters, 'ur') }}
5353
strategy:
5454
matrix:
55-
# Extra native CPU jobs are here to force the loader to be used.
56-
# UR will not use the loader if there is only one target.
57-
adapter: [
58-
{name: L0, runner: UR_L0},
59-
{name: L0_V2, runner: UR_L0},
60-
{name: L0, runner: UR_L0, static: ON},
61-
{name: OPENCL, runner: UR_OPENCL, platform: "Intel(R) OpenCL"},
62-
{name: CUDA, runner: UR_CUDA},
63-
{name: HIP, runner: UR_HIP},
64-
{name: NATIVE_CPU, runner: UR_NATIVE_CPU},
65-
{name: OPENCL, runner: UR_OPENCL, other_adapter: NATIVE_CPU, platform: "OPENCL:Intel(R) OpenCL"},
66-
{name: L0, runner: UR_L0, other_adapter: NATIVE_CPU},
67-
]
55+
# Extra native CPU jobs are here to force the loader to be used.
56+
# UR will not use the loader if there is only one target.
57+
include:
58+
- name: L0
59+
runner: UR_L0
60+
image_options: -u 1001 --device=/dev/dri -v /dev/dri/by-path:/dev/dri/by-path --privileged --cap-add SYS_ADMIN
61+
- name: L0_V2
62+
runner: UR_L0
63+
image_options: -u 1001 --device=/dev/dri -v /dev/dri/by-path:/dev/dri/by-path --privileged --cap-add SYS_ADMIN
64+
- name: L0
65+
runner: UR_L0
66+
static: ON
67+
image_options: -u 1001 --device=/dev/dri -v /dev/dri/by-path:/dev/dri/by-path --privileged --cap-add SYS_ADMIN
68+
- name: L0
69+
runner: UR_L0
70+
other_adapter: NATIVE_CPU
71+
image_options: -u 1001 --device=/dev/dri -v /dev/dri/by-path:/dev/dri/by-path --privileged --cap-add SYS_ADMIN
72+
- name: HIP
73+
runner: UR_HIP
74+
image_options: -u 1001 --device=/dev/dri --device=/dev/kfd --cap-add=SYS_ADMIN
75+
- name: CUDA
76+
runner: UR_CUDA
77+
image_options: -u 1001 --privileged --cap-add SYS_ADMIN --gpus all
78+
- name: OPENCL
79+
runner: UR_OPENCL
80+
platform: "Intel(R) OpenCL"
81+
docker_image: "ghcr.io/intel/llvm/ubuntu2204_build:latest"
82+
image_options: -u 1001 --device=/dev/dri --device=/dev/kfd --privileged --cap-add SYS_ADMIN
83+
- name: OPENCL
84+
runner: UR_OPENCL
85+
platform: "OPENCL:Intel(R) OpenCL"
86+
other_adapter: NATIVE_CPU
87+
docker_image: "ghcr.io/intel/llvm/ubuntu2204_build:latest"
88+
image_options: -u 1001 --device=/dev/dri --device=/dev/kfd --privileged --cap-add SYS_ADMIN
89+
- name: NATIVE_CPU
90+
runner: UR_NATIVE_CPU
91+
docker_image: "ghcr.io/intel/llvm/ubuntu2204_build:latest"
92+
image_options: -u 1001 --device=/dev/dri --privileged --cap-add SYS_ADMIN
6893
uses: ./.github/workflows/ur-build-hw.yml
6994
with:
70-
adapter_name: ${{ matrix.adapter.name }}
71-
runner_name: ${{ matrix.adapter.runner }}
72-
static_loader: ${{ matrix.adapter.static || 'OFF' }}
73-
static_adapter: ${{ matrix.adapter.static || 'OFF' }}
74-
platform: ${{ matrix.adapter.platform || '' }}
75-
other_adapter_name: ${{ matrix.adapter.other_adapter || '' }}
95+
adapter_name: ${{ matrix.name }}
96+
runner_name: ${{ matrix.runner }}
97+
static_loader: ${{ matrix.static || 'OFF' }}
98+
static_adapter: ${{ matrix.static || 'OFF' }}
99+
platform: ${{ matrix.platform || '' }}
100+
other_adapter_name: ${{ matrix.other_adapter || '' }}
101+
docker_image: ${{ matrix.docker_image || 'ghcr.io/intel/llvm/ubuntu2404_intel_drivers:alldeps'}}
102+
image_options: ${{ matrix.image_options || '' }}
76103

77104
macos:
78105
name: MacOS build only

0 commit comments

Comments
 (0)