如何在遵循 vulkan 教程时修复 mac m1 上的 VK_KHR_portability_subset 错误
How to fix VK_KHR_portability_subset error on mac m1 while following vulkan tutorial
您好,我在编译时遇到错误。显然我缺少一个扩展:
validation layer: Validation Error: [ VUID-VkDeviceCreateInfo-pProperties-04451 ] Object 0: handle = 0x1055040c0, type = VK_OBJECT_TYPE_PHYSICAL_DEVICE; | MessageID = 0x3a3b6ca0 | vkCreateDevice: VK_KHR_portability_subset must be enabled because physical device VkPhysicalDevice 0x1055040c0[] supports it The Vulkan spec states: If the [VK_KHR_portability_subset] extension is included in pProperties of vkEnumerateDeviceExtensionProperties, ppEnabledExtensions must include "VK_KHR_portability_subset". (https://vulkan.lunarg.com/doc/view/1.2.176.1/mac/1.2-extensions/vkspec.html#VUID-VkDeviceCreateInfo-pProperties-04451)
我天真地添加到 deviceExtension 向量“VK_KHR_portability_subset”,然后得到第二个错误,似乎与前一个类似。
validation layer: Validation Error: [ VUID-vkCreateDevice-ppEnabledExtensionNames-01387 ] Object 0: VK_NULL_HANDLE, type = VK_OBJECT_TYPE_INSTANCE; | MessageID = 0x12537a2c | Missing extension required by the device extension VK_KHR_portability_subset: VK_KHR_get_physical_device_properties2. The Vulkan spec states: All required extensions for each extension in the VkDeviceCreateInfo::ppEnabledExtensionNames list must also be present in that list (https://vulkan.lunarg.com/doc/view/1.2.176.1/mac/1.2-extensions/vkspec.html#VUID-vkCreateDevice-ppEnabledExtensionNames-01387)
我添加到 deviceExtension 向量“VK_KHR_get_physical_device_properties2”,然后出现第三个错误:
libc++abi: terminating with uncaught exception of type std::runtime_error: failed to find a suitable GPU!
问题是之前他认出我使用的是 m1 芯片,但现在设备上没有显示任何信息:(
I added to the deviceExtension vector "VK_KHR_get_physical_device_properties2"
VK_KHR_get_physical_device_properties2
是一个实例扩展,因此属于 vkCreateInstance
( 不是 设备)。
据报道,这解决了您的问题。
我在同一台设备上遇到过相同的消息,经过一番研究后发现这不是错误,只是一条警告。如果你真的不需要处理这种特殊情况,你可以忽略它。
您好,我在编译时遇到错误。显然我缺少一个扩展:
validation layer: Validation Error: [ VUID-VkDeviceCreateInfo-pProperties-04451 ] Object 0: handle = 0x1055040c0, type = VK_OBJECT_TYPE_PHYSICAL_DEVICE; | MessageID = 0x3a3b6ca0 | vkCreateDevice: VK_KHR_portability_subset must be enabled because physical device VkPhysicalDevice 0x1055040c0[] supports it The Vulkan spec states: If the [VK_KHR_portability_subset] extension is included in pProperties of vkEnumerateDeviceExtensionProperties, ppEnabledExtensions must include "VK_KHR_portability_subset". (https://vulkan.lunarg.com/doc/view/1.2.176.1/mac/1.2-extensions/vkspec.html#VUID-VkDeviceCreateInfo-pProperties-04451)
我天真地添加到 deviceExtension 向量“VK_KHR_portability_subset”,然后得到第二个错误,似乎与前一个类似。
validation layer: Validation Error: [ VUID-vkCreateDevice-ppEnabledExtensionNames-01387 ] Object 0: VK_NULL_HANDLE, type = VK_OBJECT_TYPE_INSTANCE; | MessageID = 0x12537a2c | Missing extension required by the device extension VK_KHR_portability_subset: VK_KHR_get_physical_device_properties2. The Vulkan spec states: All required extensions for each extension in the VkDeviceCreateInfo::ppEnabledExtensionNames list must also be present in that list (https://vulkan.lunarg.com/doc/view/1.2.176.1/mac/1.2-extensions/vkspec.html#VUID-vkCreateDevice-ppEnabledExtensionNames-01387)
我添加到 deviceExtension 向量“VK_KHR_get_physical_device_properties2”,然后出现第三个错误:
libc++abi: terminating with uncaught exception of type std::runtime_error: failed to find a suitable GPU!
问题是之前他认出我使用的是 m1 芯片,但现在设备上没有显示任何信息:(
I added to the deviceExtension vector "VK_KHR_get_physical_device_properties2"
VK_KHR_get_physical_device_properties2
是一个实例扩展,因此属于 vkCreateInstance
( 不是 设备)。
据报道,这解决了您的问题。
我在同一台设备上遇到过相同的消息,经过一番研究后发现这不是错误,只是一条警告。如果你真的不需要处理这种特殊情况,你可以忽略它。