bevy: Vulkan Validation Error in a default, empty app w/ window.
Bevy version
0.8-dev (main)
Relevant system information
AdapterInfo {
name: "NVIDIA GeForce RTX 3090",
vendor: 4318,
device: 8708,
device_type: DiscreteGpu,
backend: Vulkan
}
What you did
Any project started with DefaultPlugins and a window on a vulkan backend.
What went wrong
Vulkan device creation is being provided with a non-compliant VkPhysicalDeviceVulkan12Features / device create info struct.
The expectation is that default vulkan init would be free of validation errors.
2022-07-21T14:59:03.219031Z ERROR wgpu_hal::vulkan::instance: VALIDATION [VUID-VkDeviceCreateInfo-pNext-02830 (0x211e533b)]
Validation Error: [ VUID-VkDeviceCreateInfo-pNext-02830 ] Object 0: handle = 0x2307368ded0, type = VK_OBJECT_TYPE_INSTANCE; | MessageID = 0x211e533b | If the pNext chain includes a VkPhysicalDeviceVulkan12Features structure, then it must not include a VkPhysicalDevice8BitStorageFeatures, VkPhysicalDeviceShaderAtomicInt64Features, VkPhysicalDeviceShaderFloat16Int8Features, VkPhysicalDeviceDescriptorIndexingFeatures, VkPhysicalDeviceScalarBlockLayoutFeatures, VkPhysicalDeviceImagelessFramebufferFeatures, VkPhysicalDeviceUniformBufferStandardLayoutFeatures, VkPhysicalDeviceShaderSubgroupExtendedTypesFeatures, VkPhysicalDeviceSeparateDepthStencilLayoutsFeatures, VkPhysicalDeviceHostQueryResetFeatures, VkPhysicalDeviceTimelineSemaphoreFeatures, VkPhysicalDeviceBufferDeviceAddressFeatures, or VkPhysicalDeviceVulkanMemoryModelFeatures structure The Vulkan spec states: If the pNext chain includes a VkPhysicalDeviceVulkan12Features structure, then it must not include a VkPhysicalDevice8BitStorageFeatures, VkPhysicalDeviceShaderAtomicInt64Features, VkPhysicalDeviceShaderFloat16Int8Features, VkPhysicalDeviceDescriptorIndexingFeatures, VkPhysicalDeviceScalarBlockLayoutFeatures, VkPhysicalDeviceImagelessFramebufferFeatures, VkPhysicalDeviceUniformBufferStandardLayoutFeatures, VkPhysicalDeviceShaderSubgroupExtendedTypesFeatures, VkPhysicalDeviceSeparateDepthStencilLayoutsFeatures, VkPhysicalDeviceHostQueryResetFeatures, VkPhysicalDeviceTimelineSemaphoreFeatures, VkPhysicalDeviceBufferDeviceAddressFeatures, or VkPhysicalDeviceVulkanMemoryModelFeatures structure (https://vulkan.lunarg.com/doc/view/1.3.211.0/windows/1.3-extensions/vkspec.html#VUID-VkDeviceCreateInfo-pNext-02830)
2022-07-21T14:59:03.219780Z ERROR wgpu_hal::vulkan::instance: objects: (type: INSTANCE, hndl: 0x2307368ded0, name: ?)
About this issue
- Original URL
- State: open
- Created 2 years ago
- Reactions: 3
- Comments: 18 (9 by maintainers)
TL;DR: I’m still going to blame
wgpu
.This error is affecting multiple GPUs from both Nvidia and AMD, so we can rule out driver/GPU problems. It’s also happening on both Windows and Linux, so it’s likely not the OS, either. The culprit is likely either
bevy_render
orwgpu
. However,bevy_render
doesn’t interact with Vulkan directly – that’swgpu_hal
’s job.The error that you got is saying that the list of features was invalid. The only optional feature that Bevy enables by default is
TEXTURE_ADAPTER_SPECIFIC_FORMAT_FEATURES
, which, according to thewgpu
docs, is required for read/write storage access.wgpu
, in turn, converts the features it receives into a list of features to be passed to Vulkan.Here’s where the magic happens.
wgpu
essentially included redundant information: TheVkPhysicalDeviceVulkan12Features
structure has several boolean fields, which can be toggled to enable/disable many of Vulkan’s features. However, in older versions of Vulkan, instead of using a single structure for most features, you would instead pass a linked list of many structures. (You still have to use a linked list if you’re using features that aren’t inVkPhysicalDeviceVulkan12Features
, by the way.)wgpu
, for some reason, decides to declare features through both techniques at the same time (probably for backwards compatibility). Vulkan’s spec doesn’t allow this, since it creates two different sources of truth, which can make things confusing for the driver. The output fromLogPlugin
suggests that the error comes fromwgpu
’s built-in validation layer, which detected the problem and threw an error.The solution would be for
wgpu
to use onlyVkPhysicalDeviceVulkan12Features
when running on Vulkan 1.2 or newer, and use a good ol’ linked list for older versions.Marking this as blocked upstream based on current conversation, let me know if that is not correct.
Already installed the latest version when I ran into this and realized it was Vulkan related. Appreciate the suggestion though!
The linked wgpu bug is now closed and the fix is in their 0.14.0 release. fix: https://github.com/gfx-rs/wgpu/commit/c519901d575bd6d61711e5cf9c3c1b047e7d3cf7 issue: https://github.com/gfx-rs/wgpu/issues/2925