Skip to content

Fix GPU queue cleanup, present tracking and output state - #703

Open
DevTechProfile wants to merge 1 commit into
GameTechDev:mainfrom
DevTechProfile:codex/fix-gpu-present-output-tracking
Open

DevTechProfile wants to merge 1 commit into
GameTechDev:mainfrom
DevTechProfile:codex/fix-gpu-present-output-tracking

Conversation

@DevTechProfile

Copy link
Copy Markdown
Contributor

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.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🔵 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);
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