Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Imageless Swapchain Vulkan Validation Error #3855

Closed
LPGhatguy opened this issue Jun 10, 2023 · 20 comments · Fixed by #4002
Closed

Imageless Swapchain Vulkan Validation Error #3855

LPGhatguy opened this issue Jun 10, 2023 · 20 comments · Fixed by #4002
Labels
api: vulkan Issues with Vulkan type: bug Something isn't working

Comments

@LPGhatguy
Copy link
Contributor

Description
On all wgpu programs that create a swapchain, I receive this Vulkan validation layer on my machine:

Validation Error: [ VUID-VkRenderPassBeginInfo-framebuffer-04627 ] Object 0: handle = 0x3a6cbb0000000025, type = VK_OBJECT_TYPE_RENDER_PASS; | MessageID = 0x45125641 | vkCmdBeginRenderPass: Image view #0 created from an image with usage set as (VK_IMAGE_USAGE_TRANSFER_SRC_BIT|VK_IMAGE_USAGE_COLOR_ATTACHMENT_BIT) but using VkImageViewUsageCreateInfo the inherited usage is the subset (VK_IMAGE_USAGE_COLOR_ATTACHMENT_BIT) and the image info #0 used to create the framebuffer had usage set as (VK_IMAGE_USAGE_TRANSFER_SRC_BIT|VK_IMAGE_USAGE_COLOR_ATTACHMENT_BIT). The Vulkan spec states: If framebuffer was created with a VkFramebufferCreateInfo::flags value that included VK_FRAMEBUFFER_CREATE_IMAGELESS_BIT, each element of the pAttachments member of a VkRenderPassAttachmentBeginInfo structure included in the pNext chain must be a VkImageView with an inherited usage equal to the usage member of the corresponding element of VkFramebufferAttachmentsCreateInfo::pAttachmentImageInfos used to create framebuffer (https://vulkan.lunarg.com/doc/view/1.3.250.0/windows/1.3-extensions/vkspec.html#VUID-VkRenderPassBeginInfo-framebuffer-04627)

On some wgpu applications I have, this error is logged every frame. I think that's because I'm recreating the image view every frame, but I haven't looked into it.

Repro steps
Run the hello-triangle example from wgpu with Vulkan validation layers enabled.

Platform

  • Windows 10 22H2
  • Nvidia Driver 535.98
  • Vulkan SDK 1.3.250.0
  • Nvidia RTX 3070
@teoxoy teoxoy added type: bug Something isn't working api: vulkan Issues with Vulkan labels Jun 12, 2023
@JMS55
Copy link
Contributor

JMS55 commented Jun 13, 2023

Some bevy users have been reporting the same thing.

@dphfox
Copy link

dphfox commented Jun 13, 2023

I've been experiencing the same issue on Windows 11 22H2, Nvidia driver 531.79, Vulkan SDK 1.3.246.1, Nvidia RTX 4090. The message is logged every frame.

@cwfitzgerald
Copy link
Member

Interesting, running on Windows 11, 535.98, Nvidia 1080ti and I don't get that message. Could someone who repros it send the log from vulkaninfo?

@jack1232
Copy link

On windows 11 and Nvidia GeForce RTX 3060, the wgpu examples run fine without any error with DX12 backend. However, when switching to Vulkan backend, I got the similar validation error that is logged every frame.

@CourtneyAbraham
Copy link

I've been getting the same error, Windows 10, RTX 3080 Ti, 531.41

Here is the output from me running vulkaninfo

vulkaninfo.txt

@Elabajaba
Copy link
Contributor

Windows 11, AMD 6800xt driver 23.5.2, Vulkan SDK 1.3.250.1, same issue.

