Skip to content

Commit a11559e

Browse files
committed
vulkan: Make Vulkan optional at runtime (#11493).
1 parent 66ee4f2 commit a11559e

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

ggml/src/ggml-vulkan/ggml-vulkan.cpp

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8305,8 +8305,13 @@ ggml_backend_reg_t ggml_backend_vk_reg() {
83058305
/* .iface = */ ggml_backend_vk_reg_i,
83068306
/* .context = */ nullptr,
83078307
};
8308-
8309-
return ®
8308+
try {
8309+
ggml_vk_instance_init();
8310+
return ®
8311+
} catch (const vk::SystemError& e) {
8312+
VK_LOG_DEBUG("ggml_backend_vk_reg() -> Error: System error: " << e.what());
8313+
return nullptr;
8314+
}
83108315
}
83118316

83128317
// Extension availability

0 commit comments

Comments
 (0)