]> git.djapps.eu Git - pkg/ggml/sources/llama.cpp/commitdiff
vulkan: throw system error instead of SIGABRT during init on older devices (#16156)
authorDmytro Minochkin <redacted>
Sat, 27 Sep 2025 16:26:46 +0000 (19:26 +0300)
committerGitHub <redacted>
Sat, 27 Sep 2025 16:26:46 +0000 (18:26 +0200)
* Throw system error on old Vulkan driver rather than SIGABRT

* Optionally handle any potential error in vulkan init

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

index 5dd72367b8dc39ecccd4e54cabfd361c42429598..325d7cad91814c95b5c12c5b66706d46761b1a23 100644 (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;
     }
 }