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

Replace PipelineMemoryAccess with PipelineStageAccess #2212

Merged
merged 3 commits into from
May 28, 2023

Conversation

Rua
Copy link
Contributor

@Rua Rua commented May 19, 2023

When making the late new command buffer, I introduced the crate-private PipelineStageAccess type to provide the ability to more finely specify the access types of individual commands. It seemed to be still useful for the existing command buffer, and possibly for task graphs later too, so I improved on it and replaced the older PipelineMemoryAccess struct with it.

Copy link
Contributor

@marc0246 marc0246 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe a thing to consider, there already exists a crate that does this sort of thing that most if not all other projects use. Maybe we can use that in the future as well.

@marc0246 marc0246 merged commit 67d3a90 into vulkano-rs:master May 28, 2023
@marc0246
Copy link
Contributor

marc0246 commented Jun 5, 2023

Teleporting here from #2223, where a sync hazard was found originating here.

Looks like this:

2023-06-05.13-19-42.mp4

Here's what the layer gave me:

    Objects: 1
        [0] 0x5589f5e0e6d0, type: 1, name: NULL
Using device: NVIDIA GeForce GTX 1050 (type: DiscreteGpu)
SYNC-HAZARD-WRITE-AFTER-WRITE(ERROR / SPEC): msgNum: 1544472022 - Validation Error: [ SYNC-HAZARD-WRITE-AFTER-WRITE ] Object 0: handle = 0x5589f6e08480, type = VK_OBJECT_TYPE_RENDER_PASS; | Mes
sageID = 0x5c0ec5d6 | vkCmdBeginRenderPass2: Hazard WRITE_AFTER_WRITE in subpass 0 for attachment 0 aspect color during load with loadOp VK_ATTACHMENT_LOAD_OP_CLEAR. Access info (usage: SYNC_CO
LOR_ATTACHMENT_OUTPUT_COLOR_ATTACHMENT_WRITE, prior_usage: SYNC_IMAGE_LAYOUT_TRANSITION, write_barriers: 0, command: vkCmdPipelineBarrier, seq_no: 1, reset_no: 1).
    Objects: 1
        [0] 0x5589f6e08480, type: 18, name: NULL
SYNC-HAZARD-WRITE-AFTER-WRITE(ERROR / SPEC): msgNum: 1544472022 - Validation Error: [ SYNC-HAZARD-WRITE-AFTER-WRITE ] Object 0: handle = 0x5589f6e02e40, type = VK_OBJECT_TYPE_IMAGE; | MessageID
 = 0x5c0ec5d6 | vkCmdPipelineBarrier: Hazard WRITE_AFTER_WRITE for image barrier 0 VkImage 0x5589f6e02e40[]. Access info (usage: SYNC_IMAGE_LAYOUT_TRANSITION, prior_usage: SYNC_COLOR_ATTACHMENT
_OUTPUT_COLOR_ATTACHMENT_WRITE, write_barriers: 0, command: vkCmdEndRenderPass2, seq_no: 6,renderpass: VkRenderPass 0x5589f6e08480[], reset_no: 1).
    Objects: 1
        [0] 0x5589f6e02e40, type: 10, name: NULL
SYNC-HAZARD-WRITE-AFTER-WRITE(ERROR / SPEC): msgNum: 1544472022 - Validation Error: [ SYNC-HAZARD-WRITE-AFTER-WRITE ] Object 0: handle = 0x5589f6e08480, type = VK_OBJECT_TYPE_RENDER_PASS; | Mes
sageID = 0x5c0ec5d6 | vkCmdBeginRenderPass2: Hazard WRITE_AFTER_WRITE in subpass 0 for attachment 0 aspect color during load with loadOp VK_ATTACHMENT_LOAD_OP_CLEAR. Access info (usage: SYNC_CO
LOR_ATTACHMENT_OUTPUT_COLOR_ATTACHMENT_WRITE, prior_usage: SYNC_IMAGE_LAYOUT_TRANSITION, write_barriers: 0, command: vkCmdPipelineBarrier, seq_no: 1, reset_no: 1).
    Objects: 1
        [0] 0x5589f6e08480, type: 18, name: NULL
