Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
41 changes: 27 additions & 14 deletions perf/benchmark_setup_windows.bat
Original file line number Diff line number Diff line change
Expand Up @@ -64,34 +64,47 @@ powercfg -list

REM Check if Ultimate Performance mode exists
set ULTIMATE_GUID=e9a42b02-d5df-448d-aa00-03f14749eb61
set MODE_FOUND=

for /f "tokens=4" %%G in ('powercfg -list') do (
if /i "%%G"=="%ULTIMATE_GUID%" (
set MODE_FOUND=1
)
)

if defined MODE_FOUND (
echo Ultimate Performance mode is already available.
echo Ultimate Performance mode is already available. Activating it...
powercfg -setactive %ULTIMATE_GUID%
if errorlevel 1 (
echo Failed to activate Ultimate Performance mode. Falling back to High Performance...
goto :fallback
)
echo Ultimate Performance mode has been set successfully.
goto :end
) else (
echo Ultimate Performance mode not found. Adding it now...
powercfg -duplicatescheme %ULTIMATE_GUID%
echo Ultimate Performance mode added successfully.
if errorlevel 1 (
echo Failed to add Ultimate Performance mode. Falling back to High Performance...
goto :fallback
)
powercfg -setactive %ULTIMATE_GUID%
if errorlevel 1 (
echo Ultimate Performance mode added but could not be activated. Falling back to High Performance...
goto :fallback
)
echo Ultimate Performance mode added and activated successfully.
goto :end
)

REM Prompt user for selection
echo ===========================================================
choice /c UH /n /m "Choose U for Ultimate Performance or H for High Performance: "
if errorlevel 2 (
echo Setting High Performance Mode...
powercfg -setactive SCHEME_MIN
echo High Performance mode has been set.
)
:fallback
echo Activating High Performance mode...
powercfg -setactive SCHEME_MIN
if errorlevel 1 (
echo Setting Ultimate Performance Mode...
powercfg -setactive %ULTIMATE_GUID%
echo Ultimate Performance mode has been set.
echo Failed to activate High Performance mode. Please check system settings.
) else (
echo High Performance mode has been set successfully.
)
echo ===========================================================
goto :end

REM Run both functions
Expand Down
Loading