mirror of
https://github.com/lemonade-sdk/stable-diffusion.cpp.git
synced 2026-11-22 00:55:10 -10:00
ci: fix CUDA compilation and bundle all ggml shared libs
Add -DGGML_CUDA=ON and -DCMAKE_CUDA_COMPILER explicitly to the Linux CUDA cmake invocation so CUDA is actually compiled instead of silently falling back to CPU when auto-detection fails. Widen the ggml artifact collection from libggml-cuda.so only to libggml*.so* (Linux) and ggml*.dll (Windows) to capture all ggml shared libraries (core, base backend, cuda backend) regardless of where cmake places them in the build tree. Co-Authored-By: Claude Sonnet 4.6 <[email protected]>
This commit is contained in:
1 parent
df4efd59c6
commit
6a68a98599
1 file changed
+9
-8
@@ -152,7 +152,9 @@ jobs:
|
||||
cmake_arch="${cmake_arch#sm_}"
|
||||
cmake -B build -S . \
|
||||
-DSD_CUBLAS=ON \
|
||||
-DGGML_CUDA=ON \
|
||||
-DCMAKE_CUDA_ARCHITECTURES="${cmake_arch}" \
|
||||
-DCMAKE_CUDA_COMPILER=/usr/local/cuda/bin/nvcc \
|
||||
-DGGML_NATIVE=OFF \
|
||||
-DSD_BUILD_SHARED_LIBS=ON \
|
||||
-DCMAKE_BUILD_TYPE=Release
|
||||
@@ -166,9 +168,9 @@ jobs:
|
||||
cp -av ${cuda_lib}/libcublasLt.so* build/bin/
|
||||
cp -av ${cuda_lib}/libcurand.so* build/bin/
|
||||
cp -av ${cuda_lib}/libnvJitLink.so* build/bin/
|
||||
# ggml-cuda is a build artifact (backend plugin); copy it into bin/ if
|
||||
# cmake placed it outside build/bin/ (e.g. build/ggml/src/)
|
||||
find build -name 'libggml-cuda.so*' ! -path 'build/bin/*' -exec cp -av {} build/bin/ \;
|
||||
# Copy all ggml shared libs (libggml.so, libggml-base.so, libggml-cuda.so, etc.)
|
||||
# from wherever cmake placed them outside build/bin/ into the distribution dir.
|
||||
find build -name 'libggml*.so*' ! -path 'build/bin/*' -exec cp -av {} build/bin/ \;
|
||||
|
||||
- name: Set RPATH for portable distribution
|
||||
run: |
|
||||
@@ -278,12 +280,11 @@ jobs:
|
||||
if (-not $dll) { throw "Required CUDA runtime DLL matching '$pattern' was not found in $cudaBin" }
|
||||
Copy-Item $dll.FullName .\build\bin\Release
|
||||
}
|
||||
# ggml-cuda.dll is a build artifact (backend plugin); copy into Release/
|
||||
# if cmake placed it outside build\bin\Release\ (e.g. build\ggml\src\Release\)
|
||||
$ggmlCuda = Get-ChildItem -Path build -Filter 'ggml-cuda.dll' -Recurse |
|
||||
# Copy all ggml DLLs (ggml.dll, ggml-base.dll, ggml-cuda.dll, etc.)
|
||||
# from wherever cmake placed them outside build\bin\Release\ into the distribution dir.
|
||||
Get-ChildItem -Path build -Filter 'ggml*.dll' -Recurse |
|
||||
Where-Object { $_.FullName -notlike '*\bin\Release\*' } |
|
||||
Select-Object -First 1
|
||||
if ($ggmlCuda) { Copy-Item $ggmlCuda.FullName .\build\bin\Release\ }
|
||||
ForEach-Object { Copy-Item $_.FullName .\build\bin\Release\ -Force }
|
||||
7z a sd-${{ env.BRANCH_NAME }}-${{ steps.commit.outputs.short }}-windows-cuda-${{ matrix.sm }}-x64.zip .\build\bin\Release\*
|
||||
|
||||
- name: Upload artifacts
|
||||
|
||||
Reference in new issue
Block a user