I tested disabling layers with vulkan configurator (it's part of the VulkanSDK), and found that forcing the OBS layer off fixed it.

@XardioD
Copy link

XardioD commented Jul 8, 2023

Same issue on bevy get the issue even with a simple program with only the Default Plugin and nothing else.
Updating the driver had no noticeable effect. GTX 1660 super driver from around march 2022 to the last version available june 2023
I tested on the 3 example game provided by bevy and that didn't impact the render except on the 3d example where it only show a grey image : https://github.com/bevyengine/bevy/blob/latest/examples/games/alien_cake_addict.rs
I also already installed the Vulkan SDK to learn Vulkan before i started learning bevy don't know if that information can be of any use but it here if needed

@aloucks
Copy link
Contributor

aloucks commented Jul 26, 2023

I'm seeing the same thing. Validation error on every frame.

@cwfitzgerald
Copy link
Member

I think this is a validation layers bug. Will follow up with them.

@cwfitzgerald
Copy link
Member

Filed upstream KhronosGroup/Vulkan-ValidationLayers#6247

@cwfitzgerald
Copy link
Member

I'm wrong, this is an OBS error. WIll file upstream and suppress on our end.

@cwfitzgerald
Copy link
Member

Filed upstream: obsproject/obs-studio#9353

@cwfitzgerald
Copy link
Member

This has been fixed upstream, will backport the local workaround so people don't get the warnings until they can pick up the next OBS release.

@nezvers
Copy link

nezvers commented Oct 3, 2023

Windows 10 Nvidia 2070
I see it on every project.

@cwfitzgerald
Copy link
Member

Are you on wgpu-hal 0.17.1?

@jack1232
Copy link

jack1232 commented Oct 4, 2023

No such error anymore on wgpu 0.17.1.

@aloucks
Copy link
Contributor

aloucks commented Dec 17, 2023

I'm still seeing this on Windows 10, with a new bevy 12 project. Setting DISABLE_VULKAN_OBS_CAPTURE to 1 (as described in one of the related links) does not help.

[dependencies]
bevy = { version = "0.12", features = ["dynamic_linking"] }
$ cargo tree | grep wgpu
    │       │   │   └── wgpu v0.17.2
    │       │   │       ├── wgpu-core v0.17.1
    │       │   │       │   ├── wgpu-hal v0.17.2
    │       │   │       │   │   ├── wgpu-types v0.17.0
    │       │   │       │   └── wgpu-types v0.17.0 (*)
    │       │   │       ├── wgpu-hal v0.17.2 (*)
    │       │   │       └── wgpu-types v0.17.0 (*)

2023-12-17T16:50:29.184103Z ERROR log: VALIDATION [VUID-VkRenderPassBeginInfo-framebuffer-04627 (0x45125641)] Validation Error: [ VUID-VkRenderPassBeginInfo-framebuffer-04627 ] Object 0: handle = 0x18543900000000ff, type = VK_OBJECT_TYPE_RENDER_PASS; Object 1: handle = 0x1e7d540000000102, type = VK_OBJECT_TYPE_FRAMEBUFFER; Object 2: handle = 0x76b5190000000902, type = VK_OBJECT_TYPE_IMAGE_VIEW; Object 3: handle = 0xf799000000000a9, type = VK_OBJECT_TYPE_IMAGE; | MessageID = 0x45125641 | vkCmdBeginRenderPass(): pRenderPassBegin->pNext<VkRenderPassAttachmentBeginInfo>.pAttachments[0].usage is (VK_IMAGE_USAGE_TRANSFER_SRC_BIT|VK_IMAGE_USAGE_COLOR_ATTACHMENT_BIT), which has an inherited usage subset from VkImageViewUsageCreateInfo of (VK_IMAGE_USAGE_COLOR_ATTACHMENT_BIT), but the VkFramebuffer was created with vkFramebufferAttachmentsCreateInfo::pAttachmentImageInfos[0].usage = VK_IMAGE_USAGE_TRANSFER_SRC_BIT|VK_IMAGE_USAGE_COLOR_ATTACHMENT_BIT. The Vulkan spec states: If framebuffer was created with a VkFramebufferCreateInfo::flags value that included VK_FRAMEBUFFER_CREATE_IMAGELESS_BIT, each element of the pAttachments member of a VkRenderPassAttachmentBeginInfo structure included in the pNext chain must be a VkImageView with an inherited usage equal to the usage member of the corresponding element of VkFramebufferAttachmentsCreateInfo::pAttachmentImageInfos used to create framebuffer (https://vulkan.lunarg.com/doc/view/1.3.268.0/windows/1.3-extensions/vkspec.html#VUID-VkRenderPassBeginInfo-framebuffer-04627)
2023-12-17T16:50:29.185082Z ERROR log: objects: (type: RENDER_PASS, hndl: 0x18543900000000ff, name: ?), (type: FRAMEBUFFER, hndl: 0x1e7d540000000102, name: ?), (type: IMAGE_VIEW, hndl: 0x76b5190000000902, name: ?), (type: IMAGE, hndl: 0xf799000000000a9, name: ?)

@mppbtw
Copy link

mppbtw commented Jan 3, 2024

Can confirm that I'm getting the same error on Arch (up to date drivers and all) with bevy version 0.12.1 also.

edit: This only happens when compiling Bevy with opt-level 1 or 2, with 3 everything is fine.

@Speak2Erase
Copy link

Speak2Erase commented Jan 15, 2024

I'm getting a similar validation error on Manjaro when trying to use NVIDIA Nsight with latest trunk.

@teoxoy
Copy link
Member

teoxoy commented Jan 22, 2024

@Speak2Erase NVIDIA Nsight seems to also cause VUID-VkRenderPassBeginInfo-framebuffer-04627.

https://forums.developer.nvidia.com/t/new-versions-of-nsight-add-flags-behind-the-scene-that-cause-vulkan-validation-errors/216730

@aloucks @mppbtw do you have OBS installed? or other apps that might interfere with Vulkan?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
api: vulkan Issues with Vulkan type: bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.