Skip to content

Commit 04d162e

Browse files
committed
[CI] Add Windows Blender test to nightly
Signed-off-by: Nick Sarnie <nick.sarnie@intel.com>
1 parent 7b46b20 commit 04d162e

7 files changed

Lines changed: 423 additions & 0 deletions

File tree

Lines changed: 84 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,84 @@
1+
name: Build and Test Blender
2+
3+
on:
4+
workflow_call:
5+
inputs:
6+
runner:
7+
type: string
8+
required: True
9+
level_zero_dir:
10+
description: 'Root directory of Level Zero SDK installation'
11+
required: false
12+
type: string
13+
default: ''
14+
ccache_dir:
15+
description: 'ccache directory'
16+
required: true
17+
type: string
18+
blender_classroom_dir:
19+
description: 'Blender classroom demo directory'
20+
required: true
21+
type: string
22+
toolchain_artifact:
23+
description: 'Artifact name for toolchain download'
24+
required: true
25+
type: string
26+
toolchain_artifact_filename:
27+
description: 'Toolchain artifact downloaded filename'
28+
required: true
29+
type: string
30+
31+
jobs:
32+
blender:
33+
runs-on: ${{ fromJSON(inputs.runner) }}
34+
name: Build and Test Blender on ${{ contains(inputs.runner, 'Windows') && 'Windows' || 'Linux' }}
35+
steps:
36+
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
37+
with:
38+
sparse-checkout: |
39+
devops/
40+
41+
- name: Download Toolchain
42+
uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1
43+
with:
44+
name: ${{ inputs.toolchain_artifact }}
45+
46+
- name: Extract Toolchain
47+
shell: bash
48+
env:
49+
TOOLCHAIN_ARTIFACT_FILENAME: ${{ inputs.toolchain_artifact_filename }}
50+
run: |
51+
rm -rf install
52+
mkdir install
53+
tar -xf $TOOLCHAIN_ARTIFACT_FILENAME -C install
54+
rm $TOOLCHAIN_ARTIFACT_FILENAME
55+
56+
- name: Build OIDN
57+
uses: ./devops/actions/blender/oidn
58+
with:
59+
cmake_install_prefix: ${{ github.workspace }}/oidn-install
60+
c_compiler: ${{ github.workspace }}/install/bin/clang${{ runner.os == 'Windows' && '.exe' }}
61+
cxx_compiler: ${{ github.workspace }}/install/bin/clang++${{ runner.os == 'Windows' && '.exe' }}
62+
63+
- name: Build Embree
64+
uses: ./devops/actions/blender/embree
65+
with:
66+
cmake_install_prefix: ${{ github.workspace }}/embree-install
67+
c_compiler: ${{ github.workspace }}/install/bin/clang${{ runner.os == 'Windows' && '.exe' }}
68+
cxx_compiler: ${{ github.workspace }}/install/bin/clang++${{ runner.os == 'Windows' && '.exe' }}
69+
70+
- name: Build Blender
71+
uses: ./devops/actions/blender/blender-build
72+
with:
73+
oidn_dir: ${{ github.workspace }}/oidn-install
74+
embree_dir: ${{ github.workspace }}/embree-install
75+
level_zero_dir: ${{ inputs.level_zero_dir }}
76+
cmake_install_prefix: ${{ github.workspace }}/blender-install
77+
sycl_dir: ${{ github.workspace }}/install
78+
ccache_dir: ${{ inputs.ccache_dir }}
79+
80+
- name: Run Blender Classroom Demo
81+
uses: ./devops/actions/blender/blender-demo
82+
with:
83+
blender_dir: ${{ github.workspace }}/blender-install
84+
blender_classroom_dir: ${{ inputs.blender_classroom_dir }}

.github/workflows/sycl-nightly.yml

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -403,6 +403,20 @@ jobs:
403403
toolchain_artifact_filename: ${{ needs.build-win.outputs.toolchain_artifact_filename }}
404404
binaries_artifact: sycl_cts_bin_win
405405

