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:
parent
234e2ff8ed
commit
0499b29c6f
|
|
@ -4521,7 +4521,7 @@ static void ggml_vk_instance_init() {
|
||||||
|
|
||||||
if (api_version < VK_API_VERSION_1_2) {
|
if (api_version < VK_API_VERSION_1_2) {
|
||||||
std::cerr << "ggml_vulkan: Error: Vulkan 1.2 required." << std::endl;
|
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 };
|
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) {
|
} catch (const vk::SystemError& e) {
|
||||||
VK_LOG_DEBUG("ggml_backend_vk_reg() -> Error: System error: " << e.what());
|
VK_LOG_DEBUG("ggml_backend_vk_reg() -> Error: System error: " << e.what());
|
||||||
return nullptr;
|
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;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue