From df4efd59c6b08c49dfbf22cb64ab1bcb6fbf6cf7 Mon Sep 17 00:00:00 2001 From: Drew VanDine Date: Thu, 4 Jun 2026 16:19:40 -0400 Subject: [PATCH] ci: bundle libggml-cuda.so/ggml-cuda.dll in CUDA release artifacts The ggml CUDA backend is built as a shared library plugin when SD_BUILD_SHARED_LIBS=ON. Bundle it alongside the CUDA runtime libs so that CUDA inference works out of the box without the plugin being missing at runtime. Co-Authored-By: Claude Sonnet 4.6 --- .github/workflows/build.yml | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index fccb398ec..522cf1cf2 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -166,6 +166,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/ \; - name: Set RPATH for portable distribution run: | @@ -275,6 +278,12 @@ 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 | + Where-Object { $_.FullName -notlike '*\bin\Release\*' } | + Select-Object -First 1 + if ($ggmlCuda) { Copy-Item $ggmlCuda.FullName .\build\bin\Release\ } 7z a sd-${{ env.BRANCH_NAME }}-${{ steps.commit.outputs.short }}-windows-cuda-${{ matrix.sm }}-x64.zip .\build\bin\Release\* - name: Upload artifacts