Repository navigation
Fix GPU queue cleanup, present tracking and output state - #703
Open
DevTechProfile wants to merge 1 commit into
Open
DevTechProfile wants to merge 1 commit into
DevTechProfile wants to merge 1 commit into
Conversation
Contributor
There was a problem hiding this comment.
🔵 Needs a closer look
Active-swapchain pruning can discard buffered rows, and GPU lifecycle recovery still needs human validation of event-ordering assumptions.
1 open issue
What changed in this PR
This PR hardens GPU queue cleanup, DWM present tracking, and console output state. The app-timing and frame-type fixes for #695 remain separate in #702.
Changes:
- Handle hardware-queue stops and reuse, cap queues at 1024 packets, and match lower or wrapped completion sequence IDs.
- Prevent duplicate DWM waiting entries and release the correct dependent present.
- Process reused process IDs without blocking later events and prune swapchains using the newest present timestamp.
| File | Description |
|---|---|
| PresentMon/OutputThread.cpp | Refresh process state after lifecycle events and update pruning timestamps. |
| PresentData/PresentMonTraceSession.cpp | Enable hardware-queue stop events. |
| PresentData/PresentMonTraceConsumer.cpp | Dispatch queue lifecycle events and correct DWM tracking. |
| PresentData/GpuTrace.hpp | Declare timestamp-aware lifecycle and packet-retirement helpers. |
| PresentData/GpuTrace.cpp | Retire abandoned packets, bound queues, and broaden completion matching. |
| PresentData/ETW/Microsoft_Windows_DxgKrnl.h | Define the hardware-queue stop event descriptor. |
Review effort: Balanced
|
|
||
| // Prune any SwapChainData that hasn't seen an update for over 4 seconds. | ||
| PruneOldSwapChainData(pmSession, presentTime); | ||
| PruneOldSwapChainData(pmSession, newestPresentStartTime); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

Missed GPU completions can leave packets running forever and inflate later GPU times. This handles stopped or reused hardware queues, limits each queue to 1024 packets, and allows completions to match lower or wrapped sequence IDs.
It also avoids duplicate DWM entries and releases the correct dependent present. The output thread now handles reused process IDs without holding up later process events, and prunes old swapchains using the newest present timestamp.
Built with VS2022, Debug x64. All 18 checked-in Gold ETL/CSV comparisons and 11 local GPU/DWM regression tests passed.
The two fixes reported in #695 are in #702.