From: unraido Date: Mon, 27 Apr 2026 14:25:09 +0000 (+0900) Subject: fix: rpc-server cache may not work in Windows environments (#22394) X-Git-Tag: upstream/0.0.10438~1489 X-Git-Url: https://git.djapps.eu/?a=commitdiff_plain;h=ceaf47c4b1101e2bcdff31a7505fa51c20117530;p=pkg%2Fggml%2Fsources%2Fllama.cpp fix: rpc-server cache may not work in Windows environments (#22394) * fix: create directory and log cache file name. * Remove GGML_LOG_INFO conditional compilation. --------- Co-authored-by: kotaro --- diff --git a/ggml/src/ggml-rpc/ggml-rpc.cpp b/ggml/src/ggml-rpc/ggml-rpc.cpp index 2ded73978..505bec73d 100644 --- a/ggml/src/ggml-rpc/ggml-rpc.cpp +++ b/ggml/src/ggml-rpc/ggml-rpc.cpp @@ -1101,7 +1101,7 @@ bool rpc_server::set_tensor(const std::vector & input) { fs::path cache_file = fs::path(cache_dir) / hash_str; std::ofstream ofs(cache_file, std::ios::binary); ofs.write((const char *)data, size); - GGML_LOG_INFO("[%s] saved to '%s'\n", __func__, cache_file.c_str()); + GGML_LOG_INFO("[%s] saved to '%s'\n", __func__, cache_file.string().c_str()); } ggml_backend_tensor_set(tensor, data, offset, size); return true; diff --git a/tools/rpc/rpc-server.cpp b/tools/rpc/rpc-server.cpp index 03ab78e5f..08e680391 100644 --- a/tools/rpc/rpc-server.cpp +++ b/tools/rpc/rpc-server.cpp @@ -317,7 +317,7 @@ int main(int argc, char * argv[]) { const char * cache_dir = nullptr; std::string cache_dir_str; if (params.use_cache) { - cache_dir_str = fs_get_cache_directory() + "rpc/"; + cache_dir_str = fs_get_cache_directory() + "rpc" + DIRECTORY_SEPARATOR; if (!fs_create_directory_with_parents(cache_dir_str)) { fprintf(stderr, "Failed to create cache directory: %s\n", cache_dir_str.c_str()); return 1;