Skip to content

Commit 49fd022

Browse files
dokery
1 parent 946e9b8 commit 49fd022

File tree

2 files changed

+193
-79
lines changed

2 files changed

+193
-79
lines changed

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

Lines changed: 88 additions & 25 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,22 +59,30 @@ 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"
6075
UR_LOG_HIP: "level:error;flush:error"
6176
UR_LOG_LEVEL_ZERO: "level:error;flush:error"
6277
UR_LOG_NATIVE_CPU: "level:error;flush:error"
6378
UR_LOG_OPENCL: "level:error;flush:error"
79+
CURRENT_DIR: $(pwd)
6480

6581
jobs:
6682
adapter_build_hw:
6783
name: Build & CTS
6884
# run only on upstream; forks won't have the HW
69-
if: github.repository == 'intel/llvm'
85+
# if: github.repository == 'intel/llvm'
7086
strategy:
7187
fail-fast: false
7288
matrix:
@@ -83,6 +99,11 @@ jobs:
8399
compiler: [{c: gcc, cxx: g++}]
84100

85101
runs-on: ${{inputs.runner_name}}
102+
container:
103+
image: ${{ inputs.docker_image }}
104+
# TODO: options may differ for other GPU cards
105+
options: ${{ inputs.image_options }}
106+
# options: -u 1001 --device=/dev/dri -v /dev/dri/by-path:/dev/dri/by-path --privileged --cap-add SYS_ADMIN
86107

87108
steps:
88109
# TODO:
@@ -94,27 +115,68 @@ jobs:
94115
- name: Checkout LLVM
95116
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
96117

97-
# Latest distros do not allow global pip installation
98-
- name: Install UR python dependencies in venv
99-
working-directory: ${{github.workspace}}/unified-runtime
118+
# TODO: how other workflows (using dockers) deal with the path change?
119+
# also, note: I don't think it's needed anywhere now - I guess we can only use the relative paths...?
120+
- name: Set working directory as environment variable
100121
run: |
101-
python3 -m venv .venv
102-
. .venv/bin/activate
103-
echo "$PATH" >> $GITHUB_PATH
104-
pip install -r third_party/requirements.txt
122+
pwd
123+
echo "${{github.workspace}}"
124+
125+
# TODO: move installation of python3-venv to docker
126+
# Latest distros do not allow global pip installation
127+
# - name: Install UR python dependencies in venv
128+
# working-directory: ./unified-runtime
129+
# run: |
130+
# sudo apt update
131+
# sudo apt install -y python3-venv
132+
# python3 -m venv .venv
133+
# . .venv/bin/activate
134+
# echo "${PWD}/.venv/bin" >> $GITHUB_PATH
135+
# pip install -r third_party/requirements.txt
105136

106137
- name: Download DPC++
107138
run: |
108-
wget -O ${{github.workspace}}/dpcpp_compiler.tar.gz https://github.com/intel/llvm/releases/download/nightly-2024-12-12/sycl_linux.tar.gz
109-
mkdir dpcpp_compiler
110-
tar -xvf ${{github.workspace}}/dpcpp_compiler.tar.gz -C dpcpp_compiler
139+
wget -O dpcpp_compiler.tar.gz https://github.com/intel/llvm/releases/download/nightly-2025-03-25/sycl_linux.tar.gz
140+
mkdir -p dpcpp_compiler
141+
tar -xvf dpcpp_compiler.tar.gz -C dpcpp_compiler
142+
143+
# TODO_1: move this installation to docker? Perhaps there's other docker that already has these packages? we aren't the only ones using L0 ;-)
144+
# TODO_2: if needed here, only install it for level zero jobs; and install required staff for other adapters under other 'if'
145+
#
146+
# it seems there's image for intel drivers (L0):
147+
# ghcr.io/intel/llvm/ubuntu2404_intel_drivers:alldeps JESLI ZADZIALA TO BEZ INSTAL
148+
# and for other adapters (HIP, CUDA):
149+
# ghcr.io/intel/llvm/ubuntu2204_build:latest
150+
# or
151+
# ghcr.io/intel/llvm/ubuntu2404_build:latest
152+
# not sure on OpenCL and NativeCPU - to be checked.
153+
# - name: Install Intel Level Zero GPU
154+
# # if: ${{ inputs.adapter_name == 'L0' || inputs.adapter_name == 'L0_V2' }}
155+
# run: |
156+
# wget -qO - https://repositories.intel.com/gpu/intel-graphics.key | \
157+
# sudo gpg --yes --dearmor --output /usr/share/keyrings/intel-graphics.gpg
158+
# echo "deb [arch=amd64,i386 signed-by=/usr/share/keyrings/intel-graphics.gpg] https://repositories.intel.com/gpu/ubuntu jammy unified" | \
159+
# sudo tee /etc/apt/sources.list.d/intel-gpu-jammy.list
160+
# sudo apt-get update
161+
# sudo apt-get install -y libze-intel-gpu1 libze1 libze-dev intel-opencl-icd
162+
# # libstdc++-12-dev
163+
#
164+
165+
# - name: Install OpenCL
166+
# if: ${{ inputs.adapter_name == 'OPENCL' }}
167+
# run: |
168+
# wget -O- https://apt.repos.intel.com/intel-gpg-keys/GPG-PUB-KEY-INTEL-SW-PRODUCTS.PUB \
169+
# | gpg --dearmor | sudo tee /usr/share/keyrings/oneapi-archive-keyring.gpg > /dev/null
170+
# 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
171+
# sudo apt-get update
172+
# sudo apt-get install -y intel-oneapi-runtime-opencl intel-oneapi-base-toolkit
111173

