Repository navigation
feat(mac): a GPU keep-alive switch on the settings panel's Display page - #2049
Merged
Merged
Conversation
The keep-alive's spin kernels hold the GPU clock up between frames. On a Mac whose GPU keeps its clock with the game's own work they add heat and power but no frame (an M4 Max at 60+60 interpolation: ~90 % GPU busy with them, ~63 % without, the same frames), and only TOTK_GPU_KEEPALIVE=0 turned them off. The switch turns them on or off at once (dm_gfx_keepalive_set; a thread switched off only sleeps) and is saved in gpu-keepalive.txt above the game's folder, shared by both games. TOTK_GPU_KEEPALIVE decides first and greys the row out. Defaults unchanged: on on the Mac, off on iOS. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01AHfZGAk8x4FhGRe2CKhfVf
ly05010419
added a commit
that referenced
this pull request
Nov 10, 2026
…ctions (after PR #2049) settings_panel.h now calls dm_gfx_keepalive_start and its row's getters; the fixture text_keyboard includes had only the anisotropy stubs, so its three tests failed to link. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Owner
|
Merged and pushed — thank you. One follow-up after it (45f1f48): |
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.
Why
The GPU keep-alive runs short spin kernels between frames so the GPU never drops its clock. That helps a Mac whose GPU slows down while it waits for the next frame: the measurement in
keepalive_startwas on an M4, where the frame's GPU work ran about 25 % faster with it.On a stronger Mac, the game's own work keeps the clock up anyway. There the spinner adds heat and power use but no frames. On a MacBook Pro M4 Max (36 GB) running Breath of the Wild 1.9.0 at 1080p + MetalFX with 60+60 interpolation, I measured:
These numbers come from a 2-minute recording with the switch flipped back and forth in the same spot. Each flip changed the load within one second. With the keep-alive off I lost no frames, the laptop ran noticeably cooler, and over several days of play the game felt as smooth as with it on, or smoother. Until now the only way to turn it off was
TOTK_GPU_KEEPALIVE=0in the environment, which most players never set.What
gpu-keepalive.txtin the folder above the game's, shared by both games likefps-graph.txt, and is read before the guest starts.TOTK_GPU_KEEPALIVEstill decides first. When it is set, the row is greyed out and shows its value.nvn_mtl.m: newdm_gfx_keepalive,dm_gfx_keepalive_locked,dm_gfx_keepalive_startanddm_gfx_keepalive_set, in the same pattern asdm_gfx_aniso_*. The spinner loop now checks the switch.tests/settings_panel_probe.m: stubs for the four new functions.Testing
GPU keep-alive: on/off from the settings panel.GPU 保活 至帧 …) appears only while the switch is on.main(9fe3fdc) and defaults to off. This PR keeps upstream's default (on on the Mac). I have not played a build of this exact branch.nvn_mtl.mcompiles for the Mac and iOS, for both TotK and BotW 1.9.0, withclang -fsyntax-only.tests.test_settings_panel,tests.test_frame_lock,tests.test_botw_effectsandtests.test_state_report.test_current_modes_and_refreshstill fail, but they fail the same way onmain(d237386) without this change:NSRangeException: -[__NSSingleObjectArrayI objectAtIndex:]: index 1 beyond bounds [0 .. 0]at the same place inmain.update_probe.🤖 Generated with Claude Code
https://claude.ai/code/session_01AHfZGAk8x4FhGRe2CKhfVf