Repository navigation
gpu-freq-sampler: stop writing to amdgpu's SMU mailbox - #130
Merged
Merged
Conversation
The sampler sent 0x0E/0x0F on "queue 0" through the SMN window, at 0x03B10A08/48/68. Those are C2PMSG_66/82/90, the mailbox amdgpu itself uses through MMIO under its own mutex, which knows nothing about our flock. Every 2 s it cleared the response register and wrote its own command, which can land in the middle of a driver message such as the metrics table export. The bc250_smu library refuses queue 0 by default for the same reason. It is not needed either: patch 0125 has the driver answer current_gfxclk with QueryGfxclk under its lock, so gpu_metrics offset 76, hwmon freq1_input and pp_dpm_sclk all carry the real clock (checked on 7.3.4, same value as the old mailbox read). The sampler now takes the clock and the three power figures from the one gpu_metrics read it already did, and opens nothing in PCI config space. The unit's path condition follows: gpu_metrics instead of the root device's config space. Comments that described the old behaviour are updated, and translated where touched. Tests: tests/test_gpu_freq_sampler.py keeps the SMN window and the queue-0 addresses out of the code and checks the published values.
Owner
Author
|
Overnight check on the .32 with the new sampler: 0 |
MTSistemi
added a commit
that referenced
this pull request
Nov 15, 2026
#133) * control-center, remote-manager: FreeFG frame generation per game FreeFG (daniel-h-0, MIT) adds Intel's XeSS frame generation with shaders written for the BC-250, plus FSR 4, through OptiScaler, one game at a time. Measured on bc250-dev, Cyberpunk 1080p: 130-133 fps shown against a bench median of 90.7, 1% lows 30-34; the game's own rate stays near 65. sfcc/freefg.py (no Qt) does the work and is run as a separate process, as the desktop user, by the Games page, by the Remote Manager and by the new skillfish-freefg command: - the release is pinned (1.4.0) with its sha256 and unpacked with bsdtar into ~/.local/share/skillfish/freefg; libarchive-tools is recommended; - the game list is FreeFG's own scan (Steam, Heroic stores) plus Heroic's sideloaded games, each with FreeFG's verdict; - installing first sets PROTON_USE_OPTISCALER and PROTON_FSR4_UPGRADE to 0 in that game's launcher entry, keeping what was there: our FSR 4 switch sets them to 1 launcher-wide, and GE-Proton would then load its own OptiScaler as dxgi.dll over FreeFG's. GE reads them with nonzero(), and the entry wins over the flatpak override. Then FreeFG installs with its BC-250 FSR 4, the automatic input and never NVIDIA's DLL. Removing runs FreeFG's restore and puts the entry back as it was. The Games page gets a Frame generation card (download, game list with the verdict, install, remove); web/giochi.html gets the same panel. The daemon runs freefg.py through runuser as the desktop user and accepts a game only if it is in the list FreeFG returns, never a free path from the network. The Control Center dictionaries are merged into the shared ones with unisci-i18n.py: the FreeFG strings, the two from the GE-Proton fix (#132) that had not reached them, and one older AI string. Only additions; the tool sorts the files. Tested on bc250-dev: download and hash, list (5 games), install into Cyberpunk with GE FSR 4 on launcher-wide and in the game, one launch (GE stays out: PROTON_*=0 in the game's environment, FreeFG active), one bench run (132.1 fps), removal (Heroic entry byte-identical to before, no FreeFG file left, 0 GPU errors). The dashboard functions run as root: refusal of a path outside the list and of an unknown action, install and remove, files owned by the user. Card rendered offscreen. tests/test_cc_freefg.py covers the entry edits and the pinning. * Release 26.11.3: notes in 9 languages, site news, SECURITY.md skillfish-base: the GPU sampler no longer races the driver's SMU mailbox (#130). skillfish-control-center: FreeFG frame generation, GE-Proton 11-12 folder and checksum (#132). Remote Manager: FreeFG on the web Games page.
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.
What
skillfish-gpu-freq-samplerno longer talks to the SMU itself. It reads the GPU clock and the three power figures from the singlegpu_metricsread it already did every 2 s, and publishes/run/skillfish-gpu-freqand/run/skillfish-potenzeas before.Why
The sampler sent
0x0E/0x0Fon "queue 0" through the SMN window (PCI config0xB8/0xBCof00:00.0), at0x03B10A08/48/68. Those areC2PMSG_66/82/90: the mailbox amdgpu itself uses through MMIO under its own mutex. Our flock does not serialize anything against the driver: every 2 s the sampler cleared the response register and wrote its own command, which can land in the middle of a driver message such as the metrics table export. The upstreambc250_smulibrary refuses queue 0 by default for the same reason.The direct read is not needed anymore: patch 0125 makes the driver answer
current_gfxclkwithQueryGfxclkunder its lock. On 7.3.4,gpu_metricsoffset 76, hwmonfreq1_inputandpp_dpm_sclkall show the same value as the old mailbox read (1850 MHz under load, 350 MHz idle).Context
On the .32,
Failed to export SMU metrics table!shows up on almost every boot since October (up to 66 per boot, on 7.2.9 and 7.3.4). In 7.3 that line with noSMU: No responsebefore it means the SMU answeredCMD_FAIL(0xFF), not a timeout, so it is not the display-freezing hang described in the community guide. An 8-minute A/B test at 10 Hzgpu_metricsreads showed 0 failures with and without the old sampler, which is too short to settle whether the sampler causes them. The new sampler is running on the .32 overnight to compare the rate (baseline: 10 failures in ~8 h with the old one).Tests
tests/test_gpu_freq_sampler.py(new, 5 tests): no SMN window or queue-0 address in the code, power line and clock read from the measured offsets, a table of another format is not trusted./runfiles updated every 2 s, values equal topp_dpm_sclkand hwmon, PCI config not open.