mirror of
https://github.com/ggml-org/whisper.cpp.git
synced 2026-10-20 17:23:00 +02:00
vulkan : check for null vkEnumerateInstanceVersion (llama/29872)
A 1.0 loader (e.g. Android 8.1) has no vkEnumerateInstanceVersion, so backend init called a null pointer. Treat it like any loader under 1.2. Fixes #29871. Assisted-by: Claude Opus 5.5
This commit is contained in:
@@ -5189,10 +5189,16 @@ void ggml_vk_instance_init() {
|
||||
// See https://github.com/KhronosGroup/Vulkan-Hpp?tab=readme-ov-file#extensions--per-device-function-pointers-
|
||||
ggml_vk_default_dispatcher_instance.init(vkGetInstanceProcAddr);
|
||||
|
||||
// vkEnumerateInstanceVersion is Vulkan 1.1. A null value indicated Vulkan 1.0.
|
||||
if (ggml_vk_default_dispatcher_instance.vkEnumerateInstanceVersion == nullptr) {
|
||||
GGML_LOG_ERROR("ggml_vulkan: Error: Vulkan 1.2 required.");
|
||||
throw vk::SystemError(vk::Result::eErrorFeatureNotPresent, "Vulkan 1.2 required");
|
||||
}
|
||||
|
||||
uint32_t api_version = vk::enumerateInstanceVersion();
|
||||
|
||||
if (api_version < VK_API_VERSION_1_2) {
|
||||
std::cerr << "ggml_vulkan: Error: Vulkan 1.2 required." << std::endl;
|
||||
GGML_LOG_ERROR("ggml_vulkan: Error: Vulkan 1.2 required.");
|
||||
throw vk::SystemError(vk::Result::eErrorFeatureNotPresent, "Vulkan 1.2 required");
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user