mirror of
https://github.com/ollama/ollama.git
synced 2026-04-26 18:55:53 +02:00
fix vulkan handle releasing
This commit is contained in:
@@ -228,6 +228,11 @@ func GetGPUInfo() GpuInfoList {
|
|||||||
C.oneapi_release(*oHandles.oneapi)
|
C.oneapi_release(*oHandles.oneapi)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
if vHandles != nil {
|
||||||
|
if vHandles.vulkan != nil {
|
||||||
|
C.vk_release(*vHandles.vulkan)
|
||||||
|
}
|
||||||
|
}
|
||||||
}()
|
}()
|
||||||
|
|
||||||
if !bootstrapped {
|
if !bootstrapped {
|
||||||
|
|||||||
@@ -213,9 +213,16 @@ void vk_check_vram(vk_handle_t rh, int i, mem_info_t *resp) {
|
|||||||
resp->major = VK_API_VERSION_MAJOR(properties.apiVersion);
|
resp->major = VK_API_VERSION_MAJOR(properties.apiVersion);
|
||||||
resp->minor = VK_API_VERSION_MINOR(properties.apiVersion);
|
resp->minor = VK_API_VERSION_MINOR(properties.apiVersion);
|
||||||
resp->patch = VK_API_VERSION_PATCH(properties.apiVersion);
|
resp->patch = VK_API_VERSION_PATCH(properties.apiVersion);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void vk_release(vk_handle_t rh) {
|
void vk_release(vk_handle_t rh) {
|
||||||
|
LOG(rh.verbose, "releasing vulkan library\n");
|
||||||
(*rh.vkDestroyInstance)(rh.vk, NULL);
|
(*rh.vkDestroyInstance)(rh.vk, NULL);
|
||||||
|
UNLOAD_LIBRARY(rh.vk_handle);
|
||||||
|
rh.vk_handle = NULL;
|
||||||
|
#ifdef __linux__
|
||||||
|
LOG(rh.verbose, "releasing libcap library\n");
|
||||||
|
UNLOAD_LIBRARY(rh.cap_handle);
|
||||||
|
rh.cap_handle = NULL;
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user