-
Notifications
You must be signed in to change notification settings - Fork 0
/
rtx30xx.ps1
4 lines (4 loc) · 1.37 KB
/
rtx30xx.ps1
1
2
3
4
$gpu=0;
$apifaw="http://localhost:18000/api?command={%22id%22:1,%22method%22:%22device.get%22,%22params%22:[%22$gpu%22]}";
$lfr=210; $mfr=480; $hfr=1230;
$cycle=7.997; $boost=4; $lasttime=[Math]::Round((Get-Date).ToFileTimeUTC()/10000); $looptime=$lasttime; $nextfaw=0; $lastfaw=0; $skip=0; nvidia-smi.exe -i $gpu -lmc 10000; $ProgressPreference='SilentlyContinue'; while ($true) { $now=[Math]::Round((Get-Date).ToFileTimeUTC()/10000); if (($faw -eq 56) -Or ((($now-$lasttime)/1000) -ge $nextfaw)) { $faw=((wget "$apifaw").Content | ConvertFrom-Json).device.gpu_memory_timings.timings.FAW; $nextfaw+=2.3; }; if ($faw -ne $lastfaw) { (get-date -f "dd.MM.yyyy HH:mm:ss")+" "+$lastfaw+" -> "+$faw+" @ "+($now-$lasttime)/1000+" ("+($now-$looptime)/1000+")"; if ($lastfaw -eq 56) { $lasttime=$now; $nextfaw=0; $skip=0; } else { $lasttime+=$cycle*1000; }; $lastfaw=$faw; if ($faw -eq 20) { nvidia-smi.exe -i $gpu -lgc $hfr | Out-Null; }; if ($faw -eq 56) { $looptime=$now; nvidia-smi.exe -i $gpu -lgc $lfr | Out-Null; $boost=[Math]::Round($boost-0.005,3); }; }; if (($faw -eq 20) -And ((($now-$lasttime)/1000) -ge ($boost+$skip))) { $skip=$cycle; nvidia-smi.exe -i $gpu -lgc $mfr | Out-Null; ("Boost: "+$boost+" @ "+($now-$lasttime)/1000)+" ("+($now-$looptime)/1000+")"; sleep -m 100; }; if (($faw -eq 20) -And ((($now-$lasttime)/1000) -ge $cycle)) { $lastfaw=21; $nextfaw=0; $skip=0; $boost=4; }; sleep -m 10; }