Trying to fix hip and sycl

This commit is contained in:
DarthAffe 2024-12-28 14:40:58 +01:00 committed by GitHub
parent 732ed14e68
commit c0d513fcbf
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -32,8 +32,6 @@ jobs:
defines: '-DGGML_AVX512=ON -DSD_BUILD_SHARED_LIBS=ON' defines: '-DGGML_AVX512=ON -DSD_BUILD_SHARED_LIBS=ON'
- build: 'cuda12' - build: 'cuda12'
defines: '-DSD_CUDA=ON -DSD_BUILD_SHARED_LIBS=ON' defines: '-DSD_CUDA=ON -DSD_BUILD_SHARED_LIBS=ON'
- build: 'rocm5'
defines: '-G Ninja -DCMAKE_C_COMPILER=clang -DCMAKE_CXX_COMPILER=clang++ -DSD_HIPBLAS=ON -DCMAKE_BUILD_TYPE=Release -DAMDGPU_TARGETS="gfx1100;gfx1102;gfx1030" -DSD_BUILD_SHARED_LIBS=ON'
- build: 'vulkan' - build: 'vulkan'
defines: "-DSD_VULKAN=ON -DSD_BUILD_SHARED_LIBS=ON" defines: "-DSD_VULKAN=ON -DSD_BUILD_SHARED_LIBS=ON"
@ -55,20 +53,6 @@ jobs:
method: network method: network
sub-packages: '["nvcc", "cudart", "cublas", "cublas_dev", "thrust", "visual_studio_integration"]' sub-packages: '["nvcc", "cudart", "cublas", "cublas_dev", "thrust", "visual_studio_integration"]'
- name: Install rocm-toolkit
id: rocm-toolkit
if: ${{ matrix.build == 'rocm5' }}
uses: Cyberhan123/rocm-toolkit@v0.1.0
with:
rocm: '5.5.0'
- name: Install Ninja
id: install-ninja
if: ${{ matrix.build == 'rocm5' }}
uses: urkle/action-get-ninja@v1
with:
version: 1.11.1
- name: Install Vulkan SDK - name: Install Vulkan SDK
id: get_vulkan id: get_vulkan
if: ${{ matrix.build == 'vulkan' }} if: ${{ matrix.build == 'vulkan' }}
@ -88,20 +72,11 @@ jobs:
- name: Upload artifact - name: Upload artifact
id: upload_artifact id: upload_artifact
if: ${{ matrix.build != 'rocm5' }}
uses: actions/upload-artifact@v4.3.1 uses: actions/upload-artifact@v4.3.1
with: with:
name: windows-${{ matrix.build }} name: windows-${{ matrix.build }}
path: .\build\bin\Release\stable-diffusion.dll path: .\build\bin\Release\stable-diffusion.dll
- name: Upload artifact Rocm
id: upload_artifact_rocm
if: ${{ matrix.build == 'rocm5' }}
uses: actions/upload-artifact@v4.3.1
with:
name: windows-${{ matrix.build }}
path: .\build\bin\stable-diffusion.dll
windows-2019: windows-2019:
runs-on: windows-2019 runs-on: windows-2019
@ -155,8 +130,9 @@ jobs:
shell: bash shell: bash
env: 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_BASEKIT_URL: https://registrationcenter-download.intel.com/akdlm/IRC_NAS/b380d914-366b-4b77-a74a-05e3c38b3514/intel-oneapi-base-toolkit-2025.0.0.882_offline.exe
WINDOWS_DPCPP_MKL: intel.oneapi.win.cpp-dpcpp-common:intel.oneapi.win.mkl.devel WINDOWS_DPCPP_MKL: intel.oneapi.win.cpp-dpcpp-common:intel.oneapi.win.mkl.devel:intel.oneapi.win.dnnl:intel.oneapi.win.tbb.devel
ONEAPI_ROOT: "C:/Program Files (x86)/Intel/oneAPI"
steps: steps:
- name: Checkout - name: Checkout
@ -192,6 +168,53 @@ jobs:
name: windows-sycl name: windows-sycl
path: .\build\bin\stable-diffusion.dll path: .\build\bin\stable-diffusion.dll
windows-hip:
runs-on: windows-latest
strategy:
matrix:
gpu_target: [gfx1100, gfx1101, gfx1030]
steps:
- name: Install
id: depends
run: |
$ErrorActionPreference = "Stop"
write-host "Downloading AMD HIP SDK Installer"
Invoke-WebRequest -Uri "https://download.amd.com/developer/eula/rocm-hub/AMD-Software-PRO-Edition-24.Q3-WinSvr2022-For-HIP.exe" -OutFile "${env:RUNNER_TEMP}\rocm-install.exe"
write-host "Installing AMD HIP SDK"
Start-Process "${env:RUNNER_TEMP}\rocm-install.exe" -ArgumentList '-install' -NoNewWindow -Wait
write-host "Completed AMD HIP SDK installation"
- name: Verify ROCm
id: verify
run: |
& 'C:\Program Files\AMD\ROCm\*\bin\clang.exe' --version
- name: Checkout
id: checkout
uses: actions/checkout@v4.1.2
with:
repository: 'leejet/stable-diffusion.cpp'
ref: '${{ github.event.inputs.commit }}'
submodules: recursive
- name: Build
id: cmake_build
run: |
$env:HIP_PATH=$(Resolve-Path 'C:\Program Files\AMD\ROCm\*\bin\clang.exe' | split-path | split-path)
$env:CMAKE_PREFIX_PATH="${env:HIP_PATH}"
mkdir build
cd build
cmake -G "Unix Makefiles" --build .. -DCMAKE_C_COMPILER="${env:HIP_PATH}\bin\clang.exe" -DCMAKE_CXX_COMPILER="${env:HIP_PATH}\bin\clang++.exe" -DGGML_HIP=ON -DCMAKE_BUILD_TYPE=Release -DAMDGPU_TARGETS=${{ matrix.gpu_target }} -DGGML_RPC=ON -DSD_BUILD_SHARED_LIBS=ON
cmake --build . --config Release
- name: Upload artifact
id: upload_artifact
uses: actions/upload-artifact@v4.3.1
with:
name: windows-hip
path: .\build\bin\stable-diffusion.dll
linux: linux:
runs-on: ubuntu-latest runs-on: ubuntu-latest
strategy: strategy:
@ -305,7 +328,7 @@ jobs:
run: | run: |
mkdir build mkdir build
cd build cd build
cmake .. -DCMAKE_C_COMPILER=hipcc -DCMAKE_CXX_COMPILER=hipcc -DSD_HIPBLAS=ON -DCMAKE_BUILD_TYPE=Release -DAMDGPU_TARGETS="gfx1100;gfx1102;gfx1030" -DSD_BUILD_SHARED_LIBS=ON cmake .. -DCMAKE_HIP_COMPILER="$(hipconfig -l)/clang" -DGGML_HIP=ON -DSD_BUILD_SHARED_LIBS=ON
cmake --build . --config Release cmake --build . --config Release
- name: Upload artifact Rocm - name: Upload artifact Rocm
@ -359,6 +382,7 @@ jobs:
needs: needs:
- windows - windows
- windows-hip
- windows-sycl - windows-sycl
- linux - linux
- linux-hip - linux-hip