Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
41 changes: 40 additions & 1 deletion .github/workflows/sycl-windows-precommit.yml
Original file line number Diff line number Diff line change
Expand Up @@ -52,14 +52,53 @@
build:
needs: [detect_changes]
if: |
success()
!success()
&& github.repository == 'intel/llvm'
uses: ./.github/workflows/sycl-windows-build.yml
with:
changes: ${{ needs.detect_changes.outputs.filters }}
e2e_binaries_artifact: sycl_windows_e2ebin
e2e_binaries_new_offload_model_artifact: sycl_windows_e2ebin_with_new_offload_model

build_blender_deps:
# needs: build
if: |
!cancelled()
# && needs.build.outputs.build_conclusion == 'success'
runs-on: ${{ fromJSON('["Windows","blender"]') }}
name: Build and Test Blender
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
sparse-checkout: |
devops/

- name: Download Toolchain
uses: actions/download-artifact@v7
with:
artifact-ids: 6213524008
repository: intel/llvm
run-id: 23831325486
github-token: ${{ github.token }}
# name: sycl_windows_default

- name: Extract Toolchain
shell: bash
run: |
rm -rf install
mkdir install
tar -xf sycl_windows.tar.gz -C install
rm sycl_windows.tar.gz

- name: Build and test Blender
uses: ./devops/actions/blender
with:
workspace: ${{ github.workspace }}
sycl_dir: ${{ github.workspace }}/install
level_zero_dir: "D:\\github\\level-zero_win-sdk"
ccache_dir: "D:\\github\\_work\\cache\\blender"
blender_classroom_dir: "D:\\github\\classroom-demo"

run_prebuilt_e2e_tests:
needs: build
# Continue if build was successful.
Expand Down
53 changes: 53 additions & 0 deletions devops/actions/blender/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
name: 'Blender with Intel GPU/SYCL'
description: 'Build OIDN, Embree, and Blender with Intel GPU/SYCL support, then run classroom demo'

inputs:
workspace:
description: 'Workspace directory for builds'
required: false
default: '${{ github.workspace }}'
sycl_dir:
description: 'Root directory of SYCL installation '
required: true
level_zero_dir:
description: 'Root directory of Level Zero SDK installation '
required: true
ccache_dir:
description: 'ccache directory'
required: true
blender_classroom_dir:
description: 'Blender classroom demo directory'
required: true

runs:
using: "composite"
steps:
- name: Build OIDN
uses: ./devops/actions/blender/oidn
with:
cmake_install_prefix: ${{ format('{0}/oidn-install', inputs.workspace) }}
c_compiler: ${{ inputs.sycl_dir }}/bin/clang.exe
cxx_compiler: ${{ inputs.sycl_dir }}/bin/clang++.exe

- name: Build Embree
uses: ./devops/actions/blender/embree
with:
cmake_install_prefix: ${{ format('{0}/embree-install', inputs.workspace) }}
c_compiler: ${{ inputs.sycl_dir }}/bin/clang.exe
cxx_compiler: ${{ inputs.sycl_dir }}/bin/clang++.exe

- name: Build Blender
uses: ./devops/actions/blender/blender-build
with:
oidn_dir: ${{ format('{0}/oidn-install', inputs.workspace) }}
embree_dir: ${{ format('{0}/embree-install', inputs.workspace) }}
level_zero_dir: ${{ inputs.level_zero_dir }}
cmake_install_prefix: ${{ format('{0}/blender-install', inputs.workspace) }}
sycl_dir: ${{ inputs.sycl_dir }}
ccache_dir: ${{ inputs.ccache_dir }}

- name: Run Blender Classroom Demo
uses: ./devops/actions/blender/blender-demo
with:
blender_dir: ${{ format('{0}/blender-install', inputs.workspace) }}
blender_classroom_dir: ${{ inputs.blender_classroom_dir }}
105 changes: 105 additions & 0 deletions devops/actions/blender/blender-build/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,105 @@
name: 'Build Blender'
description: 'Clone and build Blender with Intel GPU/SYCL support'

