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

Breadcrumbs report race conditions w/ Vulkan Validation Layers #98338

Closed
darksylinc opened this issue Oct 19, 2024 · 0 comments · Fixed by #98425
Closed

Breadcrumbs report race conditions w/ Vulkan Validation Layers #98338

darksylinc opened this issue Oct 19, 2024 · 0 comments · Fixed by #98425

Comments

@darksylinc
Copy link
Contributor

Tested versions

4.4-master

System information

Godot v4.4.dev (1a34f5d) - Ubuntu 24.04.1 LTS 24.04 on X11 - X11 display driver, Multi-window, 2 monitors - Vulkan (Mobile) - dedicated AMD Radeon RX 6800 XT (RADV NAVI21) - AMD Ryzen 9 5900X 12-Core Processor (24 threads)

Issue description

My PR #90993 introduced TheForge's code for breadcrumbs.

But as @DarioSamo pointed out, the problem is that when Validation Layers are set to "synchronization" debugging, it spams the log.

The problem arises from the fact that breadcrumbs are always writing to the same 4-byte region from the GPU without any barriers.

Adding barriers is undesired because this functionality is there merely to aid developers understand what Godot was doing on the GPU when device was lost; making error reports much friendlier. It should not penalize performance.

Solution:

  1. Make the breadcrumb buffer an ever-growing buffer, until frame reset. On report, we report the last N breadcrumbs.
    • The buffer should have a tweakable hard limit on how much it can grow. If it does we'll warn it was exceeded and wrap around (which will unavoidable cause a validation warning).
  2. Add an --accurate-breadcrumb flag that will force a full barrier between each breadcrumb command. This ensures the breadcrumb is 100% accurate and make it much easier to identify the offending command.

Steps to reproduce

  1. Open vkconfig and set it to sync validation.
  2. Run Godot with --gpu-validation

IMPORTANT

I will implement this. This ticket is for tracking the problem.

Minimal reproduction project (MRP)

N / A

@darksylinc darksylinc changed the title Breadcrumbs report race conditions in Vulkan Validation Layers Breadcrumbs report race conditions w/ Vulkan Validation Layers Oct 19, 2024
@AThousandShips AThousandShips added this to the 4.4 milestone Oct 25, 2024
laurentmackay pushed a commit to metapfhor/godot that referenced this issue Oct 30, 2024
Adds "--accurate-breadcrumbs" CLI command

Additionally, leave out breadcrumbs code in non-debug, non-dev builds.
Fix regression introduced in godotengine#98388 where command_insert_breadcrumb() is
called even in non-debug builds.

Fixes godotengine#98338
MarcusPaulsson pushed a commit to MarcusPaulsson/godot that referenced this issue Nov 5, 2024
Adds "--accurate-breadcrumbs" CLI command

Additionally, leave out breadcrumbs code in non-debug, non-dev builds.
Fix regression introduced in godotengine#98388 where command_insert_breadcrumb() is
called even in non-debug builds.

Fixes godotengine#98338
JayTropper pushed a commit to JayTropper/godot that referenced this issue Nov 6, 2024
Adds "--accurate-breadcrumbs" CLI command

Additionally, leave out breadcrumbs code in non-debug, non-dev builds.
Fix regression introduced in godotengine#98388 where command_insert_breadcrumb() is
called even in non-debug builds.

Fixes godotengine#98338
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants