From a7a8ff0532a27b978b421e5da65fa8be99dc10d6 Mon Sep 17 00:00:00 2001 From: rob thijssen Date: Thu, 3 Sep 2026 18:47:17 +0300 Subject: [PATCH] bench: record the memory clock alongside the SM clock (schema 2) The memory clock is a confound like the power limit: locking it at 810 MHz gave +13% on the 4090 at the same watts (lair/quantus#10). Records from before and after that change must be distinguishable. Co-Authored-By: Claude Fable 5.1 Claude-Session: https://claude.ai/code/session_01CBgs2nSi4H2mdh8kD8vMX5 --- crates/bench-harness/src/main.rs | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/crates/bench-harness/src/main.rs b/crates/bench-harness/src/main.rs index 0657457..413dc61 100644 --- a/crates/bench-harness/src/main.rs +++ b/crates/bench-harness/src/main.rs @@ -93,6 +93,10 @@ struct GpuState { power_limit_w: f64, power_draw_w: f64, sm_clock_mhz: f64, + /// The memory clock is a confound like the power limit: the miner never + /// touches VRAM, and a card with memory locked low gives the SMs more of + /// the same power budget (lair/quantus#10). + mem_clock_mhz: f64, temperature_c: f64, } @@ -178,7 +182,7 @@ impl Engine { fn nvidia_smi() -> Vec { let out = Command::new("nvidia-smi") .args([ - "--query-gpu=index,name,driver_version,power.limit,power.draw,clocks.sm,temperature.gpu", + "--query-gpu=index,name,driver_version,power.limit,power.draw,clocks.sm,clocks.mem,temperature.gpu", "--format=csv,noheader,nounits", ]) .output(); @@ -194,7 +198,7 @@ fn nvidia_smi() -> Vec { .lines() .filter_map(|l| { let f: Vec<&str> = l.split(',').map(str::trim).collect(); - if f.len() != 7 { + if f.len() != 8 { return None; } let num = |s: &str| s.parse::().unwrap_or(f64::NAN); @@ -205,7 +209,8 @@ fn nvidia_smi() -> Vec { power_limit_w: num(f[3]), power_draw_w: num(f[4]), sm_clock_mhz: num(f[5]), - temperature_c: num(f[6]), + mem_clock_mhz: num(f[6]), + temperature_c: num(f[7]), }) }) .collect() @@ -414,7 +419,7 @@ fn main() { }; let record = Record { - schema: 1, + schema: 2, timestamp_unix: SystemTime::now() .duration_since(UNIX_EPOCH) .map(|d| d.as_secs()) @@ -461,13 +466,14 @@ fn main() { ); for g in &record.gpu_after { println!( - "- gpu {} {}: driver {}, limit {:.0} W, draw {:.0} W, sm {:.0} MHz, {:.0} C", + "- gpu {} {}: driver {}, limit {:.0} W, draw {:.0} W, sm {:.0} MHz, mem {:.0} MHz, {:.0} C", g.index, g.name, g.driver, g.power_limit_w, g.power_draw_w, g.sm_clock_mhz, + g.mem_clock_mhz, g.temperature_c ); }