inputs:
oidn_dir:
description: 'OIDN installation directory'
required: true
embree_dir:
description: 'Embree installation directory'
required: true
level_zero_dir:
description: 'Level Zero installation directory'
required: true
sycl_dir:
description: 'SYCL compiler installation directory'
required: true
ccache_dir:
description: 'ccache directory'
required: true
cmake_install_prefix:
description: 'CMAKE_INSTALL_PREFIX for Blender build'
required: false
default: '${{ github.workspace }}/blender-install'

runs:
using: "composite"
steps:
- uses: ilammy/msvc-dev-cmd@0b201ec74fa43914dc39ae48a89fd1d8cb592756
with:
arch: amd64

- name: Setup environment
shell: powershell
if: ${{ runner.os }} == 'Windows'

Check failure

Code scanning / zizmor

unsound conditional expression Error

unsound conditional expression
env:
CCACHE_DIR_INPUT: ${{ inputs.ccache_dir }}
SYCL_DIR_INPUT: ${{ inputs.sycl_dir }}
run: |
echo "SCCACHE_DIR=$env:CCACHE_DIR_INPUT" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append
echo "SCCACHE_MAXSIZE=10G" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append
# Wthout this we get a linking error about not being able to find sycl-devicelib-host.lib
echo "LIB=$env:LIB;$env:SYCL_DIR_INPUT\lib" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append
echo "CMAKE_EXTRA_ARGS=-DWITH_WINDOWS_SCCACHE=ON" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append
Comment on lines +38 to +43

Check failure

Code scanning / zizmor

dangerous use of environment file Error

dangerous use of environment file
Comment on lines +38 to +43

Check failure

Code scanning / zizmor

dangerous use of environment file Error

dangerous use of environment file
Comment on lines +38 to +43

Check failure

Code scanning / zizmor

dangerous use of environment file Error

dangerous use of environment file
Comment on lines +38 to +43

Check failure

Code scanning / zizmor

dangerous use of environment file Error

dangerous use of environment file

- name: Checkout Blender
shell: bash
env:
EMBREE_DIR_INPUT: ${{ inputs.embree_dir }}
OIDN_DIR_INPUT: ${{ inputs.oidn_dir }}
run: |
unzip -q D:\\github\\blender_5_1_0_source.zip -d .
mv blender blender-src
# Work around CMake issue using preinstalled Embree/OIDN.
cp -RT "$EMBREE_DIR_INPUT" "blender-src/lib/windows_x64/embree"
cp -RT "$OIDN_DIR_INPUT" "blender-src/lib/windows_x64/OpenImageDenoise"

# Apply source patches.
patch -p1 -d blender-src -i "${{ github.action_path }}/patches/Fix-build.patch"

- name: Configure Blender
shell: bash
env:
INSTALL_PREFIX_INPUT: ${{ inputs.cmake_install_prefix }}
SYCL_DIR_INPUT: ${{ inputs.sycl_dir }}
OIDN_DIR_INPUT: ${{ inputs.oidn_dir }}
EMBREE_DIR_INPUT: ${{ inputs.embree_dir }}
LEVEL_ZERO_DIR_INPUT: ${{ inputs.level_zero_dir }}
run: |
# Convert all paths to CMake-style (forward slashes)
INSTALL_PREFIX=$(cygpath -m "$INSTALL_PREFIX_INPUT")
SYCL_DIR=$(cygpath -m "$SYCL_DIR_INPUT")
OIDN_DIR=$(cygpath -m "$OIDN_DIR_INPUT")
EMBREE_DIR=$(cygpath -m "$EMBREE_DIR_INPUT")
LEVEL_ZERO_DIR=$(cygpath -m "$LEVEL_ZERO_DIR_INPUT")

# Maybe re-add
# -DEMBREE_SYCL_SUPPORT=ON \
# -DWITH_OPENIMAGEDENOISE=ON \
# -DWITH_CYCLES_DEVICE_HIP=OFF \
# -DWITH_CYCLES_DEVICE_CUDA=OFF \
# -DWITH_CYCLES_DEVICE_OPTIX=OFF

