From 53e2b110a9ec78514217913049d6a5b6ed76f73f Mon Sep 17 00:00:00 2001 From: wmantly Date: Wed, 2 Sep 2026 00:05:23 +0000 Subject: [PATCH] Enhancement: Integrate NVAPI P8 deep idle downclocking into power governor script --- scripts/power-governor.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/scripts/power-governor.py b/scripts/power-governor.py index 5142096..c2318d0 100755 --- a/scripts/power-governor.py +++ b/scripts/power-governor.py @@ -69,14 +69,18 @@ def main(): if active: last_active = now if is_low_power: + run_cmd("python3", "/opt/turing-multi-gpu-llm-server/tools/cmp-pstate.py", "--bus-id", "00000000:07:00.0", "--pstate", "16") + run_cmd("python3", "/opt/turing-multi-gpu-llm-server/tools/cmp-pstate.py", "--bus-id", "00000000:21:00.0", "--pstate", "16") run_cmd("nvidia-smi", f"-i={CMP_GPUS}", "-rgc") is_low_power = False - print(f"[{time.strftime('%X')}] Inference Active -> Boost clocks engaged (1900 MHz)", flush=True) + print(f"[{time.strftime('%X')}] Inference Active -> Boost clocks engaged (P0/P16, 1900 MHz)", flush=True) else: if not is_low_power and (now - last_active) > IDLE_TIMEOUT_SEC: + run_cmd("python3", "/opt/turing-multi-gpu-llm-server/tools/cmp-pstate.py", "--bus-id", "00000000:07:00.0", "--pstate", "8") + run_cmd("python3", "/opt/turing-multi-gpu-llm-server/tools/cmp-pstate.py", "--bus-id", "00000000:21:00.0", "--pstate", "8") run_cmd("nvidia-smi", f"-i={CMP_GPUS}", f"-lgc={LOW_POWER_CLOCK},{LOW_POWER_CLOCK}") is_low_power = True - print(f"[{time.strftime('%X')}] Inference Idle (> {IDLE_TIMEOUT_SEC}s) -> Low-power state engaged (300 MHz, ~32W/card)", flush=True) + print(f"[{time.strftime('%X')}] Inference Idle (> {IDLE_TIMEOUT_SEC}s) -> Deep low-power state engaged (NVAPI P8 + 300 MHz)", flush=True) time.sleep(0.5 if is_low_power else 1.5) except Exception as e: