Skip to content

Commit 8018705

Browse files
Phqen1xclaude
andcommitted
ci: match lemonade-sdk/llama.cpp CUDA library bundling
Linux: - Add libcudart.so*, libnvJitLink.so* to bundled runtime libs - Use cp -av (preserves symlinks) instead of cp -v - RPATH step now patches all ELF files via file(1) instead of glob Windows: - Add curand and nvjitlink to CUDA toolkit sub-packages - Copy cudart64, cublas64, cublasLt64, curand64, nvJitLink DLLs from CUDA_PATH\bin before zipping Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
1 parent cb80321 commit 8018705

1 file changed

Lines changed: 17 additions & 8 deletions

File tree

.github/workflows/build.yml

Lines changed: 17 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -160,15 +160,19 @@ jobs:
160160
- name: Bundle CUDA runtime libraries
161161
run: |
162162
cuda_lib=/usr/local/cuda/lib64
163-
cp -v ${cuda_lib}/libcudart.so* build/bin/ 2>/dev/null || true
164-
cp -v ${cuda_lib}/libcublas.so* build/bin/ 2>/dev/null || true
165-
cp -v ${cuda_lib}/libcublasLt.so* build/bin/ 2>/dev/null || true
166-
cp -v ${cuda_lib}/libcurand.so* build/bin/ 2>/dev/null || true
163+
cp -av ${cuda_lib}/libcudart.so* build/bin/
164+
cp -av ${cuda_lib}/libcublas.so* build/bin/
165+
cp -av ${cuda_lib}/libcublasLt.so* build/bin/
166+
cp -av ${cuda_lib}/libcurand.so* build/bin/
167+
cp -av ${cuda_lib}/libnvJitLink.so* build/bin/
167168
168169
- name: Set RPATH for portable distribution
169170
run: |
170-
for f in build/bin/*.so* build/bin/sd; do
171-
[ -f "$f" ] && ! [ -L "$f" ] && patchelf --set-rpath '$ORIGIN' "$f" 2>/dev/null || true
171+
for f in build/bin/*; do
172+
[ -f "$f" ] && ! [ -L "$f" ] || continue
173+
if file "$f" | grep -q 'ELF'; then
174+
patchelf --set-rpath '$ORIGIN' "$f"
175+
fi
172176
done
173177
174178
- name: Get commit hash
@@ -220,7 +224,7 @@ jobs:
220224
with:
221225
cuda: '12.8.0'
222226
method: 'network'
223-
sub-packages: '["nvcc", "cudart", "cublas", "cublas_dev", "thrust", "visual_studio_integration"]'
227+
sub-packages: '["nvcc", "cudart", "cublas", "cublas_dev", "curand", "nvjitlink", "thrust", "visual_studio_integration"]'
224228

225229
- name: ccache
226230
uses: ggml-org/ccache-action@v1.2.16
@@ -256,7 +260,12 @@ jobs:
256260
run: |
257261
Copy-Item ggml/LICENSE .\build\bin\Release\ggml.txt
258262
Copy-Item LICENSE .\build\bin\Release\stable-diffusion.cpp.txt
259-
robocopy "${{ steps.cuda-toolkit.outputs.CUDA_PATH }}\bin" .\build\bin\Release cudart64_*.dll cublas64_*.dll cublasLt64_*.dll; if ($LASTEXITCODE -le 7) { $LASTEXITCODE = 0 }
263+
$cudaBin = Join-Path $env:CUDA_PATH 'bin'
264+
$runtimeDllPatterns = @('cudart64_*.dll', 'cublas64_*.dll', 'cublasLt64_*.dll', 'curand64_*.dll', 'nvJitLink_*.dll')
265+
foreach ($pattern in $runtimeDllPatterns) {
266+
$dll = Get-ChildItem -Path $cudaBin -Filter $pattern | Sort-Object Name -Descending | Select-Object -First 1
267+
if ($dll) { Copy-Item $dll.FullName .\build\bin\Release\ }
268+
}
260269
7z a sd-${{ env.BRANCH_NAME }}-${{ steps.commit.outputs.short }}-windows-cuda-${{ matrix.sm }}-x64.zip .\build\bin\Release\*
261270
262271
- name: Upload artifacts

0 commit comments

Comments
 (0)