Files
serverAppConfigs/docs/Research/Lemonade and sd.cpp.md
Frank 1e9d921b95 docs: research ComfyUI on ROCm and Vulkan for Strix Halo (gfx1151)
Live-verified on Dankclaw 2026-08-14:
- official rocm/comfyui image is built PYTORCH_ROCM_ARCH=gfx942;gfx950
  (datacenter only) -> torch.cuda.is_available() False on gfx1151
- AMD gfx1151-tagged PyTorch build (rocm/vllm:...gfx1151...pytorch_2.9.1)
  -> avail True, Radeon 8060S, cap (11,5); needs /dev/kfd + /dev/dri
- torch.backends.vulkan is compiled out of standard wheels; no ComfyUI
  --vulkan flag exists; Vulkan is a dead end for ComfyUI
- Lemonade Server does image gen via wrapped stable-diffusion.cpp, whose
  HIP kernels include gfx1151 -> works where ComfyUI's torch cannot

New pages: ComfyUI ROCm and Vulkan, Lemonade and sd.cpp; ComfyUI.md
qualified; compose stays --cpu until a gfx1151-enabled torch image is built
2026-08-13 20:40:47 -07:00

49 lines
2.4 KiB
Markdown

# Lemonade and sd.cpp
Why Lemonade Server can do image generation on Strix Halo when ComfyUI cannot. Research from the Lemonade source repo (`lemonade-sdk/lemonade`, cloned 2026-08-14) and live verification.
## The short answer
Lemonade does not run ComfyUI. Its image-generation backend is a wrapped **stable-diffusion.cpp** (`leejet/stable-diffusion.cpp`) subprocess. sd.cpp is a ggml-family native C++ runtime that ships its own HIP kernels — and those kernels **include gfx1151**. ComfyUI runs on PyTorch, whose standard wheels omit gfx1151. Same hardware, different runtime, different result.
## From the Lemonade source
`src/cpp/server/backends/sdcpp/sdcpp_server.cpp`:
- Image gen is `SDServer`, a `WrappedServer` around a prebuilt sd.cpp binary.
- Downloads `sd-<version>-bin-Linux-Ubuntu-24.04-x86_64-<backend>.zip` from `leejet/stable-diffusion.cpp` releases.
- Backends: `cpu, cuda, metal, rocm, vulkan`.
- ROCm asset is `...-rocm-<version>.zip`; Vulkan is `...-vulkan.zip`.
Backend support matrix (`docs/dev/backends-reference.md`):
| Recipe | Backend | Device families |
|--------|---------|-----------------|
| `sd-cpp` | rocm | amd_gpu (gfx103X, gfx110X, **gfx1150, gfx1151, gfx1152**, gfx120X) |
| `sd-cpp` | vulkan | amd_gpu; cpu; nvidia_gpu |
| `thenoise` | rocm | amd_gpu (gfx1150, gfx1151, gfx1152) — experimental |
**gfx1151 is explicitly supported** by sd.cpp's ROCm build. There is also a dedicated experimental `thenoise` ROCm backend targeting exactly the Strix Halo archs.
## Engine comparison
| | ComfyUI | Lemonade (sd.cpp) |
|---|---|---|
| Runtime | PyTorch | native C++ (ggml family) |
| AMD path | needs PyTorch ROCm wheel with gfx1151 kernels — not in standard wheels | ships own HIP kernels, gfx1151 included |
| On Strix Halo | CPU only (today) | ROCm GPU, or Vulkan fallback |
| Interface | node graph web UI | server, OpenAI-style API, GUI/CLI |
This mirrors llama.cpp on the same box: ggml-family runtimes ship their own gfx1151 HIP kernels and run on ROCm; PyTorch does not.
## Relevance
- If GPU image generation on Dankclaw matters, **Lemonade (or bare sd.cpp) is the working path today**.
- ComfyUI's node graph is the cost of switching: Lemonade is not ComfyUI.
- See [[ComfyUI ROCm and Vulkan]] for the PyTorch-side analysis showing a gfx1151-enabled torch would also make ComfyUI work.
## See Also
- [[ComfyUI ROCm and Vulkan]] — the PyTorch side of this question
- [[ComfyUI]] — current CPU config
- [[Dankclaw Stack]]