From 08b1d2aea577ed407c11ab13fbb174a28f6e65dd Mon Sep 17 00:00:00 2001 From: Erik Winter <93544977+ewintr@users.noreply.github.com> Date: Wed, 23 Sep 2026 07:13:01 +0200 Subject: [PATCH] vulkan: hide internal symbols to prevent duplicate-dlopen state destruction (#29139) Since #28732 our internal symbols are exported. A duplicate copy dlopened and dlclosed by ggml_backend_load_all() then interposes them, so its destructors destroy the live vk_instance and later device queries hit the GGML_ASSERT on vk_instance.device_indices. Hidden visibility exports only GGML_BACKEND_API, as before #28732. Fixes #29138 Assisted-by: henk:claude-fable-5 --- ggml/src/ggml-vulkan/CMakeLists.txt | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/ggml/src/ggml-vulkan/CMakeLists.txt b/ggml/src/ggml-vulkan/CMakeLists.txt index af951a2bd5..d7dec92a63 100644 --- a/ggml/src/ggml-vulkan/CMakeLists.txt +++ b/ggml/src/ggml-vulkan/CMakeLists.txt @@ -69,6 +69,11 @@ if (Vulkan_FOUND) ggml-vulkan-debug.cpp ) + # hide symbols, so dlclosed duplicate copies cannot interpose them + set_target_properties(ggml-vulkan PROPERTIES + CXX_VISIBILITY_PRESET hidden + VISIBILITY_INLINES_HIDDEN ON) + set(VULKAN_SHADER_GEN_CMAKE_ARGS "") # Test all shader extensions