Issue 5568 in angleproject: Vulkan: Aztec Ruins triggers validation errors

300 views
Skip to first unread message

cnort… via monorail

unread,
Jan 20, 2021, 12:24:41 PM1/20/21
to angleproj...@googlegroups.com
Status: Accepted
Owner: ----
Components: API>GLES31
OS: Android
Priority: Medium
Renderer: Vulkan
Type: Defect

New issue 5568 by cnor...@google.com: Vulkan: Aztec Ruins triggers validation errors
https://bugs.chromium.org/p/angleproject/issues/detail?id=5568

The Aztec Ruins benchmark in GFXBench is triggering a number of validation errors on ANGLE with the Vulkan backend. This is leading to crashes on some vendors.

What steps will reproduce the problem?

1. Install gfxbench

adb install gfxbench-5.0.0-1030+corporate.arm64-v8a.armeabi-v7a.x86.x86_64.apk

2. Enable validation layers in the ANGLE build with the following GN arg:

angle_enable_vulkan_validation_layers = true

3. Opt the app into ANGLE

adb shell settings put global angle_debug_package org.chromium.angle
adb shell settings put global angle_gl_driver_selection_pkgs net.kishonti.gfxbench.v50000.corporate
adb shell settings put global angle_gl_driver_selection_values angle

4. Enable vulkan validation layers for the app

adb shell settings put global enable_gpu_debug_layers 1
adb shell settings put global gpu_debug_app net.kishonti.gfxbench.v50000.corporate
adb shell settings put global gpu_debug_layer_app org.chromium.angle
adb shell settings put global gpu_debug_layers VK_LAYER_KHRONOS_validation

5. Run the "Aztec Ruins OpenGL (Normal Tier)" test

Can be started over adb with:
adb shell am broadcast -a net.kishonti.testfw.ACTION_RUN_TESTS -n net.kishonti.gfxbench.v50000.corporate/net.kishonti.benchui.corporate.CommandLineSession -e test_ids "gl_5_normal" --ei raw_config.frame_step_time 40

6. See validation errors in logcat.

For ease of debugging, there is also an ANGLE trace of the benchmark available here:
https://chromium-review.googlesource.com/c/angle/angle/+/2634206


Here is a list of the errors I'm seeing on Android with the full app:

Validation Error: [ VUID-vkCmdDrawIndexed-None-02699 ] Object 0: handle = 0x214c000000214c, type = VK_OBJECT_TYPE_DESCRIPTOR_SET; | MessageID = 0xa44449d4 | VkDescriptorSet 0x214c000000214c[] encountered the following validation error at vkCmdDrawIndexed() time: Image layout specified at vkUpdateDescriptorSet* or vkCmdPushDescriptorSet* time doesn't match actual image layout at time descriptor is used. See previous error callback for specific details. The Vulkan spec states: Descriptors in each bound descriptor set, specified via vkCmdBindDescriptorSets, must be valid if they are statically used by the VkPipeline bound to the pipeline bind point used by this command (https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#VUID-vkCmdDrawIndexed-None-02699)

Validation Error: [ VUID-VkDescriptorImageInfo-imageLayout-00344 ] Object 0: handle = 0x7b290e1170, type = VK_OBJECT_TYPE_COMMAND_BUFFER; | MessageID = 0xde55a405 | vkCmdDrawIndexed(): Cannot use VkImage 0x8320000000832[] (layer=0 mip=0) with specific layout VK_IMAGE_LAYOUT_SHADER_READ_ONLY_OPTIMAL that doesn't match the previous known layout VK_IMAGE_LAYOUT_COLOR_ATTACHMENT_OPTIMAL. The Vulkan spec states: imageLayout must match the actual VkImageLayout of each subresource accessible from imageView at the time this descriptor is accessed as defined by the image layout matching rules (https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#VUID-VkDescriptorImageInfo-imageLayout-00344)

VALIDATION: UNASSIGNED-CoreValidation-DrawState-InvalidImageLayout(ERROR / SPEC): msgNum: 1303270965 - Validation Error: [ UNASSIGNED-CoreValidation-DrawState-InvalidImageLayout ] Object 0: handle = 0x7b290e1170, type = VK_OBJECT_TYPE_COMMAND_BUFFER; | MessageID = 0x4dae5635 | Submitted command buffer expects VkImage 0x8320000000832[] (subresource: aspectMask 0x1 array layer 0, mip level 0) to be in layout VK_IMAGE_LAYOUT_SHADER_READ_ONLY_OPTIMAL--instead, current layout is VK_IMAGE_LAYOUT_COLOR_ATTACHMENT_OPTIMAL.

