skip to content
Arnur Yembergen
← writings
note

Lock the clocks before you trust a number

· 1 min

Same binary, same GPU, two runs a few minutes apart, 3% apart in kernel time. Nothing changed except the card’s thermal state: boost clocks respond to temperature, power headroom, and whatever ran before your benchmark did. A compute-bound kernel scales close to t1/ft \propto 1/f, so unlogged frequency drift lands directly in the result. If the effect you are measuring is smaller than the drift, you measured nothing.

The fix:

sudo nvidia-smi -pm 1 # persistence mode
nvidia-smi -q -d SUPPORTED_CLOCKS # list lockable frequencies
sudo nvidia-smi -lgc 1275 # lock graphics clock (MHz)
./bench
sudo nvidia-smi -rgc # release when done

Pick a frequency the card holds under sustained load, not the top boost bin. Locking at a clock the power or thermal budget cannot sustain reintroduces the throttling you were trying to remove, with extra steps. For bandwidth-bound kernels lock the memory clock too (-lmc), and remember locks do not survive a reboot.

Then report the locked frequency next to every number. “1.8x at 1275 MHz” is a claim; “1.8x” is an anecdote.