From addac252939a6e03e6d2b9fe8f840b5da66c89d4 Mon Sep 17 00:00:00 2001 From: Adam Treat Date: Thu, 14 Sep 2023 16:38:28 -0400 Subject: [PATCH] Set the singleton to nullptr here. --- ggml-vulkan.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/ggml-vulkan.cpp b/ggml-vulkan.cpp index 36cf0b8ae..a008ed3fb 100644 --- a/ggml-vulkan.cpp +++ b/ggml-vulkan.cpp @@ -250,6 +250,10 @@ bool ggml_vk_free_device() { if (!ggml_vk_has_device()) return false; komputeManager()->destroy(); + // FIXME: The lifetime of these two needs to be tied together as we're relying upon the fact + // the llama_free(ctx) destroys this memory and we just set the singleton to nullptr here which + // is very brittle + s_kompute_context = nullptr; return true; }