Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
110 commits
Select commit Hold shift + click to select a range
bbcbe74
implemented stable diffusions regular and specific with margin of lim…
filve Oct 7, 2026
85a45a4
yml
filve Oct 7, 2026
6848c3f
Merge branch 'leejet:master' into fork-pull
filve Oct 7, 2026
bb57a0e
Merge pull request #1 from Filve/fork-pull
filve Oct 7, 2026
7f9985d
documentation
filve Oct 7, 2026
71790b9
readme
filve Oct 7, 2026
e8a5367
Merge pull request #2 from Filve/fork-pull
filve Oct 7, 2026
0d29ccd
istructions
filve Oct 7, 2026
fef7189
test try CPU/GPU
filve Oct 8, 2026
abcf92e
updated readme
filve Oct 8, 2026
c0de2ec
Merge pull request #3 from Filve/master
filve Oct 8, 2026
9a80b04
Merge branch 'leejet:master' into fork-pull
filve Oct 8, 2026
0ed9ca8
Merge pull request #4 from Filve/fork-pull
filve Oct 8, 2026
c6ccf01
fix: lowercase IMAGE_NAME for docker build-push-action tags
Copilot Oct 8, 2026
513662a
updated ggml
filve Oct 8, 2026
ca35a32
fix: restore ggml submodule to 66c1a28 required by rope apply op
filve Oct 8, 2026
3609c71
fix: retry weight file open and log the OS error
claude Oct 11, 2026
86fc897
Merge upstream leejet/stable-diffusion.cpp master into fix_to_claude
claude Oct 11, 2026
c487a4b
ci: grant contents write to the release job
claude Oct 11, 2026
9b4ff13
feat: apply --memory-guard to CPU backends using system RAM
claude Oct 11, 2026
df821e6
ci: build portable packages with GPU backends (Windows CUDA 12 and Vu…
claude Oct 11, 2026
54038f6
feat: log why a GPU backend module could not be used
claude Oct 11, 2026
7ed90da
fix: keep model file handles open between tensor loads
claude Oct 11, 2026
0d84e10
feat: run CPU graphs in segments when weights stream from disk
claude Oct 11, 2026
51845ff
feat: report why a call failed and expose system memory
claude Oct 11, 2026
071a12b
feat: add --profile to choose a resource footprint
claude Oct 11, 2026
ebfe878
fix: give the resolved hires upscaler a default value
claude Oct 11, 2026
6a01873
feat: keep sd-server serving when a request runs out of memory
claude Oct 11, 2026
9aeccdf
fix: include httplib.h before windows.h in the server recovery code
claude Oct 11, 2026
5c51e91
fix: create the portable zip when the output directory is relative
claude Oct 11, 2026
6bb3b8d
fix: load the CUDA driver at run time so the library starts without it
claude Oct 11, 2026
84f0271
Merge pull request #6 from Filve/fix_to_claude
filve Oct 11, 2026
529185d
docs: require Visual C++ Redistributable 14.44 or newer on Windows
claude Oct 12, 2026
cac832a
ci: explain the Windows packages and runtime in the release notes
claude Oct 12, 2026
7000584
docs: point the download and clone instructions at the fork
claude Oct 12, 2026
7b0657d
ci: build and publish the CPU container image
claude Oct 12, 2026
7a84d9e
docs: use the container images of this fork
claude Oct 12, 2026
c6baaf0
Merge pull request #7 from Filve/fix_to_claude
filve Oct 12, 2026
e7bb62b
fix: bound the parallel build in the CPU Dockerfile
claude Oct 12, 2026
37cad36
ci: let the other container images finish when one fails
claude Oct 12, 2026
6167348
Merge pull request #8 from Filve/fix_to_claude
filve Oct 12, 2026
7123a36
Add files via upload
filve Oct 13, 2026
bc5fbed
Update README.md
filve Oct 13, 2026
87fbe03
Merge pull request #9 from Filve/fix_to_claude
filve Oct 13, 2026
a873187
feat: let --auto-fit place modules on several GPUs
claude Oct 13, 2026
e458f87
feat: let --profile auto count the memory of several GPUs
claude Oct 13, 2026
3843767
test: cover the multi-GPU placement without GPUs
claude Oct 13, 2026
7f067f8
docs: describe --multi-gpu in the backend and performance guides
claude Oct 13, 2026
d2ac121
docs: explain how an AI assistant can use the engine as a tool
claude Oct 13, 2026
f85475b
docs: add a guide to running the engine next to other applications
claude Oct 14, 2026
eeec491
feat(server): stop a job that is generating
claude Oct 14, 2026
1ce4084
fix: log a requested cancellation as information, not as an error
claude Oct 14, 2026
12dbf8f
test: cover stopping a generation that is running
claude Oct 14, 2026
cc8f3c3
test: add an end-to-end test for stopping a running job
claude Oct 14, 2026
8b6acc9
fix(server): answer a cancel request without waiting for a body
claude Oct 14, 2026
025124e
test: check that cancel answers a POST without Content-Length at once
claude Oct 14, 2026
c8bb095
docs: explain how to stop a job that is generating
claude Oct 14, 2026
65ccae2
feat(scripts): add thermal diagnostics with an Italian guide
claude Oct 14, 2026
f2a6bd6
test: cover the thermal diagnostics with a fake GPU
claude Oct 14, 2026
f75d4b9
docs: add a guide for independent agents next to the engine
claude Oct 14, 2026
ec15f60
test: run the example guardian of the agents guide
claude Oct 14, 2026
bde4880
docs: link the thermal diagnostics and the agents guide
claude Oct 14, 2026
c2b5c63
Merge pull request #10 from Filve/fix_to_claude
filve Oct 15, 2026
aa6ea2e
fix(model-loader): stop waiting a whole progress tick after the tenso…
claude Oct 15, 2026
71393d0
test: check that a quick tensor load does not wait for a progress tick
claude Oct 15, 2026
3f7be31
fix(auto-fit): prefer the graphics card over an integrated GPU and co…
claude Oct 15, 2026
9b3cfa2
fix(auto-fit): say in the log why auto-fit did not plan
claude Oct 15, 2026
32d3357
test: cover the planner with several backends and an integrated GPU
claude Oct 15, 2026
5e1bf3d
docs: explain how auto-fit treats a card listed by two backends and a…
claude Oct 15, 2026
2ab1ed6
Merge pull request #11 from Filve/fix_to_claude
filve Oct 15, 2026
ac974c0
ci: add a combined Windows CUDA + Vulkan package to the release
claude Oct 15, 2026
a63eb32
test: cover the combined Windows package script
claude Oct 15, 2026
d8801ba
docs: describe the combined Windows CUDA + Vulkan package
claude Oct 15, 2026
bdf5f13
Merge pull request #12 from Filve/fix_to_claude
filve Oct 15, 2026
0355246
fix(auto-fit): warn about a pinned slower listing of a card and about…
claude Oct 17, 2026
a776b8e
test: cover the auto-fit warnings for a shadowed listing and for weig…
claude Oct 17, 2026
f787fe9
docs: la guida per una scheda vista da due backend e per i due avvisi…
claude Oct 17, 2026
1ba601f
Merge pull request #13 from Filve/fix_to_claude
filve Oct 18, 2026
f9597cf
Merge pull request #14 from Filve/master
filve Oct 18, 2026
2e35471
Merge upstream/master (leejet/stable-diffusion.cpp b13a482) into fix_…
claude Oct 18, 2026
b1add56
fix(loader): open model files in the handle pool with UTF-8 paths
claude Oct 18, 2026
3eff467
docs: point the packaged README and the test help texts to --flash-attn
claude Oct 18, 2026
4dbdcb5
Merge pull request #15 from Filve/fix_to_claude
filve Oct 18, 2026
925a242
Merge pull request #16 from Filve/master
filve Nov 4, 2026
df766ab
Merge upstream/master (leejet/stable-diffusion.cpp 58bb3c1) into fork…
claude Nov 5, 2026
9d19fc1
test: adapt the fork's tests to the merged API and cover model load/u…
claude Nov 5, 2026
da85afb
docs: align the Italian guides and the API notes with the merged server
claude Nov 5, 2026
0626112
Merge pull request #17 from Filve/fork-pull
filve Nov 5, 2026
bea9b3b
Merge pull request #18 from Filve/master
filve Nov 5, 2026
6d6e51c
feat(server): keep compute on the GPUs and try other GPUs before the CPU
claude Nov 5, 2026
12e7997
docs: describe lite-hybrid, device failures and the new health fields
claude Nov 5, 2026
10dcd68
Merge upstream/master (leejet/stable-diffusion.cpp 7952693) into fork…
claude Nov 5, 2026
49787af
Merge pull request #20 from Filve/fork-pull
filve Nov 5, 2026
8328cf2
Merge pull request #19 from Filve/fix_to_claude
filve Nov 5, 2026
194a8ca
Merge pull request #21 from filve/master
filve Nov 22, 2026
0cdbfe3
Merge pull request #22 from filve/master
filve Nov 22, 2026
286440e
Merge leejet/stable-diffusion.cpp 46da352 into fork-pull (sync 1/4)
claude Nov 24, 2026
590d867
Merge leejet/stable-diffusion.cpp 01c463a into fork-pull (sync 2/4)
claude Nov 24, 2026
c2f6e84
Merge leejet/stable-diffusion.cpp 532d2c1 into fork-pull (sync 3/4)
claude Nov 24, 2026
25a2fa9
feat(backend): choose how the layer split fills the devices
claude Nov 24, 2026
bfefd6a
Merge leejet/stable-diffusion.cpp 9e7eed7 into fork-pull (sync 4/4, p…
claude Nov 24, 2026
4d1dad5
Merge leejet/stable-diffusion.cpp 3b12781 into fork-pull (sync 4/4, p…
claude Nov 24, 2026
c36f696
Merge leejet/stable-diffusion.cpp 79dc7ca into fork-pull (sync 4/4, p…
claude Nov 24, 2026
9765167
Merge pull request #23 from filve/fork-pull
filve Nov 24, 2026
248eef2
Merge pull request #24 from filve/master
filve Nov 24, 2026
ba38d6d
fix(test): keep agenti_guardiano_test within the server's 100 steps
claude Nov 25, 2026
abbec1a
feat: track device health and halt the server when nothing can run
claude Nov 25, 2026
84cf73f
feat: make the values of device health configurable
claude Nov 25, 2026
1d95e26
Merge leejet/stable-diffusion.cpp 52491bd into fork-pull (sync 5)
claude Nov 25, 2026
f17e5c1
Merge fork-pull (leejet 52491bd, sync 5) into fix_to_claude
claude Nov 25, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 25 additions & 2 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -217,8 +217,9 @@ jobs:
artifact-metadata: write

strategy:
fail-fast: false
matrix:
variant: [musa, sycl, vulkan, cuda]
variant: [cpu, musa, sycl, vulkan, cuda]
platform: [linux/amd64]
runner: [ubuntu-latest]
build-args: [""]
Expand Down Expand Up @@ -261,6 +262,9 @@ jobs:
shell: bash
run: echo "short=${GITHUB_SHA:0:7}" >> "$GITHUB_OUTPUT"

- name: Normalize image name to lowercase
run: echo "IMAGE_NAME=${IMAGE_NAME,,}" >> "$GITHUB_ENV"

- name: Set up Docker Buildx
id: buildx
uses: docker/setup-buildx-action@v4
Expand Down Expand Up @@ -307,7 +311,7 @@ jobs:
context: .
platforms: ${{ matrix.platform }}
push: ${{ ( github.event_name == 'push' && github.ref == 'refs/heads/master' ) || github.event.inputs.create_release == 'true' }}
file: docker/Dockerfile.${{ matrix.variant }}
file: ${{ matrix.variant == 'cpu' && 'docker/Dockerfile' || format('docker/Dockerfile.{0}', matrix.variant) }}
tags: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:${{ env.BRANCH_NAME }}-${{ matrix.variant }}${{ matrix.tag-suffix }}
labels: ${{ steps.meta.outputs.labels }}
annotations: ${{ steps.meta.outputs.annotations }}
Expand Down Expand Up @@ -853,6 +857,9 @@ jobs:
pattern: sd-*
merge-multiple: true

- name: Combine the Windows CUDA and Vulkan packages
run: bash scripts/package_windows_cuda_vulkan.sh ./artifact

- name: Get commit count
id: commit_count
run: |
Expand All @@ -869,12 +876,28 @@ jobs:
uses: actions/github-script@v9
env:
RELEASE_TAG: ${{ format('{0}-{1}-{2}', env.BRANCH_NAME, steps.commit_count.outputs.count, steps.commit.outputs.short) }}
RELEASE_BODY: |
**Windows: quale file scaricare**

| File | Quando sceglierlo |
|---|---|
| `sd-<ramo>-<commit>-bin-win-cuda12-vulkan-x64.zip` | scheda **NVIDIA**, anche insieme a una GPU AMD o integrata: CUDA, le DLL di CUDA e Vulkan sono già nella stessa cartella, in un solo download. Serve il driver NVIDIA aggiornato |
| `sd-<ramo>-<commit>-bin-win-cuda12-x64.zip` + `cudart-sd-bin-win-cu12-x64.zip` | solo schede **NVIDIA**, senza Vulkan. Scompatta **entrambi** nella stessa cartella: il secondo contiene le DLL di CUDA. Serve il driver NVIDIA aggiornato |
| `sd-<ramo>-<commit>-bin-win-vulkan-x64.zip` | schede NVIDIA, AMD e Intel con driver Vulkan |
| `sd-<ramo>-<commit>-bin-win-cpu-x64.zip` | solo CPU |

Non scompattare lo zip Vulkan sopra quello CUDA: quasi tutti i file hanno lo stesso nome ma sono compilati in modo diverso, e ne esce una build mista. Lo zip `cuda12-vulkan` è assemblato da `scripts/package_windows_cuda_vulkan.sh` partendo dagli zip di questa stessa release, e da quello Vulkan prende solo `ggml-vulkan.dll`.

**Requisito su Windows: [Microsoft Visual C++ Redistributable](https://aka.ms/vc14/vc_redist.x64.exe) 2015-2022 (x64), versione 14.44 o successiva.** Se manca o è più vecchio, il programma si chiude subito senza scrivere nulla (codice di uscita `0xC0000135`, cioè `3221225781` oppure `-1073741515` in PowerShell). Controlla la versione con `(Get-Item C:\Windows\System32\msvcp140.dll).VersionInfo.FileVersion`.

Dopo lo scompattamento `.\sd-cli.exe --list-devices` deve elencare una riga `gpu`, non soltanto `CPU`. Guida completa: https://github.com/${{ github.repository }}/blob/master/docs/integrazione_progetti.md#28-problemi-comuni-e-come-leggerli
with:
script: |
const { data: release } = await github.rest.repos.createRelease({
...context.repo,
tag_name: process.env.RELEASE_TAG,
name: process.env.RELEASE_TAG,
body: process.env.RELEASE_BODY,
target_commitish: context.sha,
draft: false,
prerelease: false,
Expand Down
271 changes: 271 additions & 0 deletions .github/workflows/release-portable.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,271 @@
name: Release portable package

# Builds relocatable packages with dynamic ggml backends (see docs/build.md,
# "Build a portable package"). Every package carries the CPU backend plus the
# GPU module listed below. A module whose driver is missing on the user's
# machine is skipped at runtime, so the same zip still runs without a GPU.
#
# linux-x86_64 CPU + Vulkan
# darwin-arm64 CPU + Metal
# windows-x86_64 CPU + Vulkan (NVIDIA, AMD and Intel GPUs)
# windows-x86_64-cuda12 CPU + CUDA 12 (NVIDIA), CUDA runtime DLLs included
#
# Run it by hand from the Actions tab (on any branch) or push a "portable-v*"
# tag, which also attaches the zips to a release.

on:
workflow_dispatch:
inputs:
targets:
description: "Packages to build: 'all' or a comma-separated list of the names above"
type: string
default: all
cuda_architectures:
description: "CUDA architectures of the cuda12 package (a single one, such as 86, builds much faster)"
type: string
default: "61;70;75;80;86;89;90;100;120"
push:
tags:
- "portable-v*"

permissions:
contents: read

jobs:
plan:
runs-on: ubuntu-latest
outputs:
include: ${{ steps.plan.outputs.include }}
steps:
- name: Select the packages
id: plan
shell: bash
env:
TARGETS: ${{ inputs.targets }}
CUDA_ARCHITECTURES: ${{ inputs.cuda_architectures }}
run: |
python3 - <<'PY'
import json
import os
import re
import sys

packages = [
{"name": "linux-x86_64", "os": "ubuntu-latest", "gpu": "vulkan", "variant": "vulkan"},
{"name": "darwin-arm64", "os": "macos-14", "gpu": "metal", "variant": "metal"},
{"name": "windows-x86_64", "os": "windows-2022", "gpu": "vulkan", "variant": "vulkan"},
{"name": "windows-x86_64-cuda12", "os": "windows-2022", "gpu": "cuda", "variant": "cuda12"},
]

wanted = [w.strip() for w in os.environ.get("TARGETS", "").split(",") if w.strip()]
if not wanted or "all" in wanted:
chosen = packages
else:
known = [p["name"] for p in packages]
unknown = [w for w in wanted if w not in known]
if unknown:
sys.exit("unknown package(s): %s (known: %s)" % (", ".join(unknown), ", ".join(known)))
chosen = [p for p in packages if p["name"] in wanted]

# Same default as the workflow_dispatch input; tag pushes have no inputs.
archs = os.environ.get("CUDA_ARCHITECTURES", "").strip() or "61;70;75;80;86;89;90;100;120"
arch = r"[0-9]+[a-z]?(-real|-virtual)?"
if not re.fullmatch("%s(;%s)*" % (arch, arch), archs):
sys.exit("invalid CUDA architectures: " + archs)
for p in chosen:
if p["gpu"] == "cuda":
p["cuda_architectures"] = archs

print(json.dumps(chosen, indent=2))
with open(os.environ["GITHUB_OUTPUT"], "a") as out:
out.write("include=" + json.dumps(chosen) + "\n")
PY

package:
needs: plan
name: ${{ matrix.name }}
strategy:
fail-fast: false
matrix:
include: ${{ fromJSON(needs.plan.outputs.include) }}

runs-on: ${{ matrix.os }}

steps:
- uses: actions/checkout@v4
with:
submodules: recursive

- name: Setup Node
uses: actions/setup-node@v4
with:
node-version: 20

- name: Setup pnpm
uses: pnpm/action-setup@v4
with:
version: 10.15.1

- name: Install dependencies (Linux)
if: runner.os == 'Linux'
run: |
sudo apt-get update
sudo apt-get install -y build-essential ninja-build libvulkan-dev glslc spirv-headers

- name: Install dependencies (macOS)
if: runner.os == 'macOS'
run: brew install ninja

- name: Install the CUDA toolkit (Windows)
id: cuda-toolkit
if: runner.os == 'Windows' && matrix.gpu == 'cuda'
uses: Jimver/cuda-toolkit@v0.2.22
with:
cuda: "12.8.1"
method: "network"
sub-packages: '["nvcc", "cudart", "cublas", "cublas_dev", "thrust", "visual_studio_integration"]'

- name: Install the Vulkan SDK (Windows)
if: runner.os == 'Windows' && matrix.gpu == 'vulkan'
shell: pwsh
env:
VULKAN_VERSION: 1.4.328.1
run: |
$installer = Join-Path $env:RUNNER_TEMP 'VulkanSDK-Installer.exe'
curl.exe -o $installer -L "https://sdk.lunarg.com/sdk/download/${env:VULKAN_VERSION}/windows/vulkansdk-windows-X64-${env:VULKAN_VERSION}.exe"
if ($LASTEXITCODE -ne 0) { exit $LASTEXITCODE }
Start-Process -FilePath $installer -ArgumentList '--accept-licenses', '--default-answer', '--confirm-command', 'install' -Wait
$sdk = "C:\VulkanSDK\${env:VULKAN_VERSION}"
for ($i = 0; $i -lt 60 -and -not ((Test-Path "$sdk\Bin\glslc.exe") -and (Test-Path "$sdk\Lib\vulkan-1.lib")); $i++) { Start-Sleep -Seconds 5 }
if (-not (Test-Path "$sdk\Bin\glslc.exe")) { throw "The Vulkan SDK was not installed in $sdk" }
Add-Content $env:GITHUB_ENV "VULKAN_SDK=$sdk"
Add-Content $env:GITHUB_PATH "$sdk\Bin"

- name: Setup MSVC (Windows)
if: runner.os == 'Windows'
uses: ilammy/msvc-dev-cmd@v1

- name: Configure and build (Windows)
if: runner.os == 'Windows'
shell: pwsh
env:
GPU: ${{ matrix.gpu }}
CUDA_ARCHITECTURES: ${{ matrix.cuda_architectures }}
run: |
$cmakeArgs = @(
'-G', 'Ninja',
'-DCMAKE_BUILD_TYPE=Release',
'-DCMAKE_C_COMPILER=cl.exe',
'-DCMAKE_CXX_COMPILER=cl.exe',
'-DCMAKE_CXX_FLAGS=/bigobj',
'-DGGML_NATIVE=OFF',
'-DSD_BUILD_SHARED_LIBS=ON',
'-DSD_BUILD_SHARED_GGML_LIB=ON',
'-DGGML_BACKEND_DL=ON',
'-DGGML_CPU_ALL_VARIANTS=ON'
)
if ($env:GPU -eq 'vulkan') { $cmakeArgs += '-DSD_VULKAN=ON' }
if ($env:GPU -eq 'cuda') {
$cmakeArgs += '-DSD_CUDA=ON'
$cmakeArgs += "-DCMAKE_CUDA_ARCHITECTURES=$env:CUDA_ARCHITECTURES"
}
cmake -S . -B build @cmakeArgs
if ($LASTEXITCODE -ne 0) { exit $LASTEXITCODE }
cmake --build build
if ($LASTEXITCODE -ne 0) { exit $LASTEXITCODE }

- name: Configure and build (Linux, macOS)
if: runner.os != 'Windows'
shell: bash
env:
GPU: ${{ matrix.gpu }}
run: |
args=(
-G Ninja
-DCMAKE_BUILD_TYPE=Release
-DSD_BUILD_SHARED_LIBS=ON
-DSD_BUILD_SHARED_GGML_LIB=ON
-DBUILD_SHARED_LIBS=ON
-DGGML_BACKEND_DL=ON
)
case "$GPU" in
vulkan) args+=(-DSD_VULKAN=ON) ;;
metal) args+=(-DSD_METAL=ON) ;;
esac
if [ "$RUNNER_OS" = Linux ]; then
# $ORIGIN keeps the shared libraries found after the zip is unpacked elsewhere.
args+=(-DGGML_NATIVE=OFF -DGGML_CPU_ALL_VARIANTS=ON -DCMAKE_BUILD_WITH_INSTALL_RPATH=ON '-DCMAKE_INSTALL_RPATH=$ORIGIN')
fi
cmake -S . -B build "${args[@]}"
cmake --build build

- name: Bundle the CUDA runtime (Windows)
if: runner.os == 'Windows' && matrix.gpu == 'cuda'
shell: pwsh
env:
CUDA_ROOT: ${{ steps.cuda-toolkit.outputs.CUDA_PATH }}
run: |
foreach ($pattern in 'cudart64_*.dll', 'cublas64_*.dll', 'cublasLt64_*.dll') {
$files = @(Get-ChildItem -Path (Join-Path $env:CUDA_ROOT 'bin') -Filter $pattern)
if ($files.Count -eq 0) { throw "CUDA runtime library not found: $pattern in $env:CUDA_ROOT" }
Copy-Item -Path $files.FullName -Destination 'build\bin\'
}

- name: Smoke test
shell: bash
run: |
exe=build/bin/sd-cli
[ -x "$exe" ] || exe="$exe.exe"
status=0
"$exe" --list-devices || status=$?
if [ "$status" -ne 0 ] && [ "$RUNNER_OS" = Windows ]; then
# Git Bash reports a program that cannot start because a DLL is missing as status 127, without a message.
echo "::error::$exe --list-devices exited with status $status"
system32="$(cygpath -u "${SYSTEMROOT:-${SystemRoot:-/c/Windows}}")/System32"
for file in "$exe" build/bin/stable-diffusion.dll build/bin/ggml.dll build/bin/ggml-base.dll; do
echo "::group::DLLs imported by $file"
dumpbin -dependents "$file" | tr -d '\r' | grep -i -E '^ +[^ ]+\.dll$' | while read -r dll; do
case "$dll" in api-ms-win-* | ext-ms-win-*) continue ;; esac
if [ -e "build/bin/$dll" ] || [ -e "$system32/$dll" ]; then echo " $dll"; else echo " $dll <-- NOT FOUND"; fi
done || true
echo "::endgroup::"
done
fi
exit "$status"

- name: Security smoke test
if: runner.os != 'Windows'
shell: bash
run: ./test/security_smoke.sh build/bin/sd-cli

- name: Package
shell: bash
env:
PORTABLE_VARIANT: ${{ matrix.variant }}
PORTABLE_REQUIRE_BACKENDS: ${{ matrix.gpu }}
run: ./scripts/package_portable.sh build dist

- uses: actions/upload-artifact@v4
with:
name: portable-${{ matrix.name }}
path: dist/*.zip
compression-level: 0
if-no-files-found: error

release:
if: startsWith(github.ref, 'refs/tags/')
needs: package
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- uses: actions/download-artifact@v4
with:
pattern: portable-*
path: dist
merge-multiple: true

- name: Attach to the release
uses: softprops/action-gh-release@v2
with:
files: dist/*.zip
24 changes: 23 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,6 +1,28 @@
build*/
cmake-build-*/
test/
dist/
# Fork: the curated robustness suite is tracked; everything else in test/ stays local.
test/*
!test/README.md
!test/security_smoke.sh
!test/api_robustness.cpp
!test/pe_imports_test.cpp
!test/file_handle_pool_test.cpp
!test/model_loader_latency_test.cpp
!test/profile_test.cpp
!test/backend_fit_plan_test.cpp
!test/memory_guard_engine_test.cpp
!test/layer_split_fill_test.cpp
!test/device_health_test.cpp
!test/device_health_option_test.cpp
!test/package_windows_cuda_vulkan_test.sh
!test/server_recovery_test.cpp
!test/server_cancel_e2e.py
!test/server_guardian_test.cpp
!test/server_guardian_e2e.py
!test/termico_test.py
!test/agenti_guardiano_test.py
!test/fuzz_model_loader.py
tests/
/dgl/*
!/dgl/.gitkeep
Expand Down
7 changes: 4 additions & 3 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -395,9 +395,10 @@ if(SD_WEBM)
endif()
if (SD_CUDA)
find_package(CUDAToolkit REQUIRED)
# Keep the driver stub on downstream link lines when no driver is installed.
target_link_libraries(${SD_LIB} PUBLIC CUDA::cuda_driver)
set_property(SOURCE src/core/ggml_extend_backend.cpp APPEND PROPERTY COMPILE_DEFINITIONS SD_USE_CUDA)
# Headers only: the driver is loaded at run time (src/core/cuda_driver.cpp), so that the library
# also starts on a machine without an NVIDIA driver.
target_link_libraries(${SD_LIB} PRIVATE CUDA::toolkit)
set_property(SOURCE src/core/ggml_extend_backend.cpp src/core/cuda_driver.cpp APPEND PROPERTY COMPILE_DEFINITIONS SD_USE_CUDA)
if (NOT SD_USE_UPSTREAM_GGML)
include(cmake/cutlass.cmake)
if (TARGET ggml-cuda)
Expand Down
1 change: 1 addition & 0 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
MIT License

Copyright (c) 2023 leejet
Copyright (c) 2026 filve (modifications in this fork)

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand Down
Loading