406+
build_and_test_blender_win:
407+
needs: build-win
408+
if: |
409+
!cancelled()
410+
&& needs.build-win.outputs.build_conclusion == 'success'
411+
uses: ./.github/workflows/sycl-blender-build-and-test.yml
412+
with:
413+
runner: '["Windows","blender"]'
414+
level_zero_dir: "D:\\github\\level-zero_win-sdk"
415+
ccache_dir: "D:\\github\\_work\\cache\\blender"
416+
blender_classroom_dir: "D:\\github\\classroom-demo"
417+
toolchain_artifact: sycl_windows_default
418+
toolchain_artifact_filename: ${{ needs.build-win.outputs.toolchain_artifact_filename }}
419+
406420
# Verification example:
407421
# cosign-windows-amd64.exe verify-blob sycl_linux.tar.gz \
408422
# --bundle sycl_linux.tar.gz.sigstore.json \
Lines changed: 102 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,102 @@
1+
name: 'Build Blender'
2+
description: 'Clone and build Blender with Intel GPU/SYCL support'
3+
4+
inputs:
5+
oidn_dir:
6+
description: 'OIDN installation directory'
7+
required: true
8+
embree_dir:
9+
description: 'Embree installation directory'
10+
required: true
11+
level_zero_dir:
12+
description: 'Level Zero installation directory'
13+
required: true
14+
sycl_dir:
15+
description: 'SYCL compiler installation directory'
16+
required: true
17+
ccache_dir:
18+
description: 'ccache directory'
19+
required: true
20+
cmake_install_prefix:
21+
description: 'CMAKE_INSTALL_PREFIX for Blender build'
22+
required: false
23+
default: '${{ github.workspace }}/blender-install'
24+
25+
runs:
26+
using: "composite"
27+
steps:
28+
- uses: ilammy/msvc-dev-cmd@0b201ec74fa43914dc39ae48a89fd1d8cb592756
29+
with:
30+
arch: amd64
31+
32+
- name: Setup environment
33+
shell: powershell
34+
if: runner.os == 'Windows'
35+
env:
36+
CCACHE_DIR_INPUT: ${{ inputs.ccache_dir }}
37+
SYCL_DIR_INPUT: ${{ inputs.sycl_dir }}
38+
run: |
39+
echo "SCCACHE_DIR=$env:CCACHE_DIR_INPUT" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append
40+
echo "SCCACHE_MAXSIZE=10G" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append
41+
# Wthout this we get a linking error about not being able to find sycl-devicelib-host.lib
42+
echo "LIB=$env:LIB;$env:SYCL_DIR_INPUT\lib" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append
43+
echo "CMAKE_EXTRA_ARGS=-DWITH_WINDOWS_SCCACHE=ON" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append
44+
45+
- name: Checkout Blender
46+
shell: bash
47+
env:
48+
EMBREE_DIR_INPUT: ${{ inputs.embree_dir }}
49+
OIDN_DIR_INPUT: ${{ inputs.oidn_dir }}
50+
SYCL_DIR_INPUT: ${{ inputs.sycl_dir }}
51+
run: |
52+
unzip -q D:\\github\\blender_5_1_0_source.zip -d .
53+
mv blender blender-src
54+
# Work around CMake issue using preinstalled Embree/OIDN.
55+
cp -RT "$EMBREE_DIR_INPUT" "blender-src/lib/windows_x64/embree"
56+
cp -RT "$OIDN_DIR_INPUT" "blender-src/lib/windows_x64/OpenImageDenoise"
57+
58+
# CMake seems to override PATH leading to this file not being found by llvm-spirv.
59+
cp "$(which SPIRV-Tools-shared.dll)" "$SYCL_DIR_INPUT/bin/"
60+
61+
# Apply source patches.
62+
patch -p1 -d blender-src -i "${{ github.action_path }}/patches/Fix-build.patch"
63+
64+
- name: Configure Blender
65+
shell: bash
66+
env:
67+
INSTALL_PREFIX_INPUT: ${{ inputs.cmake_install_prefix }}
68+
SYCL_DIR_INPUT: ${{ inputs.sycl_dir }}
69+
OIDN_DIR_INPUT: ${{ inputs.oidn_dir }}
70+
EMBREE_DIR_INPUT: ${{ inputs.embree_dir }}
71+
LEVEL_ZERO_DIR_INPUT: ${{ inputs.level_zero_dir }}
72+
run: |
73+
# Unify the path style to avoid CMake issues.
74+
INSTALL_PREFIX=$(cygpath -m "$INSTALL_PREFIX_INPUT")
75+
SYCL_DIR=$(cygpath -m "$SYCL_DIR_INPUT")
76+
OIDN_DIR=$(cygpath -m "$OIDN_DIR_INPUT")
77+
EMBREE_DIR=$(cygpath -m "$EMBREE_DIR_INPUT")
78+
LEVEL_ZERO_DIR=$(cygpath -m "$LEVEL_ZERO_DIR_INPUT")
79+
80+
cmake -GNinja -B blender-build -S blender-src \
81+
$CMAKE_EXTRA_ARGS \
82+
-DCMAKE_BUILD_TYPE=Release \
83+
-DCMAKE_INSTALL_PREFIX="$INSTALL_PREFIX" \
84+
-DSYCL_ROOT_DIR="$SYCL_DIR" \
85+
-DWITH_CYCLES_DEVICE_ONEAPI=ON \
86+
-DOPENIMAGEDENOISE_ROOT_DIR="$OIDN_DIR" \
87+
-DEMBREE_ROOT_DIR="$EMBREE_DIR" \
88+
-DLEVEL_ZERO_ROOT_DIR="$LEVEL_ZERO_DIR" \
89+
-DWITH_CYCLES_EMBREE=ON \
90+
-DEMBREE_SYCL_SUPPORT=ON \
91+
-DWITH_OPENIMAGEDENOISE=ON \
92+
-DWITH_CYCLES_DEVICE_HIP=OFF \
93+
-DWITH_CYCLES_DEVICE_CUDA=OFF \
94+
-DWITH_CYCLES_DEVICE_OPTIX=OFF
95+
96+
- name: Build Blender
97+
shell: bash
98+
run: cmake --build blender-build --config Release
99+
100+
- name: Install Blender
101+
shell: bash
102+
run: cmake --install blender-build --config Release
Lines changed: 84 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,84 @@
1+
diff --git a/intern/cycles/util/atomic.h b/intern/cycles/util/atomic.h
2+
index 1a41f0d9..3d173703 100644
3+
--- a/intern/cycles/util/atomic.h
4+
+++ b/intern/cycles/util/atomic.h
5+
@@ -178,8 +178,7 @@ ccl_device_inline float atomic_add_and_fetch_float(ccl_global float *p, const fl
6+
{
7+
sycl::atomic_ref<float,
8+
sycl::memory_order::relaxed,
9+
- sycl::memory_scope::device,
10+
- sycl::access::address_space::ext_intel_global_device_space>
11+
+ sycl::memory_scope::device>
12+
atomic(*p);
13+
return atomic.fetch_add(x);
14+
}
15+
@@ -190,8 +189,7 @@ ccl_device_inline float atomic_compare_and_swap_float(ccl_global float *source,
16+
{
17+
sycl::atomic_ref<float,
18+
sycl::memory_order::relaxed,
19+
- sycl::memory_scope::device,
20+
- sycl::access::address_space::ext_intel_global_device_space>
21+
+ sycl::memory_scope::device>
22+
atomic(*source);
23+
atomic.compare_exchange_weak(old_val, new_val);
24+
return old_val;
25+
@@ -202,8 +200,7 @@ ccl_device_inline unsigned int atomic_fetch_and_add_uint32(ccl_global unsigned i
26+
{
27+
sycl::atomic_ref<unsigned int,
28+
sycl::memory_order::relaxed,
29+
- sycl::memory_scope::device,
30+
- sycl::access::address_space::ext_intel_global_device_space>
31+
+ sycl::memory_scope::device>
32+
atomic(*p);
33+
return atomic.fetch_add(x);
34+
}
35+
@@ -212,8 +209,7 @@ ccl_device_inline int atomic_fetch_and_add_uint32(ccl_global int *p, const int x
36+
{
37+
sycl::atomic_ref<int,
38+
sycl::memory_order::relaxed,
39+
- sycl::memory_scope::device,
40+
- sycl::access::address_space::ext_intel_global_device_space>
41+
+ sycl::memory_scope::device>
42+
atomic(*p);
43+
return atomic.fetch_add(x);
44+
}
45+
@@ -233,8 +229,7 @@ ccl_device_inline unsigned int atomic_fetch_and_sub_uint32(ccl_global unsigned i
46+
{
47+
sycl::atomic_ref<unsigned int,
48+
sycl::memory_order::relaxed,
49+
- sycl::memory_scope::device,
50+
- sycl::access::address_space::ext_intel_global_device_space>
51+
+ sycl::memory_scope::device>
52+
atomic(*p);
53+
return atomic.fetch_sub(x);
54+
}
55+
@@ -243,8 +238,7 @@ ccl_device_inline int atomic_fetch_and_sub_uint32(ccl_global int *p, const int x
56+
{
57+
sycl::atomic_ref<int,
58+
sycl::memory_order::relaxed,
59+
- sycl::memory_scope::device,
60+
- sycl::access::address_space::ext_intel_global_device_space>
61+
+ sycl::memory_scope::device>
62+
atomic(*p);
63+
return atomic.fetch_sub(x);
64+
}
65+
@@ -274,8 +268,7 @@ ccl_device_inline unsigned int atomic_fetch_and_or_uint32(ccl_global unsigned in
66+
{
67+
sycl::atomic_ref<unsigned int,
68+
sycl::memory_order::relaxed,
69+
- sycl::memory_scope::device,
70+
- sycl::access::address_space::ext_intel_global_device_space>
71+
+ sycl::memory_scope::device>
72+
atomic(*p);
73+
return atomic.fetch_or(x);
74+
}
75+
@@ -284,8 +277,7 @@ ccl_device_inline int atomic_fetch_and_or_uint32(ccl_global int *p, const int x)
76+
{
77+
sycl::atomic_ref<int,
78+
sycl::memory_order::relaxed,
79+
- sycl::memory_scope::device,
80+
- sycl::access::address_space::ext_intel_global_device_space>
81+
+ sycl::memory_scope::device>
82+
atomic(*p);
83+
return atomic.fetch_or(x);
84+
}
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
name: 'Run Blender Classroom Demo'
2+
description: 'Download and render the Blender Classroom demo scene with Intel GPU'
3+
4+
inputs:
5+
blender_dir:
6+
description: 'Blender installation directory'
7+
required: true
8+
blender_classroom_dir:
9+
description: 'Blender classroom demo directory'
10+
required: true
11+
runs:
12+
using: "composite"
13+
steps:
14+
- name: Render Classroom Scene
15+
shell: bash
16+
env:
17+
BLENDER_DIR: ${{ inputs.blender_dir }}
18+
CLASSROOM_DIR: ${{ inputs.blender_classroom_dir }}
19+
run: |
20+
BLENDER_EXE="$BLENDER_DIR/blender$([[ "${{ runner.os }}" == "Windows" ]] && echo ".exe")"
21+
"$BLENDER_EXE" -b -noaudio --debug-cycles --verbose 3 --engine CYCLES "$CLASSROOM_DIR/classroom.blend" -f 1 -- --cycles-device ONEAPI
Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
name: 'Build Intel Embree'
2+
description: 'Clone and build Embree for Intel GPU with SYCL support'
3+
4+
inputs:
5+
cmake_install_prefix:
6+
description: 'CMAKE_INSTALL_PREFIX for Embree build'
7+
required: false
8+
default: '${{ github.workspace }}/embree-install'
9+
c_compiler:
10+
description: 'Path to C compiler'
11+
required: true
12+
cxx_compiler:
13+
description: 'Path to C++ compiler'
14+
required: true
15+
16+
runs:
17+
using: "composite"
18+
steps:
19+
- uses: ilammy/msvc-dev-cmd@0b201ec74fa43914dc39ae48a89fd1d8cb592756
20+
with:
21+
arch: amd64
22+
23+
- name: Checkout Embree
24+
uses: ./devops/actions/cached_checkout
25+
with:
26+
repository: 'RenderKit/embree'
27+
ref: 'v4.4.0'
28+
path: 'embree-src'
29+
cache_path: "D:\\\\github\\\\_work\\\\repo_cache\\\\"
30+
31+
- name: Update Embree Submodules
32+
shell: bash
33+
run: |
34+
cd embree-src
35+
git submodule update --init --recursive
36+
37+
- name: Configure Embree
38+
shell: bash
39+
env:
40+
INSTALL_PREFIX_INPUT: ${{ inputs.cmake_install_prefix }}
41+
C_COMPILER_INPUT: ${{ inputs.c_compiler }}
42+
CXX_COMPILER_INPUT: ${{ inputs.cxx_compiler }}
43+
run: |
44+
cmake -GNinja -B embree-build -S embree-src \
45+
-DCMAKE_BUILD_TYPE=Release \
46+
-DCMAKE_INSTALL_PREFIX="$INSTALL_PREFIX_INPUT" \
47+
-DCMAKE_C_COMPILER="$C_COMPILER_INPUT" \
48+
-DCMAKE_CXX_COMPILER="$CXX_COMPILER_INPUT" \
49+
-DEMBREE_SYCL_SUPPORT=ON \
50+
-DEMBREE_ISPC_SUPPORT=OFF \
51+
-DEMBREE_TUTORIALS=OFF
52+
53+
- name: Build Embree
54+
shell: bash
55+
run: cmake --build embree-build --config Release
56+
57+
- name: Install Embree
58+
shell: bash
59+
run: cmake --install embree-build --config Release

0 commit comments

Comments
 (0)