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

Validation for VUID-vkCmdEndDebugUtilsLabelEXT-commandBuffer-01912 is not correct according to the Vulkan spec. #5671

Closed
matasx8 opened this issue Apr 18, 2023 · 6 comments · Fixed by #5941
Assignees
Labels
Bug Something isn't working

Comments

@matasx8
Copy link

matasx8 commented Apr 18, 2023

Environment:

  • OS: Windows 10
  • GPU: RTX 3070ti
  • SDK or header version if building from repo: Vulkan SDK 1.3.243.0
  • Options enabled (synchronization, best practices, etc.):

Describe the Issue
VVL error introduced in this PR is not correct according to the Vulkan spec. The spec says (source):

An application may open a debug label region in one command buffer and close it in another, or otherwise split debug label regions across multiple command buffers or multiple queue submissions. When viewed from the linear series of submissions to a single queue, the calls to vkCmdBeginDebugUtilsLabelEXT and vkCmdEndDebugUtilsLabelEXT must be matched and balanced.

This validation check implemented here checks for matching debug labels per command buffer while it should check per queue. There's an exception for secondary command buffers (source):

VUID-vkCmdEndDebugUtilsLabelEXT-commandBuffer-01913
If commandBuffer is a secondary command buffer, there must be an outstanding vkCmdBeginDebugUtilsLabelEXT command recorded to commandBuffer that has not previously been ended by a call to vkCmdEndDebugUtilsLabelEXT

In that case checking for matching debug labels makes sense per secondary command buffer.