SYNC-HAZARD-WRITE-AFTER-WRITE(ERROR / SPEC): msgNum: 1544472022 - Validation Error: [ SYNC-HAZARD-WRITE-AFTER-WRITE ] Object 0: handle = 0x5589f67c1e10, type = VK_OBJECT_TYPE_IMAGE; | MessageID
 = 0x5c0ec5d6 | vkCmdPipelineBarrier: Hazard WRITE_AFTER_WRITE for image barrier 0 VkImage 0x5589f67c1e10[]. Access info (usage: SYNC_IMAGE_LAYOUT_TRANSITION, prior_usage: SYNC_COLOR_ATTACHMENT
_OUTPUT_COLOR_ATTACHMENT_WRITE, write_barriers: 0, command: vkCmdEndRenderPass2, seq_no: 5,renderpass: VkRenderPass 0x5589f6e08480[], reset_no: 1).
    Objects: 1
        [0] 0x5589f67c1e10, type: 10, name: NULL
SYNC-HAZARD-WRITE-AFTER-WRITE(ERROR / SPEC): msgNum: 1544472022 - Validation Error: [ SYNC-HAZARD-WRITE-AFTER-WRITE ] Object 0: handle = 0x5589f6e08480, type = VK_OBJECT_TYPE_RENDER_PASS; | Mes
sageID = 0x5c0ec5d6 | vkCmdBeginRenderPass2: Hazard WRITE_AFTER_WRITE in subpass 0 for attachment 0 aspect color during load with loadOp VK_ATTACHMENT_LOAD_OP_CLEAR. Access info (usage: SYNC_CO
LOR_ATTACHMENT_OUTPUT_COLOR_ATTACHMENT_WRITE, prior_usage: SYNC_IMAGE_LAYOUT_TRANSITION, write_barriers: 0, command: vkCmdPipelineBarrier, seq_no: 1, reset_no: 1).
    Objects: 1
        [0] 0x5589f6e08480, type: 18, name: NULL
SYNC-HAZARD-WRITE-AFTER-WRITE(ERROR / SPEC): msgNum: 1544472022 - Validation Error: [ SYNC-HAZARD-WRITE-AFTER-WRITE ] Object 0: handle = 0x5589f6e02e40, type = VK_OBJECT_TYPE_IMAGE; | MessageID
 = 0x5c0ec5d6 | vkCmdPipelineBarrier: Hazard WRITE_AFTER_WRITE for image barrier 0 VkImage 0x5589f6e02e40[]. Access info (usage: SYNC_IMAGE_LAYOUT_TRANSITION, prior_usage: SYNC_COLOR_ATTACHMENT
_OUTPUT_COLOR_ATTACHMENT_WRITE, write_barriers: 0, command: vkCmdEndRenderPass2, seq_no: 6,renderpass: VkRenderPass 0x5589f6e08480[], reset_no: 1).
    Objects: 1
        [0] 0x5589f6e02e40, type: 10, name: NULL
SYNC-HAZARD-WRITE-AFTER-WRITE(ERROR / SPEC): msgNum: 1544472022 - Validation Error: [ SYNC-HAZARD-WRITE-AFTER-WRITE ] Object 0: handle = 0x5589f6e08480, type = VK_OBJECT_TYPE_RENDER_PASS; | Mes
sageID = 0x5c0ec5d6 | vkCmdBeginRenderPass2: Hazard WRITE_AFTER_WRITE in subpass 0 for attachment 0 aspect color during load with loadOp VK_ATTACHMENT_LOAD_OP_CLEAR. Access info (usage: SYNC_CO
LOR_ATTACHMENT_OUTPUT_COLOR_ATTACHMENT_WRITE, prior_usage: SYNC_IMAGE_LAYOUT_TRANSITION, write_barriers: 0, command: vkCmdPipelineBarrier, seq_no: 1, reset_no: 1).
    Objects: 1
        [0] 0x5589f6e08480, type: 18, name: NULL