cmake -GNinja -B blender-build -S blender-src \
$CMAKE_EXTRA_ARGS \
-DCMAKE_BUILD_TYPE=Release \
-DCMAKE_INSTALL_PREFIX="$INSTALL_PREFIX" \
-DSYCL_ROOT_DIR="$SYCL_DIR" \
-DWITH_CYCLES_DEVICE_ONEAPI=ON \
-DOPENIMAGEDENOISE_ROOT_DIR="$OIDN_DIR" \
-DEMBREE_ROOT_DIR="$EMBREE_DIR" \
-DLEVEL_ZERO_ROOT_DIR="$LEVEL_ZERO_DIR" \
-DWITH_CYCLES_EMBREE=ON \
-DEMBREE_SYCL_SUPPORT=ON \
-DWITH_OPENIMAGEDENOISE=ON \
-DWITH_CYCLES_DEVICE_HIP=OFF \
-DWITH_CYCLES_DEVICE_CUDA=OFF \
-DWITH_CYCLES_DEVICE_OPTIX=OFF

- name: Build Blender
shell: bash
run: cmake --build blender-build --config Release

- name: Install Blender
shell: bash
run: cmake --install blender-build --config Release
84 changes: 84 additions & 0 deletions devops/actions/blender/blender-build/patches/Fix-build.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,84 @@
diff --git a/intern/cycles/util/atomic.h b/intern/cycles/util/atomic.h
index 1a41f0d9..3d173703 100644
--- a/intern/cycles/util/atomic.h
+++ b/intern/cycles/util/atomic.h
@@ -178,8 +178,7 @@ ccl_device_inline float atomic_add_and_fetch_float(ccl_global float *p, const fl
{
sycl::atomic_ref<float,
sycl::memory_order::relaxed,
- sycl::memory_scope::device,
- sycl::access::address_space::ext_intel_global_device_space>
+ sycl::memory_scope::device>
atomic(*p);
return atomic.fetch_add(x);
}
@@ -190,8 +189,7 @@ ccl_device_inline float atomic_compare_and_swap_float(ccl_global float *source,
{
sycl::atomic_ref<float,
sycl::memory_order::relaxed,
- sycl::memory_scope::device,
- sycl::access::address_space::ext_intel_global_device_space>
+ sycl::memory_scope::device>
atomic(*source);
atomic.compare_exchange_weak(old_val, new_val);
return old_val;
@@ -202,8 +200,7 @@ ccl_device_inline unsigned int atomic_fetch_and_add_uint32(ccl_global unsigned i
{
sycl::atomic_ref<unsigned int,
sycl::memory_order::relaxed,
- sycl::memory_scope::device,
- sycl::access::address_space::ext_intel_global_device_space>
+ sycl::memory_scope::device>
atomic(*p);
return atomic.fetch_add(x);
}
@@ -212,8 +209,7 @@ ccl_device_inline int atomic_fetch_and_add_uint32(ccl_global int *p, const int x
{
sycl::atomic_ref<int,
sycl::memory_order::relaxed,
- sycl::memory_scope::device,
- sycl::access::address_space::ext_intel_global_device_space>
+ sycl::memory_scope::device>
atomic(*p);
return atomic.fetch_add(x);
}
@@ -233,8 +229,7 @@ ccl_device_inline unsigned int atomic_fetch_and_sub_uint32(ccl_global unsigned i
{
sycl::atomic_ref<unsigned int,
sycl::memory_order::relaxed,
- sycl::memory_scope::device,
- sycl::access::address_space::ext_intel_global_device_space>
+ sycl::memory_scope::device>
atomic(*p);
return atomic.fetch_sub(x);
}
@@ -243,8 +238,7 @@ ccl_device_inline int atomic_fetch_and_sub_uint32(ccl_global int *p, const int x
{
sycl::atomic_ref<int,
sycl::memory_order::relaxed,
- sycl::memory_scope::device,
- sycl::access::address_space::ext_intel_global_device_space>
+ sycl::memory_scope::device>
atomic(*p);
return atomic.fetch_sub(x);
}
@@ -274,8 +268,7 @@ ccl_device_inline unsigned int atomic_fetch_and_or_uint32(ccl_global unsigned in
{
sycl::atomic_ref<unsigned int,
sycl::memory_order::relaxed,
- sycl::memory_scope::device,
- sycl::access::address_space::ext_intel_global_device_space>
+ sycl::memory_scope::device>
atomic(*p);
return atomic.fetch_or(x);
}
@@ -284,8 +277,7 @@ ccl_device_inline int atomic_fetch_and_or_uint32(ccl_global int *p, const int x)
{
sycl::atomic_ref<int,
sycl::memory_order::relaxed,
- sycl::memory_scope::device,
- sycl::access::address_space::ext_intel_global_device_space>
+ sycl::memory_scope::device>
atomic(*p);
return atomic.fetch_or(x);
}
25 changes: 25 additions & 0 deletions devops/actions/blender/blender-demo/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
name: 'Run Blender Classroom Demo'
description: 'Download and render the Blender Classroom demo scene with Intel GPU'

inputs:
blender_dir:
description: 'Blender installation directory'
required: true
blender_classroom_dir:
description: 'Blender classroom demo directory'
required: true
runs:
using: "composite"
steps:
- name: Render Classroom Scene
shell: bash
env:
BLENDER_DIR: ${{ inputs.blender_dir }}
CLASSROOM_DIR: ${{ inputs.blender_classroom_dir }}
run: |
if [[ "$OSTYPE" == "msys" || "$OSTYPE" == "win32" ]]; then
BLENDER_EXE="$BLENDER_DIR/blender.exe"
else
BLENDER_EXE="$BLENDER_DIR/blender"
fi
"$BLENDER_EXE" -b -noaudio --debug-cycles --verbose 3 --engine CYCLES "$BLENDER_DIR/classroom.blend" -f 1 -- --cycles-device ONEAPI
59 changes: 59 additions & 0 deletions devops/actions/blender/embree/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
name: 'Build Intel Embree'
description: 'Clone and build Embree for Intel GPU with SYCL support'

inputs:
cmake_install_prefix:
description: 'CMAKE_INSTALL_PREFIX for Embree build'
required: false
default: '${{ github.workspace }}/embree-install'
c_compiler:
description: 'Path to C compiler'
required: true
cxx_compiler:
description: 'Path to C++ compiler'
required: true

runs:
using: "composite"
steps:
- uses: ilammy/msvc-dev-cmd@0b201ec74fa43914dc39ae48a89fd1d8cb592756
with:
arch: amd64

- name: Checkout Embree
uses: ./devops/actions/cached_checkout
with:
repository: 'RenderKit/embree'
ref: 'v4.4.0'
path: 'embree-src'
cache_path: "D:\\\\github\\\\_work\\\\repo_cache\\\\"

- name: Update Embree Submodules
shell: bash
run: |
cd embree-src
git submodule update --init --recursive

- name: Configure Embree
shell: bash
env:
INSTALL_PREFIX_INPUT: ${{ inputs.cmake_install_prefix }}
C_COMPILER_INPUT: ${{ inputs.c_compiler }}
CXX_COMPILER_INPUT: ${{ inputs.cxx_compiler }}
run: |
cmake -GNinja -B embree-build -S embree-src \
-DCMAKE_BUILD_TYPE=Release \
-DCMAKE_INSTALL_PREFIX="$INSTALL_PREFIX_INPUT" \
-DCMAKE_C_COMPILER="$C_COMPILER_INPUT" \
-DCMAKE_CXX_COMPILER="$CXX_COMPILER_INPUT" \
-DEMBREE_SYCL_SUPPORT=ON \
-DEMBREE_ISPC_SUPPORT=OFF \
-DEMBREE_TUTORIALS=OFF

- name: Build Embree
shell: bash
run: cmake --build embree-build --config Release

- name: Install Embree
shell: bash
run: cmake --install embree-build --config Release
Loading
Loading