diff options
author | Danny Milosavljevic <[email protected]> | 2025-01-29 01:22:33 +0100 |
---|---|---|
committer | Danny Milosavljevic <[email protected]> | 2025-01-29 11:03:18 +0100 |
commit | 14b8039d94b1c0e2fe5c0b71c84f6a7aa8ff653e (patch) | |
tree | 7018ba1608bb781aea4ec7a7cb8203443bec3b94 /gnu/packages/patches/llama-cpp-vulkan-optional.patch | |
parent | a6a4f773f321542daf8a95db99ff303f3f18a666 (diff) |
gnu: llama-cpp: Enable Vulkan.
* gnu/packages/patches/llama-cpp-vulkan-optional.patch: New file.
* gnu/local.mk (dist_patch_DATA): Add it.
* gnu/packages/machine-learning.scm (llama-cpp)
[source]: Add patch.
[arguments]<#:tests?>: Disable.
<#:configure-flags>: Add "-DGGML_VULKAN=ON".
<#:phases>[patch-paths]: New phase.
[inputs]: Add vulkan-headers, vulkan-loader.
[native-inputs]: Add shaderc, bash.
Change-Id: Ib7a58f5c7f622213f3aaf5abcd701b17eed80f6b
Diffstat (limited to 'gnu/packages/patches/llama-cpp-vulkan-optional.patch')
-rw-r--r-- | gnu/packages/patches/llama-cpp-vulkan-optional.patch | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/gnu/packages/patches/llama-cpp-vulkan-optional.patch b/gnu/packages/patches/llama-cpp-vulkan-optional.patch new file mode 100644 index 0000000000..9f91b2850d --- /dev/null +++ b/gnu/packages/patches/llama-cpp-vulkan-optional.patch @@ -0,0 +1,24 @@ +Author: Danny Milosavljevic <[email protected]> +Date: 2025-01-29 +License: Expat + +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(); +- +- return vk_instance.device_indices.size(); ++ try { ++ ggml_vk_instance_init(); ++ return vk_instance.device_indices.size(); ++ } catch (const vk::SystemError& e) { ++ std::cerr << "ggml_vulkan: Error: System error" << std::endl; ++ return 0; ++ } + } + + static void ggml_vk_get_device_description(int device, char * description, size_t description_size) { |