From b2fe4c772953cbce27df46e0368f160e5a0be820 Mon Sep 17 00:00:00 2001 From: Faith Ekstrand Date: Fri, 4 Aug 2023 12:03:16 -0500 Subject: [PATCH] nvk: Print an error message if VM_BIND support is missing This should prevent a lot of bug reports. Part-of: --- src/nouveau/vulkan/nvk_physical_device.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/nouveau/vulkan/nvk_physical_device.c b/src/nouveau/vulkan/nvk_physical_device.c index 3825da44035..9afdf660b17 100644 --- a/src/nouveau/vulkan/nvk_physical_device.c +++ b/src/nouveau/vulkan/nvk_physical_device.c @@ -680,6 +680,7 @@ nvk_create_drm_physical_device(struct vk_instance *_instance, const struct nv_device_info info = ws_dev->info; #if NVK_NEW_UAPI == 1 + const bool has_vm_bind = ws_dev->has_vm_bind; const struct vk_sync_type syncobj_sync_type = vk_drm_syncobj_get_type(ws_dev->fd); #endif @@ -699,6 +700,13 @@ nvk_create_drm_physical_device(struct vk_instance *_instance, info.device_name); } +#if NVK_NEW_UAPI == 1 + if (!has_vm_bind) { + return vk_errorf(instance, VK_ERROR_INCOMPATIBLE_DRIVER, + "NVK Requires a Linux kernel version 6.6 or later"); + } +#endif + if (!(drm_device->available_nodes & (1 << DRM_NODE_RENDER))) { return vk_errorf(instance, VK_ERROR_INITIALIZATION_FAILED, "NVK requires a render node");