From 92e60231da485e46871707c4db8375d011dace55 Mon Sep 17 00:00:00 2001 From: rankaiyx Date: Mon, 6 Jul 2026 15:26:45 +0800 Subject: [PATCH] fix(rpc): update ggml_backend_cuda_init to 3-arg signature (#2084) Commit 75a5f6d0 (Per model CUDA contexts) added a third parameter "model" to ggml_backend_cuda_init, but rpc-server was missed. The RPC server creates backends at startup before any model is loaded, so passing nullptr for the model parameter is correct: the RPC server acts as a pure compute proxy and does not host models locally. The nullptr serves as the context grouping key in all_ctx, which is sufficient since all RPC backends in the same process share the same group for multi-GPU reduce operations. Fixes: cmake build failure with GGML_CUDA=ON + GGML_RPC=ON --- examples/rpc/rpc-server.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/examples/rpc/rpc-server.cpp b/examples/rpc/rpc-server.cpp index e67ca7f3..866aa4c4 100644 --- a/examples/rpc/rpc-server.cpp +++ b/examples/rpc/rpc-server.cpp @@ -263,7 +263,7 @@ static ggml_backend_t create_gpu_backend(const rpc_server_params& params, uint32 ggml_backend_t backend = NULL; #ifdef GGML_USE_CUDA fprintf(stderr, "%s: using CUDA backend: CUDA%d\n", __func__, device); - backend = ggml_backend_cuda_init(device, nullptr); // init device + backend = ggml_backend_cuda_init(device, nullptr, nullptr); // init device if (!backend) { fprintf(stderr, "%s: ggml_backend_cuda_init() failed\n", __func__); }