Skip to content

Commit 312b836

Browse files
[CI] Add docker containers for Linux GPU jobs
To have access to latest drivers and packages
1 parent 94a369c commit 312b836

3 files changed

Lines changed: 365 additions & 179 deletions

File tree

.github/workflows/reusable_gpu.yml

Lines changed: 19 additions & 179 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,10 @@
11
# This workflow builds and tests providers using GPU memory. It requires properly
22
# labelled self-hosted runners on systems with the correct GPU and drivers.
3+
#
4+
# It starts jobs for both Windows and Linux runners - it's only a thin wrapper for
5+
# the OS-specific workflows. It's better to call them twice here, instead of
6+
# duplicating two workflow calls in the PR/push workflow, for each tested device.
7+
#
38
name: GPU
49

510
on:
@@ -13,10 +18,6 @@ on:
1318
description: Runner name (without 'DSS-' prefix)
1419
type: string
1520
required: true
16-
os:
17-
description: A list of OSes
18-
type: string
19-
default: "['Ubuntu', 'Windows']"
2021
shared_lib:
2122
description: A list of options for building shared library
2223
type: string
@@ -25,181 +26,20 @@ on:
2526
permissions:
2627
contents: read
2728

28-
env:
29-
BUILD_DEBUG_DIR : "${{github.workspace}}/debug/build"
30-
BUILD_RELEASE_DIR : "${{github.workspace}}/release/build"
31-
INSTL_DEBUG_DIR : "${{github.workspace}}/debug/install-dir"
32-
INSTL_RELEASE_DIR : "${{github.workspace}}/release/install-dir"
33-
COVERAGE_DIR : "${{github.workspace}}/coverage"
34-
3529
jobs:
36-
gpu:
37-
env:
38-
VCPKG_PATH: "${{github.workspace}}/vcpkg/packages/hwloc_x64-windows;${{github.workspace}}/vcpkg/packages/tbb_x64-windows;${{github.workspace}}/vcpkg/packages/jemalloc_x64-windows;"
39-
COVERAGE_NAME : "exports-coverage-${{inputs.provider}}-${{inputs.runner}}"
30+
win:
4031
# run only on upstream; forks will not have the HW
4132
if: github.repository == 'oneapi-src/unified-memory-framework'
42-
strategy:
43-
fail-fast: false
44-
matrix:
45-
shared_library: ${{ fromJSON(inputs.shared_lib)}}
46-
os: ${{ fromJSON(inputs.os)}}
47-
name: GPU (${{matrix.os}}, shared=${{matrix.shared_library}})
48-
runs-on: ["DSS-${{inputs.runner}}", "DSS-${{matrix.os}}"]
49-
50-
steps:
51-
# Set various build params based on OS
52-
- name: "[Win] Establish build params"
53-
if : ${{ matrix.os == 'Windows' }}
54-
run: |
55-
echo "C_COMPILER=cl" >> $env:GITHUB_ENV
56-
echo "CXX_COMPILER=cl" >> $env:GITHUB_ENV
57-
echo "PROCS=$Env:NUMBER_OF_PROCESSORS" >> $env:GITHUB_ENV
58-
echo "EXTRA_CMAKE_PATH=$Env:CUDA_PATH" >> $env:GITHUB_ENV
59-
60-
- name: "[Lin] Establish build params"
61-
if : ${{ matrix.os == 'Ubuntu' }}
62-
run: |
63-
echo "C_COMPILER=gcc" >> $GITHUB_ENV
64-
echo "CXX_COMPILER=g++" >> $GITHUB_ENV
65-
echo "PROCS=$(nproc)" >> $GITHUB_ENV
66-
67-
- name: Checkout
68-
uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
69-
with:
70-
fetch-depth: 0
71-
72-
- name: "[Lin] Get information about platform"
73-
if: matrix.os == 'Ubuntu'
74-
run: .github/scripts/get_system_info.sh
75-
76-
- name: "[Win] Restore vcpkg cache"
77-
if: matrix.os == 'Windows'
78-
uses: actions/cache@55cc8345863c7cc4c66a329aec7e433d2d1c52a9 # v6.1.0
79-
id: cache
80-
with:
81-
path: vcpkg_pkgs_cache.zip
82-
key: vcpkg-gpu-${{inputs.runner}}-windows-${{ hashFiles('vcpkg.json') }}
83-
84-
- name: "[Win] Unpack vcpkg cache"
85-
if: matrix.os == 'Windows' && steps.cache.outputs.cache-hit == 'true'
86-
run: |
87-
Expand-Archive -Path ${{github.workspace}}/vcpkg_pkgs_cache.zip -DestinationPath ${{github.workspace}}/vcpkg -Force
88-
89-
- name: "[Win] Initialize vcpkg"
90-
if: matrix.os == 'Windows' && steps.cache.outputs.cache-hit != 'true'
91-
uses: lukka/run-vcpkg@b1a0dd252f06b9e25b3c022a9a03bd7a427fb6a2 # v11.6
92-
with:
93-
vcpkgGitCommitId: ea2a964f9303270322cf3f2d51c265ba146c422d # 1.04.2025
94-
vcpkgDirectory: ${{github.workspace}}/vcpkg
95-
vcpkgJsonGlob: '**/vcpkg.json'
96-
97-
- name: "[Win] Install dependencies"
98-
if: matrix.os == 'Windows' && steps.cache.outputs.cache-hit != 'true'
99-
env:
100-
VCPKG_BINARY_SOURCES: clear
101-
run: vcpkg install --triplet x64-windows
102-
103-
# note: disable all providers except the one being tested
104-
# '-DCMAKE_SUPPRESS_REGENERATION=ON' is the WA for the error: "CUSTOMBUILD : CMake error : Cannot restore timestamp"
105-
- name: Configure build (Debug)
106-
run: >
107-
cmake
108-
-DCMAKE_PREFIX_PATH="${{env.VCPKG_PATH}};${{env.EXTRA_CMAKE_PATH}}"
109-
-B ${{env.BUILD_DEBUG_DIR}}
110-
-DCMAKE_INSTALL_PREFIX="${{env.INSTL_DEBUG_DIR}}"
111-
-DCMAKE_BUILD_TYPE=Debug
112-
-DCMAKE_C_COMPILER=${{env.C_COMPILER}}
113-
-DCMAKE_CXX_COMPILER=${{env.CXX_COMPILER}}
114-
-DUMF_BUILD_SHARED_LIBRARY=${{matrix.shared_library}}
115-
-DUMF_BUILD_BENCHMARKS=ON
116-
-DUMF_BUILD_BENCHMARKS_MT=ON
117-
-DUMF_BUILD_TESTS=ON
118-
-DUMF_BUILD_GPU_TESTS=ON
119-
-DUMF_BUILD_GPU_EXAMPLES=ON
120-
-DUMF_DEVELOPER_MODE=ON
121-
-DUMF_BUILD_LIBUMF_POOL_JEMALLOC=ON
122-
-DUMF_BUILD_CUDA_PROVIDER=OFF
123-
-DUMF_BUILD_LEVEL_ZERO_PROVIDER=OFF
124-
-DUMF_BUILD_${{inputs.provider}}_PROVIDER=ON
125-
-DUMF_TESTS_FAIL_ON_SKIP=ON
126-
${{ matrix.os == 'Ubuntu' && '-DUMF_USE_COVERAGE=ON' || '' }}
127-
${{ matrix.os == 'Windows' && '-DCMAKE_SUPPRESS_REGENERATION=ON' || '' }}
128-
129-
- name: Build UMF (Debug)
130-
run: cmake --build ${{env.BUILD_DEBUG_DIR}} --config Debug -j ${{env.PROCS}}
131-
132-
- name: Run tests (Debug)
133-
working-directory: ${{env.BUILD_DEBUG_DIR}}
134-
run: ctest -C Debug --output-on-failure --test-dir test
135-
136-
- name: Run examples (Debug)
137-
working-directory: ${{env.BUILD_DEBUG_DIR}}
138-
run: ctest --output-on-failure --test-dir examples -C Debug
139-
140-
- name: Configure build (Release)
141-
run: >
142-
cmake
143-
-DCMAKE_PREFIX_PATH="${{env.VCPKG_PATH}};${{env.EXTRA_CMAKE_PATH}}"
144-
-B ${{env.BUILD_RELEASE_DIR}}
145-
-DCMAKE_INSTALL_PREFIX="${{env.INSTL_RELEASE_DIR}}"
146-
-DCMAKE_BUILD_TYPE=Release
147-
-DCMAKE_C_COMPILER=${{env.C_COMPILER}}
148-
-DCMAKE_CXX_COMPILER=${{env.CXX_COMPILER}}
149-
-DUMF_BUILD_SHARED_LIBRARY=${{matrix.shared_library}}
150-
-DUMF_BUILD_BENCHMARKS=ON
151-
-DUMF_BUILD_BENCHMARKS_MT=ON
152-
-DUMF_BUILD_TESTS=ON
153-
-DUMF_BUILD_GPU_TESTS=ON
154-
-DUMF_BUILD_GPU_EXAMPLES=ON
155-
-DUMF_DEVELOPER_MODE=ON
156-
-DUMF_BUILD_LIBUMF_POOL_JEMALLOC=ON
157-
-DUMF_BUILD_CUDA_PROVIDER=OFF
158-
-DUMF_BUILD_LEVEL_ZERO_PROVIDER=OFF
159-
-DUMF_BUILD_${{inputs.provider}}_PROVIDER=ON
160-
-DUMF_TESTS_FAIL_ON_SKIP=ON
161-
${{ matrix.os == 'Windows' && '-DCMAKE_SUPPRESS_REGENERATION=ON' || '' }}
162-
163-
- name: Build UMF (Release)
164-
run: cmake --build ${{env.BUILD_RELEASE_DIR}} --config Release -j ${{env.PROCS}}
165-
166-
- name: Run tests (Release)
167-
working-directory: ${{env.BUILD_RELEASE_DIR}}
168-
run: ctest -C Release --output-on-failure --test-dir test
169-
170-
- name: Run examples (Release)
171-
working-directory: ${{env.BUILD_RELEASE_DIR}}
172-
run: ctest --output-on-failure --test-dir examples -C Release
173-
174-
- name: Run benchmarks (Release)
175-
working-directory: ${{env.BUILD_RELEASE_DIR}}
176-
run: ctest --output-on-failure --test-dir benchmark -C Release --exclude-regex umf-multithreaded
177-
178-
- name: "[Lin] Check coverage (Debug)"
179-
if: ${{ matrix.os == 'Ubuntu' }}
180-
working-directory: ${{env.BUILD_DEBUG_DIR}}
181-
run: |
182-
export COVERAGE_FILE_NAME=${{env.COVERAGE_NAME}}-shared-${{matrix.shared_library}}
183-
echo "COVERAGE_FILE_NAME: $COVERAGE_FILE_NAME"
184-
${{github.workspace}}/scripts/coverage/coverage_capture.sh $COVERAGE_FILE_NAME
185-
mkdir -p ${{env.COVERAGE_DIR}}
186-
mv ./$COVERAGE_FILE_NAME ${{env.COVERAGE_DIR}}
187-
188-
- name: "[Lin] Upload coverage"
189-
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
190-
if: ${{ matrix.os == 'Ubuntu' }}
191-
with:
192-
name: ${{env.COVERAGE_NAME}}-shared-${{matrix.shared_library}}
193-
path: ${{env.COVERAGE_DIR}}
194-
195-
- name: "[Win] Prepare vcpkg cache"
196-
if: matrix.os == 'Windows' && steps.cache.outputs.cache-hit != 'true'
197-
run: |
198-
Compress-Archive -Path ${{github.workspace}}/vcpkg/packages -DestinationPath ${{github.workspace}}/vcpkg_pkgs_cache.zip -Force -CompressionLevel Fastest
199-
200-
- name: "[Win] Save vcpkg cache"
201-
if: matrix.os == 'Windows' && steps.cache.outputs.cache-hit != 'true'
202-
uses: actions/cache/save@55cc8345863c7cc4c66a329aec7e433d2d1c52a9 # v6.1.0
203-
with:
204-
path: ${{github.workspace}}/vcpkg_pkgs_cache.zip
205-
key: ${{ steps.cache.outputs.cache-primary-key }}
33+
uses: ./.github/workflows/reusable_gpu_win.yml
34+
with:
35+
provider: ${{ inputs.provider }}
36+
runner: ${{ inputs.runner }}
37+
shared_lib: ${{ inputs.shared_lib }}
38+
lin:
39+
# run only on upstream; forks will not have the HW
40+
if: github.repository == 'oneapi-src/unified-memory-framework'
41+
uses: ./.github/workflows/reusable_gpu_lin.yml
42+
with:
43+
provider: ${{ inputs.provider }}
44+
runner: ${{ inputs.runner }}
45+
shared_lib: ${{ inputs.shared_lib }}
Lines changed: 178 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,178 @@
1+
# This workflow builds and tests providers using GPU memory. It requires properly
2+
# labelled self-hosted runners on systems with the correct GPU and drivers.
3+
#
4+
# Linux runners, using docker containers.
5+
#
6+
name: "[Lin] GPU"
7+
8+
on:
9+
workflow_call:
10+
inputs:
11+
provider:
12+
description: Provider name
13+
type: string
14+
required: true
15+
runner:
16+
description: Runner name (without 'DSS-' prefix)
17+
type: string
18+
required: true
19+
shared_lib:
20+
description: A list of options for building shared library
21+
type: string
22+
default: "['ON', 'OFF']"
23+
24+
permissions:
25+
contents: read
26+
27+
env:
28+
BUILD_DEBUG_DIR : "${{github.workspace}}/debug/build"
29+
BUILD_RELEASE_DIR : "${{github.workspace}}/release/build"
30+
INSTL_DEBUG_DIR : "${{github.workspace}}/debug/install-dir"
31+
INSTL_RELEASE_DIR : "${{github.workspace}}/release/install-dir"
32+
COVERAGE_DIR : "${{github.workspace}}/coverage"
33+
34+
jobs:
35+
gpu:
36+
env:
37+
COVERAGE_NAME : "exports-coverage-${{inputs.provider}}-${{inputs.runner}}"
38+
strategy:
39+
fail-fast: false
40+
matrix:
41+
shared_library: ${{ fromJSON(inputs.shared_lib)}}
42+
name: GPU (Lin, shared=${{matrix.shared_library}})
43+
runs-on: ["DSS-${{inputs.runner}}", "DSS-Ubuntu"]
44+
container:
45+
image: intel/oneapi:2026.1.0-devel-ubuntu26.04 # intel/oneapi:2025.3.1-0-devel-ubuntu24.04
46+
options: >-
47+
--device=/dev/dri
48+
credentials:
49+
username: urbuildbot
50+
password: ${{ secrets.GH_BB_DOCKER_TOKEN }}
51+
52+
steps:
53+
- name: "Establish build params"
54+
run: |
55+
echo "C_COMPILER=gcc" >> $GITHUB_ENV
56+
echo "CXX_COMPILER=g++" >> $GITHUB_ENV
57+
echo "PROCS=$(nproc)" >> $GITHUB_ENV
58+
59+
- name: Checkout
60+
uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
61+
with:
62+
fetch-depth: 0
63+
64+
# - name: Install drivers
65+
# run: |
66+
# # extra proxy inherited to docker has to be removed
67+
# unset no_proxy
68+
# unset NO_PROXY
69+
70+
# add-apt-repository -y ppa:kobuk-team/intel-graphics
71+
# apt-get update
72+
# apt-get install -y \
73+
# clinfo \
74+
# intel-gsc \
75+
# intel-media-va-driver-non-free \
76+
# intel-metrics-discovery \
77+
# intel-ocloc \
78+
# intel-opencl-icd \
79+
# libmfx-gen1 \
80+
# libva-glx2 \
81+
# libvpl2 \
82+
# libvpl-tools \
83+
# libze1 \
84+
# libze-dev \
85+
# libze-intel-gpu1 \
86+
# software-properties-common \
87+
# va-driver-all \
88+
# vainfo
89+
90+
- name: "Get information about platform"
91+
run: .github/scripts/get_system_info.sh
92+
93+
# note: disable all providers except the one being tested
94+
- name: Configure build (Debug)
95+
run: >
96+
cmake
97+
-DCMAKE_PREFIX_PATH="${{env.VCPKG_PATH}};${{env.EXTRA_CMAKE_PATH}}"
98+
-B ${{env.BUILD_DEBUG_DIR}}
99+
-DCMAKE_INSTALL_PREFIX="${{env.INSTL_DEBUG_DIR}}"
100+
-DCMAKE_BUILD_TYPE=Debug
101+
-DCMAKE_C_COMPILER=${{env.C_COMPILER}}
102+
-DCMAKE_CXX_COMPILER=${{env.CXX_COMPILER}}
103+
-DUMF_BUILD_SHARED_LIBRARY=${{matrix.shared_library}}
104+
-DUMF_BUILD_BENCHMARKS=ON
105+
-DUMF_BUILD_BENCHMARKS_MT=ON
106+
-DUMF_BUILD_TESTS=ON
107+
-DUMF_BUILD_GPU_TESTS=ON
108+
-DUMF_BUILD_GPU_EXAMPLES=ON
109+
-DUMF_DEVELOPER_MODE=ON
110+
-DUMF_BUILD_LIBUMF_POOL_JEMALLOC=ON
111+
-DUMF_BUILD_CUDA_PROVIDER=OFF
112+
-DUMF_BUILD_LEVEL_ZERO_PROVIDER=OFF
113+
-DUMF_BUILD_${{inputs.provider}}_PROVIDER=ON
114+
-DUMF_TESTS_FAIL_ON_SKIP=ON
115+
-DUMF_USE_COVERAGE=ON
116+
117+
- name: Build UMF (Debug)
118+
run: cmake --build ${{env.BUILD_DEBUG_DIR}} --config Debug -j ${{env.PROCS}}
119+
120+
- name: Run tests (Debug)
121+
working-directory: ${{env.BUILD_DEBUG_DIR}}
122+
run: ctest -C Debug --output-on-failure --test-dir test
123+
124+
- name: Run examples (Debug)
125+
working-directory: ${{env.BUILD_DEBUG_DIR}}
126+
run: ctest --output-on-failure --test-dir examples -C Debug
127+
128+
- name: Configure build (Release)
129+
run: >
130+
cmake
131+
-DCMAKE_PREFIX_PATH="${{env.VCPKG_PATH}};${{env.EXTRA_CMAKE_PATH}}"
132+
-B ${{env.BUILD_RELEASE_DIR}}
133+
-DCMAKE_INSTALL_PREFIX="${{env.INSTL_RELEASE_DIR}}"
134+
-DCMAKE_BUILD_TYPE=Release
135+
-DCMAKE_C_COMPILER=${{env.C_COMPILER}}
136+
-DCMAKE_CXX_COMPILER=${{env.CXX_COMPILER}}
137+
-DUMF_BUILD_SHARED_LIBRARY=${{matrix.shared_library}}
138+
-DUMF_BUILD_BENCHMARKS=ON
139+
-DUMF_BUILD_BENCHMARKS_MT=ON
140+
-DUMF_BUILD_TESTS=ON
141+
-DUMF_BUILD_GPU_TESTS=ON
142+
-DUMF_BUILD_GPU_EXAMPLES=ON
143+
-DUMF_DEVELOPER_MODE=ON
144+
-DUMF_BUILD_LIBUMF_POOL_JEMALLOC=ON
145+
-DUMF_BUILD_CUDA_PROVIDER=OFF
146+
-DUMF_BUILD_LEVEL_ZERO_PROVIDER=OFF
147+
-DUMF_BUILD_${{inputs.provider}}_PROVIDER=ON
148+
-DUMF_TESTS_FAIL_ON_SKIP=ON
149+
150+
- name: Build UMF (Release)
151+
run: cmake --build ${{env.BUILD_RELEASE_DIR}} --config Release -j ${{env.PROCS}}
152+
153+
- name: Run tests (Release)
154+
working-directory: ${{env.BUILD_RELEASE_DIR}}
155+
run: ctest -C Release --output-on-failure --test-dir test
156+
157+
- name: Run examples (Release)
158+
working-directory: ${{env.BUILD_RELEASE_DIR}}
159+
run: ctest --output-on-failure --test-dir examples -C Release
160+
161+
- name: Run benchmarks (Release)
162+
working-directory: ${{env.BUILD_RELEASE_DIR}}
163+
run: ctest --output-on-failure --test-dir benchmark -C Release --exclude-regex umf-multithreaded
164+
165+
- name: "Check coverage (Debug)"
166+
working-directory: ${{env.BUILD_DEBUG_DIR}}
167+
run: |
168+
export COVERAGE_FILE_NAME=${{env.COVERAGE_NAME}}-shared-${{matrix.shared_library}}
169+
echo "COVERAGE_FILE_NAME: $COVERAGE_FILE_NAME"
170+
${{github.workspace}}/scripts/coverage/coverage_capture.sh $COVERAGE_FILE_NAME
171+
mkdir -p ${{env.COVERAGE_DIR}}
172+
mv ./$COVERAGE_FILE_NAME ${{env.COVERAGE_DIR}}
173+
174+
- name: "Upload coverage"
175+
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
176+
with:
177+
name: ${{env.COVERAGE_NAME}}-shared-${{matrix.shared_library}}
178+
path: ${{env.COVERAGE_DIR}}

0 commit comments

Comments
 (0)