112174
- name: Configure Unified Runtime project
113-
working-directory: ${{github.workspace}}/unified-runtime
114175
# ">" is used to avoid adding "\" at the end of each line; this command is quite long
115176
run: >
116177
cmake
117-
-B${{github.workspace}}/build
178+
-S unified-runtime
179+
-B build
118180
-DCMAKE_C_COMPILER=${{matrix.compiler.c}}
119181
-DCMAKE_CXX_COMPILER=${{matrix.compiler.cxx}}
120182
-DCMAKE_BUILD_TYPE=${{matrix.build_type}}
@@ -126,34 +188,35 @@ jobs:
126188
${{ matrix.adapter.other_name != '' && format('-DUR_BUILD_ADAPTER_{0}=ON', matrix.adapter.other_name) || '' }}
127189
-DUR_STATIC_LOADER=${{matrix.adapter.static_Loader}}
128190
-DUR_STATIC_ADAPTER_${{matrix.adapter.name}}=${{matrix.adapter.static_adapter}}
129-
-DUR_DPCXX=${{github.workspace}}/dpcpp_compiler/bin/clang++
130-
-DUR_SYCL_LIBRARY_DIR=${{github.workspace}}/dpcpp_compiler/lib
131-
-DCMAKE_INSTALL_PREFIX=${{github.workspace}}/install
191+
-DUR_DPCXX=./dpcpp_compiler/bin/clang++
192+
-DUR_SYCL_LIBRARY_DIR=./dpcpp_compiler/lib
193+
-DCMAKE_INSTALL_PREFIX=./install
132194
${{ matrix.adapter.name == 'HIP' && '-DUR_CONFORMANCE_AMD_ARCH=gfx1030' || '' }}
133195
${{ matrix.adapter.name == 'HIP' && '-DUR_HIP_PLATFORM=AMD' || '' }}
134196
135197
- name: Build
136198
# This is so that device binaries can find the sycl runtime library
137-
run: cmake --build ${{github.workspace}}/build -j $(nproc)
199+
run: cmake --build build -j $(nproc)
138200

139201
- name: Install
140202
# This is to check that install command does not fail
141-
run: cmake --install ${{github.workspace}}/build
203+
run: cmake --install build
142204

143-
- name: Test adapter specific
205+
- name: Test adapter specific.
144206
env:
145207
ZE_ENABLE_LOADER_DEBUG_TRACE: 1
146208
ZE_DEBUG: 1
147-
run: ctest -C ${{matrix.build_type}} --test-dir ${{github.workspace}}/build --output-on-failure -L "adapter-specific" -E "memcheck" --timeout 600 -VV
209+
run: ctest -C ${{matrix.build_type}} --test-dir build --output-on-failure -L "adapter-specific" -E "memcheck" --timeout 600
148210
# Don't run adapter specific tests when building multiple adapters
149211
if: ${{ matrix.adapter.other_name == '' }}
150212

151-
- name: Test adapters
213+
- name: Test adapters.
152214
env:
153215
ZE_ENABLE_LOADER_DEBUG_TRACE: 1
154216
ZE_DEBUG: 1
155-
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
217+
UR_SYCL_LIBRARY_DIR: "./dpcpp_compiler/lib"
218+
run: env UR_CTS_ADAPTER_PLATFORM="${{matrix.adapter.platform}}" ctest -C ${{matrix.build_type}} --test-dir build --output-on-failure -L "conformance" --timeout 600
156219

157220
- name: Get information about platform
158221
if: ${{ always() }}
159-
run: ${{github.workspace}}/unified-runtime/.github/scripts/get_system_info.sh
222+
run: ./unified-runtime/.github/scripts/get_system_info.sh

.github/workflows/ur-precommit.yml

