v0.2.1
stable-diffusion-go v0.2.1 — pure-Go binding + prebuilt native libraries.
Built from leejet/stable-diffusion.cpp @ 19bdfe2 (upstream pin: master-685-19bdfe2).
go get github.com/Pendra-Cloud/stable-diffusion-go@v0.2.1 for the
binding; the lib archives attached here match this exact tag. Each archive
contains a self-contained libstable-diffusion (ggml statically linked,
hidden visibility — exports only the sd_* symbols pkg/sd/load.go registers).
CUDA archives require a matching host CUDA runtime; Vulkan archives require
a Vulkan loader/ICD on the host. The Windows archive carries the per-CPU/GPU
(avx2/avx512/avx/noavx/vulkan/cuda12) subdir tree the binding selects from.
Problem
The v0.2.0 CUDA libstable-diffusion.so carries a hard libnccl.so.2
NEEDED dependency (v0.1.15 did not). On a clean CUDA host without the
separate libnccl2 package installed, the library fails to dlopen — so a
downstream consumer's CUDA image backend can't load at all. Reproduced on an
RTX A4000 / CUDA 13 box: the lib only loaded after apt install libnccl2.
Root cause
ggml's GGML_CUDA_NCCL option defaults ON (ggml/CMakeLists.txt). The
build runs in nvidia/cuda:13.0.0-devel, which ships NCCL, so cmake's
find_package(NCCL) succeeds and links it into ggml-cuda. Because ggml is
statically linked into libstable-diffusion.so (SD_BUILD_SHARED_GGML_LIB=OFF),
that propagates as a NEEDED libnccl.so.2 entry.
NCCL is multi-GPU collective communication only (all-reduce across GPUs).
Single-GPU / single-context image (and video) generation never invokes it, so
it is safe to drop — and dropping it is better than bundling a ~100 MB lib.
Change
- Pass
-DGGML_CUDA_NCCL=OFFon the Linux CUDA and Windowscuda12
build legs. - Add a fail-closed
readelfguard on the Linux CUDA job asserting the
built lib has nolibncclNEEDEDentry, so this can't silently
regress if an upstream default flips.
The remaining NEEDED CUDA deps (libcudart/libcublas/libcuda) are the
expected "matching host CUDA runtime" the release notes already require.
Verification
gofmt/go vet/go build/go test ./...all clean (Go untouched;
exported symbol set unchanged, socheck-symbols.shis unaffected).- The new
readelfguard verifies the rebuilt CUDA lib in CI. - Confirmed the current v0.2.0 CUDA lib references
libnccl.so.2; the cmake
conditional meansGGML_CUDA_NCCL=OFFremoves that link path.
Patch-level fix → cuts the next patch release; the Pendra worker will then
re-pin to it.
What's Changed
- ci: add PR Agent review workflow backed by Pendra inference by @tomcrawf90 in #21
- fix(cuda): build without NCCL so the CUDA lib loads without libnccl2 by @tomcrawf90 in #20
Full Changelog: v0.2.0...v0.2.1