feat(host/linux): amdgpu session clock pin — gpuclocks grows the AMD arm

nvclocks.rs -> gpuclocks.rs. PUNKTFUNK_PIN_CLOCKS=1 now also pins every
amdgpu card's power_dpm_force_performance_level to high for the host
lifetime (prior level restored on exit) — the measured AMD encode-
latency lever: VCN per-frame time doubles when a 60fps paced trickle
lets clocks sag (8 -> 4.4ms/frame at 1440p on the 780M with clocks
hot). Root-gated by sysfs ownership; non-root degrades to a logged
recipe (validated live on the AMD box). Opt-in stays deliberate:
box-wide power-management override, wrong on battery/Deck.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
2026-07-02 13:03:04 +00:00
parent fd1086074b
commit fa4c798a25
2 changed files with 135 additions and 30 deletions
+4 -4
View File
@@ -33,6 +33,9 @@ mod drm_sync;
mod encode;
mod gamestream;
mod gpu;
#[cfg(target_os = "linux")]
#[path = "linux/gpuclocks.rs"]
mod gpuclocks;
mod hdr;
mod inject;
#[cfg(target_os = "windows")]
@@ -45,9 +48,6 @@ mod library;
mod mgmt;
mod mgmt_token;
mod native_pairing;
#[cfg(target_os = "linux")]
#[path = "linux/nvclocks.rs"]
mod nvclocks;
mod pipeline;
mod punktfunk1;
mod pwinit;
@@ -135,7 +135,7 @@ fn real_main() -> Result<()> {
// exit via the guard's Drop). No-op off NVIDIA / on the tool subcommands.
#[cfg(target_os = "linux")]
let _nv_clocks = match args.first().map(String::as_str) {
Some("serve") | Some("punktfunk1-host") => nvclocks::on_host_start(),
Some("serve") | Some("punktfunk1-host") => gpuclocks::on_host_start(),
_ => None,
};