Lines changed: 105 additions & 54 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,9 @@ name: Unified Runtime Pre Commit
55

66
# Note: the trigger is copy-pasted from sycl-linux-precommit.yml - probably to be fine-tuned.
77
on:
8+
push:
9+
branches-ignore:
10+
- 'dependabot/**'
811
# We rely on "Fork pull request workflows from outside collaborators" -
912
# "Require approval for all outside collaborators" at
1013
# https://github.com/intel/llvm/settings/actions for security.
@@ -40,75 +43,123 @@ jobs:
4043
name: Detect Changes
4144
uses: ./.github/workflows/sycl-detect-changes.yml
4245

43-
source_checks:
44-
name: Source Checks
45-
needs: [detect_changes]
46-
if: ${{ always() && !cancelled() && contains(needs.detect_changes.outputs.filters, 'ur') }}
47-
uses: ./.github/workflows/ur-source-checks.yml
46+
# source_checks:
47+
# name: Source Checks
48+
# needs: [detect_changes]
49+
# if: ${{ always() && !cancelled() && contains(needs.detect_changes.outputs.filters, 'ur') }}
50+
# uses: ./.github/workflows/ur-source-checks.yml
4851

4952
adapters:
5053
name: Adapters
51-
needs: [detect_changes, source_checks]
52-
if: ${{ always() && !cancelled() && contains(needs.detect_changes.outputs.filters, 'ur') }}
54+
# needs: [detect_changes, source_checks]
55+
# if: ${{ always() && !cancelled() && contains(needs.detect_changes.outputs.filters, 'ur') }}
56+
# needs: [detect_changes, source_checks]
57+
# if: ${{ always() && !cancelled() && contains(needs.detect_changes.outputs.filters, 'ur') }}
5358
strategy:
5459
matrix:
60+
include:
61+
- name: L0
62+
runner: UR_L0
63+
docker_image: "ghcr.io/intel/llvm/ubuntu2404_intel_drivers:alldeps"
64+
image_options: -u 1001 --device=/dev/dri -v /dev/dri/by-path:/dev/dri/by-path --privileged --cap-add SYS_ADMIN
65+
- name: L0_V2
66+
runner: UR_L0
67+
docker_image: "ghcr.io/intel/llvm/ubuntu2404_intel_drivers:alldeps"
68+
image_options: -u 1001 --device=/dev/dri -v /dev/dri/by-path:/dev/dri/by-path --privileged --cap-add SYS_ADMIN
69+
- name: L0
70+
runner: UR_L0
71+
docker_image: "ghcr.io/intel/llvm/ubuntu2404_intel_drivers:alldeps"
72+
image_options: -u 1001 --device=/dev/dri -v /dev/dri/by-path:/dev/dri/by-path --privileged --cap-add SYS_ADMIN
73+
static: ON
74+
- name: L0
75+
runner: UR_L0
76+
docker_image: "ghcr.io/intel/llvm/ubuntu2404_intel_drivers:alldeps"
77+
image_options: -u 1001 --device=/dev/dri -v /dev/dri/by-path:/dev/dri/by-path --privileged --cap-add SYS_ADMIN
78+
other_adapter: NATIVE_CPU
79+
- name: HIP
80+
runner: UR_HIP
81+
docker_image: "ghcr.io/intel/llvm/ubuntu2404_intel_drivers:alldeps"
82+
image_options: -u 1001 --device=/dev/dri --device=/dev/kfd --cap-add=SYS_ADMIN
83+
- name: CUDA
84+
runner: UR_CUDA
85+
docker_image: "ghcr.io/intel/llvm/ubuntu2404_intel_drivers:alldeps"
86+
image_options: -u 1001 --privileged --cap-add SYS_ADMIN --gpus all
87+
- name: OPENCL
88+
runner: UR_OPENCL
89+
platform: "Intel(R) OpenCL"
90+
docker_image: "ghcr.io/intel/llvm/ubuntu2404_intel_drivers:alldeps"
91+
image_options: -u 1001 --device=/dev/dri --device=/dev/kfd --privileged --cap-add SYS_ADMIN
92+
- name: OPENCL
93+
runner: UR_OPENCL
94+
platform: "OPENCL:Intel(R) OpenCL"
95+
docker_image: "ghcr.io/intel/llvm/ubuntu2404_intel_drivers:alldeps"
96+
image_options: -u 1001 --device=/dev/dri --device=/dev/kfd --privileged --cap-add SYS_ADMIN
97+
other_adapter: NATIVE_CPU
98+
- name: NATIVE_CPU
99+
runner: UR_NATIVE_CPU
100+
docker_image: "ghcr.io/intel/llvm/ubuntu2404_intel_drivers:alldeps"
101+
image_options: -u 1001 --device=/dev/dri --privileged --cap-add SYS_ADMIN
102+
55103
# Extra native CPU jobs are here to force the loader to be used.
56104
# 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-
]
105+
# adapter: [
106+
# {name: L0, runner: UR_L0, docker_image: "ghcr.io/intel/llvm/ubuntu2204_build:latest"},
107+
# {name: L0_V2, runner: UR_L0},
108+
# {name: L0, runner: UR_L0, static: ON},
109+
# {name: OPENCL, runner: UR_OPENCL, platform: "Intel(R) OpenCL"},
110+
# {name: CUDA, runner: UR_CUDA},
111+
# {name: HIP, runner: UR_HIP},
112+
# {name: NATIVE_CPU, runner: UR_NATIVE_CPU},
113+
# {name: OPENCL, runner: UR_OPENCL, other_adapter: NATIVE_CPU, platform: "OPENCL:Intel(R) OpenCL"},
114+
# {name: L0, runner: UR_L0, other_adapter: NATIVE_CPU},
115+
# ]
68116
uses: ./.github/workflows/ur-build-hw.yml
69117
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 || '' }}
118+
adapter_name: ${{ matrix.name }}
119+
runner_name: ${{ matrix.runner }}
120+
static_loader: ${{ matrix.static || 'OFF' }}
121+
static_adapter: ${{ matrix.static || 'OFF' }}
122+
platform: ${{ matrix.platform || '' }}
123+
other_adapter_name: ${{ matrix.other_adapter || '' }}
124+
docker_image: ${{ matrix.docker_image }}
125+
image_options: ${{ matrix.image_options || '' }}
76126

