Skip to content

Host profiler: the GPU clock, its limits and the process role in each frame's timing rows, and a report of one session - #1041

Open
moretti wants to merge 1 commit into
seedds:mainfrom
moretti:host-profiler
Open

moretti wants to merge 1 commit into
seedds:mainfrom
moretti:host-profiler

Conversation

@moretti

@moretti moretti commented Nov 3, 2026 •

Copy link
Copy Markdown
Contributor

Split out of #930 (1 of 4).

Summary

With DM_NVN_TSV set (off by default), a sampler records each frame's GPU clock, its limits and the process role in the frame's timing rows. A report script turns one session into a per-second timeline that says why each drop below the cap happened. That is how the other three PRs split out of #930 were found and checked.

dm/host/sysprof.m     every 100 ms, no root (IOReport through dlopen; Mac only)
  @gpu_mhz @gpu_on    GPU clock, share of time powered (powered is not busy)
  @gpu_w              GPU power
  @gpu_boost          clock state the boost controller asked for
  @gpu_cltm @gpu_droop  share of time a thermal / voltage-droop limit applied
  @role @thermal @low_power   process role (a change is logged), thermal state, Low Power Mode
  @ab                 with DM_AB: the switches on in the frame's phase
dm/tools/perf_report.py   one session -> timeline per second, a verdict per drop
                          (cpu, gpu-clock, gpu-limit, gpu, role, pacing); with DM_AB compares
                          the switch sets over the same session

Also: @late_ms no longer underflows when a display-link tick returns before the texture's slot time.

Documented in docs/development.md ("Why a frame rate fell: one session's profile").

Evidence

Merge Danger

Door: two-way. It does nothing unless DM_NVN_TSV is set.

Blast Radius: diagnostics.

The weak dm_sysprof_* stubs in hle_nvn.c keep the graphics unit tests linking without sysprof.m.

regress.py impact: Breath of the Wild, Pokémon Scarlet and Tears of the Kingdom reach the changed present code (the rows are only written with DM_NVN_TSV). Hades is reached through the host Makefile rule. None of them is on this machine, so regress.py check --games was not run.

@github-actions github-actions Bot added host The Horizon host: SVCs, services, threads, memory (dm/host) nvn NVN on Metal and its tests (dm/gfx/nvn, dm/gfx/tests) tools Tools and scripts (dm/tools, scripts) docs Documentation labels Nov 3, 2026
… frame's timing rows, and a report of one session

With DM_NVN_TSV set (off by default), dm/host/sysprof.m samples every 100 ms, without root, what the
system did with the game's GPU and process (IOReport through dlopen; Mac only): the GPU clock and the
share of time it was powered (@gpu_mhz, @gpu_on; powered is not busy), its power (@gpu_w), the clock
state the boost controller asked for (@gpu_boost), the share of time a thermal or voltage-droop limit
applied (@gpu_cltm, @gpu_droop), the process role (@ROLE), the thermal state and Low Power Mode. With
DM_AB, @ab gives the switches on in the frame's phase. A change of role is logged.

dm/tools/perf_report.py turns one session into a timeline per second and gives each drop below the cap
a verdict (cpu, gpu-clock, gpu-limit, gpu, role, pacing); with DM_AB it compares the switch sets over
the same session, so one run answers what several runs used to.

Also: @late_ms no longer underflows when a display-link tick returns before the texture's slot time.

Documented in docs/development.md (Why a frame rate fell: one session's profile).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

docs Documentation host The Horizon host: SVCs, services, threads, memory (dm/host) nvn NVN on Metal and its tests (dm/gfx/nvn, dm/gfx/tests) tools Tools and scripts (dm/tools, scripts)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant