From 5dacd41fca518fedfc27a42aace87db143dcfbfc Mon Sep 17 00:00:00 2001 From: Pavlo Ratushnyi Date: Wed, 28 Oct 2026 02:32:17 +0100 Subject: [PATCH] chore: add laptop-turbo.ps1 to prepare the laptop for measurement runs Activates the ASUS Turbo scheme, turns off sleep/hibernate/display-off/lock-display-off on mains power and prints the GPU power limit. Co-Authored-By: Claude Sonnet 5.5 --- scripts/dev/laptop-turbo.ps1 | 33 +++++++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) create mode 100644 scripts/dev/laptop-turbo.ps1 diff --git a/scripts/dev/laptop-turbo.ps1 b/scripts/dev/laptop-turbo.ps1 new file mode 100644 index 00000000..98cfb98b --- /dev/null +++ b/scripts/dev/laptop-turbo.ps1 @@ -0,0 +1,33 @@ +# Prepares the Windows laptop (ASUS ROG, RTX 3080) for a measurement run. Run it yourself, once, before the run: +# powershell -ExecutionPolicy Bypass -File scripts\dev\laptop-turbo.ps1 +# It changes only the Windows power settings of the ASUS "Turbo" scheme (on mains power): activates the scheme and turns off +# the sleep, hibernate, display-off and lock-screen-display-off timeouts. It does not touch the registry, the lock policy, Armoury Crate +# or the GPU. Armoury Crate keeps its own performance mode (the GPU power limit); the script prints that limit so a low value is visible. +# Previous values are printed so they can be restored by hand. +$ErrorActionPreference = 'Stop' + +$list = powercfg /list | Out-String +$m = [regex]::Match($list, '(?m)^Power Scheme GUID:\s+([0-9a-f-]{36})\s+\((Turbo)\)') +if (-not $m.Success) { throw "No power scheme named Turbo found; run 'powercfg /list' and pick the ASUS performance scheme by hand." } +$turbo = $m.Groups[1].Value + +$battery = Get-CimInstance Win32_Battery -ErrorAction SilentlyContinue +if ($battery -and $battery.BatteryStatus -ne 2) { Write-Warning "The laptop is on battery; plug in the charger first (the AC settings below do not apply on battery)." } + +Write-Host "Active scheme before:"; powercfg /getactivescheme +powercfg /setactive $turbo + +foreach ($name in 'standby-timeout-ac', 'hibernate-timeout-ac', 'monitor-timeout-ac') { + powercfg /change $name 0 +} +# console lock display off timeout (the screen blanking while the session is locked): 0 = never +powercfg /setacvalueindex $turbo SUB_VIDEO VIDEOCONLOCK 0 +powercfg /setactive $turbo + +Write-Host "`nActive scheme now:"; powercfg /getactivescheme +Write-Host "`nGPU state (the power limit must be above 100 W for a valid measurement):" +$gpu = nvidia-smi --query-gpu=name,power.limit,power.draw,clocks.sm,pstate --format=csv,noheader,nounits +Write-Host $gpu +$limit = [double](($gpu -split ',')[1]) +if ($limit -lt 100) { Write-Warning "GPU power limit is $limit W: Armoury Crate is not in its Turbo/Manual performance mode. Set it there; this script cannot." } +Write-Host "`nLeave the lock-screen requirement to Settings > Accounts > Sign-in options (Require sign-in: Never); this script does not change it."