vulkan: throw system error instead of SIGABRT during init on older devices (#16156)

* Throw system error on old Vulkan driver rather than SIGABRT

* Optionally handle any potential error in vulkan init
This commit is contained in:
Dmytro Minochkin 2025-09-27 19:26:46 +03:00 committed by GitHub
parent 234e2ff8ed
commit 0499b29c6f
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 7 additions and 1 deletions

View File

@ -4521,7 +4521,7 @@ static void ggml_vk_instance_init() {
if (api_version < VK_API_VERSION_1_2) {
std::cerr << "ggml_vulkan: Error: Vulkan 1.2 required." << std::endl;
GGML_ABORT("fatal error");
throw vk::SystemError(vk::Result::eErrorFeatureNotPresent, "Vulkan 1.2 required");
}
vk::ApplicationInfo app_info{ "ggml-vulkan", 1, nullptr, 0, api_version };
@ -12909,6 +12909,12 @@ ggml_backend_reg_t ggml_backend_vk_reg() {
} catch (const vk::SystemError& e) {
VK_LOG_DEBUG("ggml_backend_vk_reg() -> Error: System error: " << e.what());
return nullptr;
} catch (const std::exception &e) {
VK_LOG_DEBUG("ggml_backend_vk_reg() -> Error: " << e.what());
return nullptr;
} catch (...) {
VK_LOG_DEBUG("ggml_backend_vk_reg() -> Error: unknown exception during Vulkan init");
return nullptr;
}
}