Repository navigation
Description
Summary
With an SD_RPC=ON build, sd-cli --rpc-servers host:port --list-devices lists only the local
devices. The RPC server is never contacted, and no RPC0 appears. RPC itself works fine:
generation registers the server, and --backend te=RPC0 places work on it. But
--list-devices is the documented way to find the names --backend accepts, so this makes
RPC look broken. We concluded exactly that at first, and nearly patched in a second,
redundant registration.
Steps to reproduce
Worker (llama.cpp 47f5a64 from ggml/scripts/sync-llama.last, built with
-DGGML_RPC=ON -DGGML_HIP=ON -DCMAKE_{C,CXX}_FLAGS=-DGGML_MAX_NAME=160):
ggml-rpc-server -H 10.0.0.2 -p 50053 -d ROCm0Client (stable-diffusion.cpp b13a482, built with -DSD_HIPBLAS=ON -DSD_RPC=ON):
$ sd-cli --rpc-servers 10.0.0.2:50053 --list-devices
ROCm0 AMD Radeon 8060S Graphics
CPU AMD RYZEN AI MAX+ 395 w/ Radeon 8060SExpected: an additional line such as RPC0 10.0.0.2:50053. The commented-out "Step B" in
docs/rpc.md shows this, and it is the output you'd want here.
Meanwhile, generation with the same build does use the remote device:
$ sd-cli --rpc-servers 10.0.0.2:50053 --backend all=ROCm0,te=RPC0 \
--diffusion-model flux2-dev-BF16.gguf --llm Mistral-Small-3.2-24B-Instruct-2506-BF16.gguf \
--vae flux2-vae.safetensors -p "a red cube" --steps 1 -W 256 -H 256 -v
[I] Adding RPC server: 10.0.0.2:50053 --- ggml_extend_backend.cpp:308
[I] Conditioner params 44961 MiB, compute reserve 2048 MiB -> compute RPC0, params RPC0
[V] model manager prepared params backend buffers (33081.17 MB, 271 tensors, 41 blocks, VRAM) on RPC0[10.0.0.2:50053]
[I] save result image 0 to 'out.png' (success)Cause
add_rpc_devices()(src/core/ggml_extend_backend.cpp) is only called from model init
(src/pipeline/diffusion_engine.cpp, around line 989, withsd_ctx_params->rpc_servers).- The
--list-devicesoption handler (examples/common/common.cpp, around line 823) calls
sd_list_devices()andexit(0)straight away during argument parsing.sd_list_devices()
(src/core/util.cpp) only enumerates what's already registered, and nothing has registered
the RPC servers at that point. If--rpc-serverscomes after--list-deviceson the command
line, it hasn't even been parsed yet.
Possible fix
Any of:
- Make
--list-devicesa flag that is acted on after all arguments are parsed. Call
add_rpc_devices(rpc_servers), or a small public wrapper such as
sd_add_rpc_servers(const char*), beforesd_list_devices(). - Or give
sd_list_devices()an optional RPC spec parameter and register first.
Either way, keep the registration idempotent. Registering the same endpoint twice (e.g. once in
the CLI and again in model init) currently just logs Adding RPC server twice. It seems harmless
in our runs, but a guard would avoid duplicate devices.
Then the commented-out "Step B" in docs/rpc.md could be restored.
Environment
- stable-diffusion.cpp
b13a482(2026-10-18), ggml submoduledc99877 - RPC server: llama.cpp
47f5a64,GGML_MAX_NAME=160 - 2× AMD Ryzen AI Max+ 395 (Radeon 8060S, gfx1151), ROCm 7.15 (hipconfig
7.15.26333),
Linux 7.2.7, client and server connected over Thunderbolt (USB4) networking - Full-precision FLUX.2-dev and MiniMax-H3 both ran correctly with
te=RPC0; only
--list-devicesis affected.
Activity