vulkan : check for null vkEnumerateInstanceVersion (#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:
1 parent
4f54067615
commit
58cb9138e4
1 file changed
+7
-1
@@ -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