77-
macos:
78-
name: MacOS build only
79-
needs: [detect_changes, source_checks]
80-
if: ${{ always() && !cancelled() && contains(needs.detect_changes.outputs.filters, 'ur') }}
81-
strategy:
82-
matrix:
83-
os: ['macos-13']
84-
runs-on: ${{matrix.os}}
127+
# macos:
128+
# name: MacOS build only
129+
# needs: [detect_changes, source_checks]
130+
# if: ${{ always() && !cancelled() && contains(needs.detect_changes.outputs.filters, 'ur') }}
131+
# strategy:
132+
# matrix:
133+
# os: ['macos-13']
134+
# runs-on: ${{matrix.os}}
135+
136+
# steps:
137+
# - name: Checkout LLVM
138+
# uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
85139

86-
steps:
87-
- name: Checkout LLVM
88-
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
89140

90-
- uses: actions/setup-python@6ca8e8598faa206f7140a65ba31b899bebe16f58 # v5.0.0
141+
- uses: actions/setup-python@8d9ed9ac5c53483de85588cdf95a591a75ab9f55 # v5.0.0
91142
with:
92143
python-version: 3.9
93144

94-
- name: Install prerequisites
95-
working-directory: ${{github.workspace}}/unified-runtime
96-
run: python3 -m pip install -r third_party/requirements.txt
145+
# - name: Install prerequisites
146+
# working-directory: ${{github.workspace}}/unified-runtime
147+
# run: python3 -m pip install -r third_party/requirements.txt
97148

98-
- name: Install hwloc
99-
run: brew install hwloc
149+
# - name: Install hwloc
150+
# run: brew install hwloc
100151

101-
- name: Configure Unified Runtime project
102-
working-directory: ${{github.workspace}}/unified-runtime
103-
run: >
104-
cmake
105-
-B${{github.workspace}}/build
106-
-DUR_ENABLE_TRACING=ON
107-
-DUR_DEVELOPER_MODE=ON
108-
-DCMAKE_BUILD_TYPE=Release
109-
-DUR_BUILD_TESTS=ON
110-
-DUR_FORMAT_CPP_STYLE=ON
111-
-DUMF_ENABLE_POOL_TRACKING=ON
152+
# - name: Configure Unified Runtime project
153+
# working-directory: ${{github.workspace}}/unified-runtime
154+
# run: >
155+
# cmake
156+
# -B${{github.workspace}}/build
157+
# -DUR_ENABLE_TRACING=ON
158+
# -DUR_DEVELOPER_MODE=ON
159+
# -DCMAKE_BUILD_TYPE=Release
160+
# -DUR_BUILD_TESTS=ON
161+
# -DUR_FORMAT_CPP_STYLE=ON
162+
# -DUMF_ENABLE_POOL_TRACKING=ON
112163

113-
- name: Build
114-
run: cmake --build ${{github.workspace}}/build -j $(sysctl -n hw.logicalcpu)
164+
# - name: Build
165+
# run: cmake --build ${{github.workspace}}/build -j $(sysctl -n hw.logicalcpu)

0 commit comments

Comments
 (0)