VALIDATION: UNASSIGNED-CoreValidation-DrawState-InvalidRenderpass(ERROR / SPEC): msgNum: 169239225 - Validation Error: [ UNASSIGNED-CoreValidation-DrawState-InvalidRenderpass ] Object 0: handle = 0x7b290e1270, type = VK_OBJECT_TYPE_DEVICE; | MessageID = 0xa1662b9 | You cannot start a render pass using attachment 0 where the render pass initial layout is VK_IMAGE_LAYOUT_COLOR_ATTACHMENT_OPTIMAL and the previous known layout of the attachment is VK_IMAGE_LAYOUT_SHADER_READ_ONLY_OPTIMAL. The layouts must match, or the render pass initial layout for the attachment must be VK_IMAGE_LAYOUT_UNDEFINED

VALIDATION: VUID-VkImageMemoryBarrier-oldLayout-01197(ERROR / SPEC): msgNum: 307231540 - Validation Error: [ VUID-VkImageMemoryBarrier-oldLayout-01197 ] Object 0: handle = 0x7b290c0f70, type = VK_OBJECT_TYPE_COMMAND_BUFFER; | MessageID = 0x124ffb34 | vkCmdPipelineBarrier(): For VkImage 0x8320000000832[] you cannot transition the layout of aspect=1 level=0 layer=0 from VK_IMAGE_LAYOUT_COLOR_ATTACHMENT_OPTIMAL when the previous known layout is VK_IMAGE_LAYOUT_SHADER_READ_ONLY_OPTIMAL. The Vulkan spec states: If srcQueueFamilyIndex and dstQueueFamilyIndex define a queue family ownership transfer or oldLayout and newLayout define a image layout transition, oldLayout must be VK_IMAGE_LAYOUT_UNDEFINED or the current layout of the image subresources affected by the barrier (https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#VUID-VkImageMemoryBarrier-oldLayout-01197)

--
You received this message because:
1. The project was configured to send all issue notifications to this address

You may adjust your notification preferences at:
https://bugs.chromium.org/hosting/settings

cnort… via monorail

unread,
Mar 2, 2021, 12:25:26 PM3/2/21
to angleproj...@googlegroups.com
Updates:
Components: AppCompat

Comment #1 on issue 5568 by cnor...@google.com: Vulkan: Aztec Ruins triggers validation errors
https://bugs.chromium.org/p/angleproject/issues/detail?id=5568#c1

(No comment was entered for this change.)

cnort… via monorail

unread,
Mar 2, 2021, 4:26:21 PM3/2/21
to angleproj...@googlegroups.com
Updates:
Owner: cc...@google.com

Comment #2 on issue 5568 by cnor...@google.com: Vulkan: Aztec Ruins triggers validation errors
https://bugs.chromium.org/p/angleproject/issues/detail?id=5568#c2

Charlie is going to take a look at this.

cc… via monorail

unread,
Mar 12, 2021, 8:00:59 PM3/12/21
to angleproj...@googlegroups.com

Comment #3 on issue 5568 by cc...@google.com: Vulkan: Aztec Ruins triggers validation errors
https://bugs.chromium.org/p/angleproject/issues/detail?id=5568#c3

The application is texture from and render into the same texture, but with different level. It renders to level 1 and use textureLOD read from level 0. So techically there is no feedback loop involved since read/render are on two different level.

There are mainly two validation errors involved:
1) Layout related error, as Cody pasted above.
The main problem is that when we start renderpass, we insert an image barrier to transit t to COLOR_ATTACHMENT. Then we see it attached to texture unit, we transit it to SHADER_READ. Then when we endRenderPass, we call executeBarrier before renderpass, which means the renderpass will see image at SHADER_READ layout, but the renderpass is rendering to it and the RP's attachment layout says it is in COLOR_ATTACHMENT, so everything is screwed up at this point.

2) Even if I fix the above error, there is another validation error, which is VUID-vkCmdDraw-None-04584: "The Vulkan spec states: Image subresources used as attachments in the current render pass must not be accessed in any way other than as an attachment by this command, except for cases involving read-only access to depth/stencil attachments as described in the Render Pass chapter ". I don't think we have a way to get rid of this validation error. What I am proposing here is simply silence this.

To fix 1), we need to defer the layout determination to the endRenderPass time, similar to depth stencil buffers. I am currently debugging a WIP CL for this.

cc… via monorail

unread,
Mar 24, 2021, 4:06:52 PM3/24/21
to angleproj...@googlegroups.com

Comment #4 on issue 5568 by cc...@google.com: Vulkan: Aztec Ruins triggers validation errors
https://bugs.chromium.org/p/angleproject/issues/detail?id=5568#c4

Fixed all checked in. Details see https://buganizer.corp.google.com/issues/175584609

cc… via monorail

unread,
Mar 24, 2021, 4:07:19 PM3/24/21
to angleproj...@googlegroups.com
Updates:
Status: Fixed

Comment #5 on issue 5568 by cc...@google.com: Vulkan: Aztec Ruins triggers validation errors
https://bugs.chromium.org/p/angleproject/issues/detail?id=5568#c5


(No comment was entered for this change.)

Reply all
Reply to author
Forward
0 new messages