From c05883f3a9370448722f6ba85e1c7d1f069f1a83 Mon Sep 17 00:00:00 2001 From: 0cc4m Date: Sat, 16 Dec 2023 14:49:03 +0100 Subject: [PATCH] Free model gpu buffers on exit --- llama.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/llama.cpp b/llama.cpp index 73f987188..a0fc74e42 100644 --- a/llama.cpp +++ b/llama.cpp @@ -1451,6 +1451,9 @@ struct llama_model { ggml_cl_free_data(tensors_by_name[i].second); } #elif defined(GGML_USE_VULKAN) + for (size_t i = 0; i < tensors_by_name.size(); ++i) { + ggml_vk_free_data(tensors_by_name[i].second); + } ggml_vk_cleanup(); #endif }