Steps to reproduce

  1. Download and install Unity 2022.2.4f1 or above (e.g. https://unity.com/releases/editor/whats-new/2022.2.15)
  2. Install VVL that has this PR landed
  3. Launch Unity with any project
  4. Switch Graphics API to Vulkan (https://docs.unity3d.com/Manual/GraphicsAPIs.html)
  5. Launch Unity again with --force-vulkan-layers argument from CLI.
  6. Observe VUID-vkCmdEndDebugUtilsLabelEXT-commandBuffer-01912 get logged in the Unity console.

Expected behavior
VUID-vkCmdEndDebugUtilsLabelEXT-commandBuffer-01912 gets validated per queue
VUID-vkCmdEndDebugUtilsLabelEXT-commandBuffer-01913 gets validated per secondary command buffer

Valid Usage ID
VUID-vkCmdEndDebugUtilsLabelEXT-commandBuffer-01912

@ncesario-lunarg ncesario-lunarg self-assigned this Apr 19, 2023
@ncesario-lunarg ncesario-lunarg added the Bug Something isn't working label Apr 19, 2023
@akb825
Copy link

akb825 commented May 8, 2023

I'm seeing the same issue on Linux with my own engine. (DeepSea) I have debug labels that span multiple command buffers across queue submission that is causing this error to be reported every frame. According to the spec this usage should be valid:

An application may open a debug label region in one command buffer and close it in another, or otherwise split debug label regions across multiple command buffers or multiple queue submissions.

jimblandy added a commit to jimblandy/wgpu that referenced this issue May 28, 2023
…fer-01912.

As described in [Vulkan-ValidationLayers#5671], the validation layers don't understand debug ranges paired across different command buffers on the same queue, even though the Vulkan spec says:

> An application may open a debug label region in one command buffer and close it in another, or otherwise split debug label regions across multiple command buffers or multiple queue submissions. When viewed from the linear series of submissions to a single queue, the calls to vkCmdBeginDebugUtilsLabelEXT and vkCmdEndDebugUtilsLabelEXT must be matched and balanced.

Until this is fixed, wgpu should ignore this validation error to reduce noise in test runs.

Fixes gfx-rs#3733.

[Vulkan-ValidationLayers#5671]: KhronosGroup/Vulkan-ValidationLayers#5671,
jimblandy added a commit to jimblandy/wgpu that referenced this issue May 28, 2023
…fer-01912.

As described in [Vulkan-ValidationLayers#5671], the validation layers don't understand debug ranges paired across different command buffers on the same queue, even though the Vulkan spec says:

> An application may open a debug label region in one command buffer and close it in another, or otherwise split debug label regions across multiple command buffers or multiple queue submissions. When viewed from the linear series of submissions to a single queue, the calls to vkCmdBeginDebugUtilsLabelEXT and vkCmdEndDebugUtilsLabelEXT must be matched and balanced.

Until this is fixed, wgpu should ignore this validation error to reduce noise in test runs.

Fixes gfx-rs#3733.

[Vulkan-ValidationLayers#5671]: KhronosGroup/Vulkan-ValidationLayers#5671,
@jimblandy
Copy link

jimblandy commented May 31, 2023

@juan-lunarg Do you think this will be quick to fix? I had started looking into doing it myself today, but this is my first time looking at the code. I'd be delighted if someone else fixed it first. :D

@juan-lunarg
Copy link
Contributor

juan-lunarg commented May 31, 2023

Do you think this will be quick to fix?

I think so. I'll start working on this.

@juan-lunarg
Copy link
Contributor

I've created a test that reproduces the false positive. Should have a fix soon.

jimblandy added a commit to jimblandy/wgpu that referenced this issue Jun 1, 2023
…fer-01912.

As described in [Vulkan-ValidationLayers#5671], the validation layers don't understand debug ranges paired across different command buffers on the same queue, even though the Vulkan spec says:

> An application may open a debug label region in one command buffer and close it in another, or otherwise split debug label regions across multiple command buffers or multiple queue submissions. When viewed from the linear series of submissions to a single queue, the calls to vkCmdBeginDebugUtilsLabelEXT and vkCmdEndDebugUtilsLabelEXT must be matched and balanced.

Until this is fixed, wgpu should ignore this validation error to reduce noise in test runs.

Consult the validation layer's description and version, to filter out only affected versions of the validation layer.

Fixes gfx-rs#3733.

[Vulkan-ValidationLayers#5671]: KhronosGroup/Vulkan-ValidationLayers#5671,
jimblandy added a commit to jimblandy/wgpu that referenced this issue Jun 1, 2023
…fer-01912.

As described in [Vulkan-ValidationLayers#5671], the validation layers don't understand debug ranges paired across different command buffers on the same queue, even though the Vulkan spec says:

> An application may open a debug label region in one command buffer and close it in another, or otherwise split debug label regions across multiple command buffers or multiple queue submissions. When viewed from the linear series of submissions to a single queue, the calls to vkCmdBeginDebugUtilsLabelEXT and vkCmdEndDebugUtilsLabelEXT must be matched and balanced.

Until this is fixed, wgpu should ignore this validation error to reduce noise in test runs.

Consult the validation layer's description and version, to filter out only affected versions of the validation layer.

Fixes gfx-rs#3733.

[Vulkan-ValidationLayers#5671]: KhronosGroup/Vulkan-ValidationLayers#5671,
jimblandy added a commit to jimblandy/wgpu that referenced this issue Jun 1, 2023
…fer-01912.

As described in [Vulkan-ValidationLayers#5671], the validation layers don't understand debug ranges paired across different command buffers on the same queue, even though the Vulkan spec says:

> An application may open a debug label region in one command buffer and close it in another, or otherwise split debug label regions across multiple command buffers or multiple queue submissions. When viewed from the linear series of submissions to a single queue, the calls to vkCmdBeginDebugUtilsLabelEXT and vkCmdEndDebugUtilsLabelEXT must be matched and balanced.

Until this is fixed, wgpu should ignore this validation error to reduce noise in test runs.

Consult the validation layer's description and version, to filter out only affected versions of the validation layer.

Fixes gfx-rs#3733.

[Vulkan-ValidationLayers#5671]: KhronosGroup/Vulkan-ValidationLayers#5671,
@juan-lunarg
Copy link
Contributor

TLDR:

There is some spec confusion that needs ironing out.

For now we are going to remove validation for VUID-vkCmdEndDebugUtilsLabelEXT-commandBuffer-01912 entirely since it's in the wrong place in the spec regardless of current confusion.

I'm also keeping the positive test I've written to prevent a regression.

juan-lunarg added a commit that referenced this issue Jun 2, 2023
This VUID cannot be validated in vkCmdEndDebugUtilsLabelEXT

So I'm adding it to the unimplementable_validation.h file.

My plan is to help fix/clear up the specification.

Meanwhile fixing up this false positive and adding positive
testing to prevent a regression.

closes #5671
@juan-lunarg
Copy link
Contributor

False positive has been addressed and we have added testing to prevent a regression.

We will also need to work on some minor issues in the specification regarding this extension.

Thank you for bring this to our attention.

jimblandy added a commit to jimblandy/wgpu that referenced this issue Jun 6, 2023
…fer-01912

As described in [Vulkan-ValidationLayers#5671], the validation layers don't understand debug ranges paired across different command buffers on the same queue, even though the Vulkan spec says:

> An application may open a debug label region in one command buffer and close it in another, or otherwise split debug label regions across multiple command buffers or multiple queue submissions. When viewed from the linear series of submissions to a single queue, the calls to vkCmdBeginDebugUtilsLabelEXT and vkCmdEndDebugUtilsLabelEXT must be matched and balanced.

Until this is fixed, wgpu should ignore this validation error to reduce noise in test runs.

Fixes gfx-rs#3733.

[Vulkan-ValidationLayers#5671]: KhronosGroup/Vulkan-ValidationLayers#5671
jimblandy added a commit to jimblandy/wgpu that referenced this issue Jun 6, 2023
…fer-01912

As described in [Vulkan-ValidationLayers#5671], the validation layers don't understand debug ranges paired across different command buffers on the same queue, even though the Vulkan spec says:

> An application may open a debug label region in one command buffer and close it in another, or otherwise split debug label regions across multiple command buffers or multiple queue submissions. When viewed from the linear series of submissions to a single queue, the calls to vkCmdBeginDebugUtilsLabelEXT and vkCmdEndDebugUtilsLabelEXT must be matched and balanced.

Until this is fixed, wgpu should ignore this validation error to reduce noise in test runs.

Fixes gfx-rs#3733.

[Vulkan-ValidationLayers#5671]: KhronosGroup/Vulkan-ValidationLayers#5671
cwfitzgerald pushed a commit to gfx-rs/wgpu that referenced this issue Jun 6, 2023
…fer-01912 (#3809)

As described in [Vulkan-ValidationLayers#5671], the validation layers don't understand debug ranges paired across different command buffers on the same queue, even though the Vulkan spec says:

> An application may open a debug label region in one command buffer and close it in another, or otherwise split debug label regions across multiple command buffers or multiple queue submissions. When viewed from the linear series of submissions to a single queue, the calls to vkCmdBeginDebugUtilsLabelEXT and vkCmdEndDebugUtilsLabelEXT must be matched and balanced.

Until this is fixed, wgpu should ignore this validation error to reduce noise in test runs.

Fixes #3733.

[Vulkan-ValidationLayers#5671]: KhronosGroup/Vulkan-ValidationLayers#5671
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants