mirror of
https://github.com/DarthAffe/StableDiffusion.NET.git
synced 2025-12-12 13:28:35 +00:00
Added sycl to build pipeline
This commit is contained in:
parent
c38694fc35
commit
5c31ce725e
73
.github/workflows/backends.yml
vendored
73
.github/workflows/backends.yml
vendored
@ -103,6 +103,51 @@ jobs:
|
||||
name: windows-${{ matrix.build }}
|
||||
path: .\build\bin\stable-diffusion.dll
|
||||
|
||||
windows-sycl:
|
||||
runs-on: windows-latest
|
||||
|
||||
defaults:
|
||||
run:
|
||||
shell: bash
|
||||
|
||||
env:
|
||||
WINDOWS_BASEKIT_URL: https://registrationcenter-download.intel.com/akdlm/IRC_NAS/7dff44ba-e3af-4448-841c-0d616c8da6e7/w_BaseKit_p_2024.1.0.595_offline.exe
|
||||
WINDOWS_DPCPP_MKL: intel.oneapi.win.cpp-dpcpp-common:intel.oneapi.win.mkl.devel
|
||||
|
||||
steps:
|
||||
- name: Checkout
|
||||
id: checkout
|
||||
uses: actions/checkout@v4.1.2
|
||||
with:
|
||||
repository: 'leejet/stable-diffusion.cpp'
|
||||
ref: '${{ github.event.inputs.commit }}'
|
||||
submodules: recursive
|
||||
|
||||
- name: Checkout Install Script
|
||||
id: checkoutInstallScript
|
||||
uses: actions/checkout@v4.1.2
|
||||
with:
|
||||
path: scripts
|
||||
sparse-checkout: |
|
||||
Backends/install-oneapi.bat
|
||||
Backends/win-build-sycl.bat
|
||||
sparse-checkout-cone-mode: false
|
||||
|
||||
- name: Install Sycl tools
|
||||
id: installSyclCompiler
|
||||
run: scripts/Backends/install-oneapi.bat $WINDOWS_BASEKIT_URL $WINDOWS_DPCPP_MKL
|
||||
|
||||
- name: Build
|
||||
id: cmake_build
|
||||
run: scripts/Backends/win-build-sycl.bat
|
||||
|
||||
- name: Upload artifact
|
||||
id: upload_artifact
|
||||
uses: actions/upload-artifact@v4.3.1
|
||||
with:
|
||||
name: windows-sycl
|
||||
path: .\build\bin\stable-diffusion.dll
|
||||
|
||||
linux:
|
||||
runs-on: ubuntu-latest
|
||||
strategy:
|
||||
@ -120,6 +165,8 @@ jobs:
|
||||
defines: '-DSD_CUBLAS=ON -DSD_BUILD_SHARED_LIBS=ON'
|
||||
- build: 'cuda12'
|
||||
defines: '-DSD_CUBLAS=ON -DSD_BUILD_SHARED_LIBS=ON'
|
||||
- build: 'sycl'
|
||||
defines: '-DSD_SYCL=ON -DCMAKE_C_COMPILER=icx -DCMAKE_CXX_COMPILER=icpx -DSD_BUILD_SHARED_LIBS=ON'
|
||||
|
||||
steps:
|
||||
- name: Checkout
|
||||
@ -150,8 +197,32 @@ jobs:
|
||||
use-github-cache: false
|
||||
use-local-cache: false
|
||||
|
||||
- name: Install Sycl tools
|
||||
id: installSyclCompiler
|
||||
if: ${{ matrix.build == 'sycl' }}
|
||||
shell: bash
|
||||
run: |
|
||||
cd /tmp
|
||||
wget https://apt.repos.intel.com/intel-gpg-keys/GPG-PUB-KEY-INTEL-SW-PRODUCTS.PUB
|
||||
sudo apt-key add GPG-PUB-KEY-INTEL-SW-PRODUCTS.PUB
|
||||
rm GPG-PUB-KEY-INTEL-SW-PRODUCTS.PUB
|
||||
sudo add-apt-repository "deb https://apt.repos.intel.com/oneapi all main"
|
||||
sudo apt update
|
||||
sudo apt install intel-oneapi-compiler-dpcpp-cpp intel-oneapi-mkl-devel
|
||||
|
||||
- name: Build
|
||||
id: cmake_build_sycl
|
||||
if: ${{ matrix.build == 'sycl' }}
|
||||
run: |
|
||||
source /opt/intel/oneapi/setvars.sh
|
||||
mkdir build
|
||||
cd build
|
||||
cmake .. ${{ matrix.defines }}
|
||||
cmake --build . --config Release
|
||||
|
||||
- name: Build
|
||||
id: cmake_build
|
||||
if: ${{ matrix.build != 'sycl' }}
|
||||
run: |
|
||||
mkdir build
|
||||
cd build
|
||||
@ -244,6 +315,7 @@ jobs:
|
||||
|
||||
needs:
|
||||
- windows
|
||||
- windows-sycl
|
||||
- linux
|
||||
- linux-hip
|
||||
- osx
|
||||
@ -276,6 +348,7 @@ jobs:
|
||||
nuget pack ./Backends/StableDiffusion.NET.Backend.Cuda12.Linux.nuspec -version ${{ github.event.inputs.version }}
|
||||
nuget pack ./Backends/StableDiffusion.NET.Backend.Cuda.nuspec -version ${{ github.event.inputs.version }}
|
||||
nuget pack ./Backends/StableDiffusion.NET.Backend.Rocm.nuspec -version ${{ github.event.inputs.version }}
|
||||
nuget pack ./Backends/StableDiffusion.NET.Backend.Sycl.nuspec -version ${{ github.event.inputs.version }}
|
||||
|
||||
- name: Upload artifacts
|
||||
id: upload_artifacts
|
||||
|
||||
19
Backends/install-oneapi.bat
Normal file
19
Backends/install-oneapi.bat
Normal file
@ -0,0 +1,19 @@
|
||||
:: MIT license
|
||||
:: Copyright (C) 2024 Intel Corporation
|
||||
:: SPDX-License-Identifier: MIT
|
||||
|
||||
|
||||
set URL=%1
|
||||
set COMPONENTS=%2
|
||||
|
||||
curl.exe --output %TEMP%\webimage.exe --url %URL% --retry 5 --retry-delay 5
|
||||
start /b /wait %TEMP%\webimage.exe -s -x -f webimage_extracted --log extract.log
|
||||
del %TEMP%\webimage.exe
|
||||
if "%COMPONENTS%"=="" (
|
||||
webimage_extracted\bootstrapper.exe -s --action install --eula=accept -p=NEED_VS2017_INTEGRATION=0 -p=NEED_VS2019_INTEGRATION=0 -p=NEED_VS2022_INTEGRATION=0 --log-dir=.
|
||||
) else (
|
||||
webimage_extracted\bootstrapper.exe -s --action install --components=%COMPONENTS% --eula=accept -p=NEED_VS2017_INTEGRATION=0 -p=NEED_VS2019_INTEGRATION=0 -p=NEED_VS2022_INTEGRATION=0 --log-dir=.
|
||||
)
|
||||
set installer_exit_code=%ERRORLEVEL%
|
||||
rd /s/q "webimage_extracted"
|
||||
exit /b %installer_exit_code%
|
||||
24
Backends/win-build-sycl.bat
Normal file
24
Backends/win-build-sycl.bat
Normal file
@ -0,0 +1,24 @@
|
||||
:: MIT license
|
||||
:: Copyright (C) 2024 Intel Corporation
|
||||
:: SPDX-License-Identifier: MIT
|
||||
|
||||
|
||||
IF not exist build (mkdir build)
|
||||
cd build
|
||||
if %errorlevel% neq 0 goto ERROR
|
||||
|
||||
@call "C:\Program Files (x86)\Intel\oneAPI\setvars.bat" intel64 --force
|
||||
if %errorlevel% neq 0 goto ERROR
|
||||
|
||||
cmake -G "Ninja" .. -DGGML_SYCL=ON -DCMAKE_C_COMPILER=cl -DCMAKE_CXX_COMPILER=icx -DSD_BUILD_SHARED_LIBS=ON
|
||||
if %errorlevel% neq 0 goto ERROR
|
||||
|
||||
cmake --build . -j --config Release
|
||||
if %errorlevel% neq 0 goto ERROR
|
||||
|
||||
cd ..
|
||||
exit /B 0
|
||||
|
||||
:ERROR
|
||||
echo comomand error: %errorlevel%
|
||||
exit /B %errorlevel%
|
||||
Loading…
x
Reference in New Issue
Block a user