mirror of
https://codeberg.org/guix/guix.git
synced 2025-10-02 02:15:12 +00:00
gnu: llama-cpp: Make the runtime check safer.
* gnu/packages/patches/llama-cpp-vulkan-optional.patch: Make the runtime check safer. Change-Id: If72148fb3e8bf500d35c0987126a788ec410cdbd
This commit is contained in:
parent
aba3e48ae1
commit
24fad804f3
1 changed files with 12 additions and 13 deletions
|
@ -1,24 +1,23 @@
|
|||
Author: Danny Milosavljevic <dannym@friendly-machines.com>
|
||||
Date: 2025-01-29
|
||||
License: Expat
|
||||
Subject: Make Vulkan optional
|
||||
|
||||
diff -ru orig/llama.cpp/ggml/src/ggml-vulkan/ggml-vulkan.cpp llama.cpp/ggml/src/ggml-vulkan/ggml-vulkan.cpp
|
||||
--- orig/llama.cpp/ggml/src/ggml-vulkan/ggml-vulkan.cpp 2025-01-29 06:24:10.922476480 +0100
|
||||
+++ llama.cpp/ggml/src/ggml-vulkan/ggml-vulkan.cpp 2025-01-29 06:26:45.973357439 +0100
|
||||
@@ -7317,9 +7317,13 @@
|
||||
}
|
||||
|
||||
static int ggml_vk_get_device_count() {
|
||||
- ggml_vk_instance_init();
|
||||
--- orig/llama.cpp/ggml/src/ggml-vulkan/ggml-vulkan.cpp 2025-01-29 10:24:10.922476480 +0100
|
||||
+++ llama.cpp/ggml/src/ggml-vulkan/ggml-vulkan.cpp 2025-01-29 22:33:19.955087552 +0100
|
||||
@@ -8174,8 +8174,13 @@
|
||||
/* .iface = */ ggml_backend_vk_reg_i,
|
||||
/* .context = */ nullptr,
|
||||
};
|
||||
-
|
||||
- return vk_instance.device_indices.size();
|
||||
- return ®
|
||||
+ try {
|
||||
+ ggml_vk_instance_init();
|
||||
+ return vk_instance.device_indices.size();
|
||||
+ return ®
|
||||
+ } catch (const vk::SystemError& e) {
|
||||
+ std::cerr << "ggml_vulkan: Error: System error" << std::endl;
|
||||
+ return 0;
|
||||
+ VK_LOG_DEBUG("ggml_vk_get_device_count() -> Error: System error: " << e.what());
|
||||
+ return nullptr;
|
||||
+ }
|
||||
}
|
||||
|
||||
static void ggml_vk_get_device_description(int device, char * description, size_t description_size) {
|
||||
// Extension availability
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue