Repository navigation
Conversation
3833223 to
8dbdd41
Compare
8dbdd41 to
3e98012
Compare
A display-link wake can precede the texture's slot. Subtracting the slot as unsigned nanoseconds wrapped and wrote a spurious 18.4 trillion ms in the NVN timing trace. Compare the timestamps first and preserve the measured delay for late wakes. The real acquire fixture checks the emitted TSV for a wake 1 ms early and another 1.25 ms late. The early case fails on main. Acquire and snapshot checks, Mac host build, docs and clang-tidy pass. Co-authored-by: Paolo Moretti <1186409+moretti@users.noreply.github.com>
|
The The profiler proposal remains open here. |
|
Thanks, Paolo. The On the M6, the sampler collected GPU power and powered time, but the frequency table was unavailable and the trace reported Please keep the submission-queue counters and automatic drop verdicts out of this revision. A short trace on the original M5 Pro would confirm that the clock samples still line up with frame timing. |
3e98012 to
df76c58
Compare
DM_SYSPROF=<tsv> (Mac, off by default) starts a sampler with the other diagnostic samplers at the host's start: every 100 ms it writes the GPU's mean performance state and, where pmgr's frequency table matches its states, its clock (gpu_pstate, gpu_mhz), its powered share (gpu_on), power (gpu_w), the boost controller's state (gpu_boost), thermal and voltage droop limits (gpu_cltm, gpu_droop), the process role, thermal state and Low Power Mode, read through IOReport without root. Each row is t_s, metric, value: t_s is when the counters were read, in seconds since the host's start, the clock of DM_NVN_TSV's @t_s rows, so the samples line up with the frame rows by time; dt_ms is the interval each sample covers. The sampler waits on a fixed 100 ms grid at user-initiated QoS (at utility QoS macOS coalesced its timer: wakes 20-75 ms late on an M5 Pro). A reading the system does not give is left out on its own and logged once. gpu_mhz is written only when the frequency table has one entry per powered GPU state: an M5 Pro's lists 13 frequencies for its 15 states (P1-P15), so the old mean was biased low there, and an M6 has no table (it wrote 0 MHz). The log then lists pmgr's voltage-states* properties. Each IOReport channel is subscribed on its own (its subgroup, or GPU Energy by name), so a missing one no longer drops the others. Narrowed from the first form of the pull request: no columns in DM_NVN_TSV, no submission-queue counters, no perf_report.py; the @late_ms fix landed as 3984f5a.
df76c58 to
8f7c1fc
Compare
|
@seedds Thanks for the review. I've narrowed this to the Mac sampler and force-pushed, so the PR is now one commit on current main.
One thing I found along the way: my M5 Pro has the same kind of problem. GPUPH has 15 powered states, but The M5 Pro trace is in the description: about 5 minutes of Breath of the Wild with both traces on. |
Summary
Narrowed to the Mac sampler, as asked.
DM_SYSPROF=<file>(off by default, its own switch, separate fromDM_NVN_TSV) writes what macOS did with the GPU and the process every 100 ms. Each sample is stamped on the same clock as the frame trace's@t_s, so with both switches set the two files line up by time.DM_NVN_TSVgpu_mhzonly when the table has one frequency per GPU state;gpu_pstatealwaysperf_report.pyand its verdicts removed@late_msfix removed3984f5aaEvidence
Before (M6):
gpu_mhz 0while the GPU was powered.After (expected from the code, not run on an M6 here): no
gpu_mhzrow. The log names the missing table and lists pmgr'svoltage-states*properties;gpu_pstate,gpu_onand power still come through. A short M6 run would confirm it.M5 Pro trace (Breath of the Wild 1.9.0, MacBook Pro M5 Pro, macOS 27.2, 4 m 46 s with both
DM_SYSPROFandDM_NVN_TSV: 2,862 samples, 16,260 frames):gpu_onagainst the frames' GPU busy share in the same windowgpu_mhzvoltage-states913 frequencies (logged once)Mac host builds; clang-tidy (LLVM 23.1.4, as in CI) clean on the changed files;
test_docspasses.Merge Danger
Door: two-way. Nothing runs unless
DM_SYSPROFis set, and no graphics code changes.Blast Radius: diagnostics.
The sampler thread starts only with the switch set; on iOS the file compiles to an empty stub.
regress.py check --gameswas not run: with the switch unset no new code executes in any game.