SYNC-HAZARD-WRITE-AFTER-WRITE(ERROR / SPEC): msgNum: 1544472022 - Validation Error: [ SYNC-HAZARD-WRITE-AFTER-WRITE ] Object 0: handle = 0x5589f67c1e10, type = VK_OBJECT_TYPE_IMAGE; | MessageID
 = 0x5c0ec5d6 | vkCmdPipelineBarrier: Hazard WRITE_AFTER_WRITE for image barrier 0 VkImage 0x5589f67c1e10[]. Access info (usage: SYNC_IMAGE_LAYOUT_TRANSITION, prior_usage: SYNC_COLOR_ATTACHMENT
_OUTPUT_COLOR_ATTACHMENT_WRITE, write_barriers: 0, command: vkCmdEndRenderPass2, seq_no: 5,renderpass: VkRenderPass 0x5589f6e08480[], reset_no: 1).
    Objects: 1
        [0] 0x5589f67c1e10, type: 10, name: NULL
SYNC-HAZARD-WRITE-AFTER-WRITE(ERROR / SPEC): msgNum: 1544472022 - Validation Error: [ SYNC-HAZARD-WRITE-AFTER-WRITE ] Object 0: handle = 0x5589f6e08480, type = VK_OBJECT_TYPE_RENDER_PASS; | Mes
sageID = 0x5c0ec5d6 | vkCmdBeginRenderPass2: Hazard WRITE_AFTER_WRITE in subpass 0 for attachment 0 aspect color during load with loadOp VK_ATTACHMENT_LOAD_OP_CLEAR. Access info (usage: SYNC_CO
LOR_ATTACHMENT_OUTPUT_COLOR_ATTACHMENT_WRITE, prior_usage: SYNC_IMAGE_LAYOUT_TRANSITION, write_barriers: 0, command: vkCmdPipelineBarrier, seq_no: 1, reset_no: 1).
    Objects: 1
        [0] 0x5589f6e08480, type: 18, name: NULL
SYNC-HAZARD-WRITE-AFTER-WRITE(ERROR / SPEC): msgNum: 1544472022 - Validation Error: [ SYNC-HAZARD-WRITE-AFTER-WRITE ] Object 0: handle = 0x5589f6e02e40, type = VK_OBJECT_TYPE_IMAGE; | MessageID
 = 0x5c0ec5d6 | vkCmdPipelineBarrier: Hazard WRITE_AFTER_WRITE for image barrier 0 VkImage 0x5589f6e02e40[]. Access info (usage: SYNC_IMAGE_LAYOUT_TRANSITION, prior_usage: SYNC_COLOR_ATTACHMENT
_OUTPUT_COLOR_ATTACHMENT_WRITE, write_barriers: 0, command: vkCmdEndRenderPass2, seq_no: 6,renderpass: VkRenderPass 0x5589f6e08480[], reset_no: 1).
    Objects: 1
        [0] 0x5589f6e02e40, type: 10, name: NULL

@Rua
Copy link
Contributor Author

Rua commented Jun 5, 2023

So weird that I don't get any of these errors.

@Rua
Copy link
Contributor Author

Rua commented Jun 5, 2023

Here's a dump of me running the indirect example, with the API dump and validation layers enabled.

dump.txt

@marc0246
Copy link
Contributor

marc0246 commented Jun 6, 2023

My bad, those validation errors are caused by something older still. I'll make sure to track that down sometime soon, just ignore that.

@marc0246
Copy link
Contributor

marc0246 commented Jun 6, 2023

Here's my dump: dump.txt

@Rua
Copy link
Contributor Author

Rua commented Aug 8, 2023

Here's my dump: dump.txt

This dump only contains the API calls, not the validation errors that occur as they are called. I really need both as a single stream to be able to correlate them together.

@Rua Rua deleted the pipelinestageaccess branch October 25, 2023 14:25
hakolao pushed a commit to hakolao/vulkano that referenced this pull request Feb 20, 2024
…#2212)

* Replace `PipelineMemoryAccess` with `PipelineStageAccess`

* Rename `is_2` to something better

* Missed rename
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants