Skip to content

Commit d6e6d20

Browse files
committed
test
Signed-off-by: Nick Sarnie <nick.sarnie@intel.com>
1 parent 4cd5ac6 commit d6e6d20

File tree

7 files changed

+412
-1
lines changed

7 files changed

+412
-1
lines changed

.github/workflows/sycl-windows-precommit.yml

Lines changed: 40 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,14 +52,53 @@ jobs:
5252
build:
5353
needs: [detect_changes]
5454
if: |
55-
success()
55+
!success()
5656
&& github.repository == 'intel/llvm'
5757
uses: ./.github/workflows/sycl-windows-build.yml
5858
with:
5959
changes: ${{ needs.detect_changes.outputs.filters }}
6060
e2e_binaries_artifact: sycl_windows_e2ebin
6161
e2e_binaries_new_offload_model_artifact: sycl_windows_e2ebin_with_new_offload_model
6262

63+
build_blender_deps:
64+
# needs: build
65+
if: |
66+
!cancelled()
67+
# && needs.build.outputs.build_conclusion == 'success'
68+
runs-on: ${{ fromJSON('["Windows","blender"]') }}
69+
name: Build and Test Blender
70+
steps:
71+
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
72+
with:
73+
sparse-checkout: |
74+
devops/
75+
76+
- name: Download Toolchain
77+
uses: actions/download-artifact@v7
78+
with:
79+
artifact-ids: 6213524008
80+
repository: intel/llvm
81+
run-id: 23831325486
82+
github-token: ${{ github.token }}
83+
# name: sycl_windows_default
84+
85+
- name: Extract Toolchain
86+
shell: bash
87+
run: |
88+
rm -rf install
89+
mkdir install
90+
tar -xf sycl_windows.tar.gz -C install
91+
rm sycl_windows.tar.gz
92+
93+
- name: Build and test Blender
94+
uses: ./devops/actions/blender
95+
with:
96+
workspace: ${{ github.workspace }}
97+
sycl_dir: ${{ github.workspace }}/install
98+
level_zero_dir: "D:\\github\\level-zero_win-sdk"
99+
ccache_dir: "D:\\github\\_work\\cache\\blender"
100+
blender_classroom_dir: "D:\\github\\classroom-demo"
101+
63102
run_prebuilt_e2e_tests:
64103
needs: build
65104
# Continue if build was successful.

devops/actions/blender/action.yml

Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
name: 'Blender with Intel GPU/SYCL'
2+
description: 'Build OIDN, Embree, and Blender with Intel GPU/SYCL support, then run classroom demo'
3+
4+
inputs:
5+
workspace:
6+
description: 'Workspace directory for builds'
7+
required: false
8+
default: '${{ github.workspace }}'
9+
sycl_dir:
10+
description: 'Root directory of SYCL installation '
11+
required: true
12+
level_zero_dir:
13+
description: 'Root directory of Level Zero SDK installation '
14+
required: true
15+
ccache_dir:
16+
description: 'ccache directory'
17+
required: true
18+
blender_classroom_dir:
19+
description: 'Blender classroom demo directory'
20+
required: true
21+
22+
runs:
23+
using: "composite"
24+
steps:
25+
- name: Build OIDN
26+
uses: ./devops/actions/blender/oidn
27+
with:
28+
cmake_install_prefix: ${{ format('{0}/oidn-install', inputs.workspace) }}
29+
c_compiler: ${{ inputs.sycl_dir }}/bin/clang.exe
30+
cxx_compiler: ${{ inputs.sycl_dir }}/bin/clang++.exe
31+
32+
- name: Build Embree
33+
uses: ./devops/actions/blender/embree
34+
with:
35+
cmake_install_prefix: ${{ format('{0}/embree-install', inputs.workspace) }}
36+
c_compiler: ${{ inputs.sycl_dir }}/bin/clang.exe
37+
cxx_compiler: ${{ inputs.sycl_dir }}/bin/clang++.exe
38+
39+
- name: Build Blender
40+
uses: ./devops/actions/blender/blender-build
41+
with:
42+
oidn_dir: ${{ format('{0}/oidn-install', inputs.workspace) }}
43+
embree_dir: ${{ format('{0}/embree-install', inputs.workspace) }}
44+
level_zero_dir: ${{ inputs.level_zero_dir }}
45+
cmake_install_prefix: ${{ format('{0}/blender-install', inputs.workspace) }}
46+
sycl_dir: ${{ inputs.sycl_dir }}
47+
ccache_dir: ${{ inputs.ccache_dir }}
48+
49+
- name: Run Blender Classroom Demo
50+
uses: ./devops/actions/blender/blender-demo
51+
with:
52+
blender_dir: ${{ format('{0}/blender-install', inputs.workspace) }}
53+
blender_classroom_dir: ${{ inputs.blender_classroom_dir }}
Lines changed: 93 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,93 @@
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+
run: |
36+
echo "SCCACHE_DIR=${{ inputs.ccache_dir }}" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append
37+
echo "SCCACHE_MAXSIZE=10G" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append
38+
# Wthout this we get a linking error about not being able to find sycl-devicelib-host.lib
39+
echo "LIB=$env:LIB;${{ inputs.sycl_dir }}\lib" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append
40+
echo "CMAKE_EXTRA_ARGS=-DWITH_WINDOWS_SCCACHE=ON" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append
41+
42+
- name: Checkout Blender
43+
shell: bash
44+
run: |
45+
unzip -q D:\\github\\blender_5_1_0_source.zip -d .
46+
mv blender blender-src
47+
# Work around CMake issue using preinstalled Embree/OIDN.
48+
cp -RT "${{ inputs.embree_dir }}" "blender-src/lib/windows_x64/embree"
49+
cp -RT "${{ inputs.oidn_dir }}" "blender-src/lib/windows_x64/OpenImageDenoise"
50+
51+
# Apply source patches.
52+
patch -p1 -d blender-src -i "${{ github.action_path }}/patches/Fix-build.patch"
53+
54+
- name: Configure Blender
55+
shell: bash
56+
run: |
57+
# Convert all paths to CMake-style (forward slashes)
58+
INSTALL_PREFIX=$(cygpath -m "${{ inputs.cmake_install_prefix }}")
59+
SYCL_DIR=$(cygpath -m "${{ inputs.sycl_dir }}")
60+
OIDN_DIR=$(cygpath -m "${{ inputs.oidn_dir }}")
61+
EMBREE_DIR=$(cygpath -m "${{ inputs.embree_dir }}")
62+
LEVEL_ZERO_DIR=$(cygpath -m "${{ inputs.level_zero_dir }}")
63+
64+
# Maybe re-add
65+
# -DEMBREE_SYCL_SUPPORT=ON \
66+
# -DWITH_OPENIMAGEDENOISE=ON \
67+
# -DWITH_CYCLES_DEVICE_HIP=OFF \
68+
# -DWITH_CYCLES_DEVICE_CUDA=OFF \
69+
# -DWITH_CYCLES_DEVICE_OPTIX=OFF
70+
71+
cmake -GNinja -B blender-build -S blender-src \
72+
$CMAKE_EXTRA_ARGS \
73+
-DCMAKE_BUILD_TYPE=Release \
74+
-DCMAKE_INSTALL_PREFIX="$INSTALL_PREFIX" \
75+
-DSYCL_ROOT_DIR="$SYCL_DIR" \
76+
-DWITH_CYCLES_DEVICE_ONEAPI=ON \
77+
-DOPENIMAGEDENOISE_ROOT_DIR="$OIDN_DIR" \
78+
-DEMBREE_ROOT_DIR="$EMBREE_DIR" \
79+
-DLEVEL_ZERO_ROOT_DIR="$LEVEL_ZERO_DIR" \
80+
-DWITH_CYCLES_EMBREE=ON \
81+
-DEMBREE_SYCL_SUPPORT=ON \
82+
-DWITH_OPENIMAGEDENOISE=ON \
83+
-DWITH_CYCLES_DEVICE_HIP=OFF \
84+
-DWITH_CYCLES_DEVICE_CUDA=OFF \
85+
-DWITH_CYCLES_DEVICE_OPTIX=OFF
86+
87+
- name: Build Blender
88+
shell: bash
89+
run: cmake --build blender-build --config Release
90+
91+
- name: Install Blender
92+
shell: bash
93+
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: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
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: powershell
16+
run: |
17+
$psi = New-Object System.Diagnostics.ProcessStartInfo
18+
$psi.FileName = "${{ inputs.blender_dir }}\blender.exe"
19+
$psi.Arguments = '-b -noaudio --debug-cycles --verbose 3 --engine CYCLES "${{ inputs.blender_classroom_dir }}\classroom.blend" -f 1 -- --cycles-device ONEAPI'
20+
$psi.UseShellExecute = $false
21+
$psi.EnvironmentVariables.Clear()
22+
foreach($envVar in [System.Environment]::GetEnvironmentVariables([System.EnvironmentVariableTarget]::Machine).GetEnumerator()) {
23+
$psi.EnvironmentVariables[$envVar.Key] = $envVar.Value
24+
}
25+
foreach($envVar in [System.Environment]::GetEnvironmentVariables([System.EnvironmentVariableTarget]::User).GetEnumerator()) {
26+
$psi.EnvironmentVariables[$envVar.Key] = $envVar.Value
27+
}
28+
$process = New-Object System.Diagnostics.Process
29+
$process.StartInfo = $psi
30+
$process.Start() | Out-Null
31+
$process.WaitForExit()
32+
exit $process.ExitCode
Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
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+
run: |
40+
cmake -GNinja -B embree-build -S embree-src \
41+
-DCMAKE_BUILD_TYPE=Release \
42+
-DCMAKE_INSTALL_PREFIX="${{ inputs.cmake_install_prefix }}" \
43+
-DCMAKE_C_COMPILER="${{ inputs.c_compiler }}" \
44+
-DCMAKE_CXX_COMPILER="${{ inputs.cxx_compiler }}" \
45+
-DEMBREE_SYCL_SUPPORT=ON \
46+
-DEMBREE_ISPC_SUPPORT=OFF \
47+
-DEMBREE_TUTORIALS=OFF
48+
49+
- name: Build Embree
50+
shell: bash
51+
run: cmake --build embree-build --config Release
52+
53+
- name: Install Embree
54+
shell: bash
55+
run: cmake --install embree-build --config Release

0 commit comments

Comments
 (0)