Skip to content

Commit e8e8df0

Browse files
committed
Added CPU & FPU as possible stress tests for Aida64. Also a combination of multiple stress tests.
Hopefully fixed the problem that the Y-Cruncher window is not recognized correctly (with a pretty crazy workaround -> "cmd start").
1 parent 245cd6e commit e8e8df0

File tree

2 files changed

+100
-77
lines changed

2 files changed

+100
-77
lines changed

config.default.ini

+19-3
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,9 @@
33

44
# The program to perform the actual stress test
55
# The following programs are available:
6-
# PRIME95
7-
# AIDA64
8-
# YCRUNCHER
6+
# - PRIME95
7+
# - AIDA64
8+
# - YCRUNCHER
99
# You can change the test mode for each program in the relavant [sections] below.
1010
# Note: For AIDA64, you need to manually download and extract the portable ENGINEER version and put it
1111
# in the /test_programs/aida64/ folder
@@ -153,11 +153,27 @@ FFTSize = Huge
153153
# Note: "RAM" consumes basically all of the available memory and makes the computer pretty slow
154154
# I'd advise staying with CACHE
155155
# CACHE: Starts Aida64 with the "Cache" stress test
156+
# CPU: Starts Aida64 with the "CPU" stress test
157+
# FPU: Starts Aida64 with the "FPU" stress test
156158
# RAM: Starts Aida64 with the "Memory" stress test
159+
# You can also combine multiple stress tests like so: CACHE,CPU,FPU
157160
# Default: CACHE
158161
mode = CACHE
159162

160163

164+
# Use AVX for Aida64
165+
# This enables or disables the usage of AVX instructions during Aida64's stress tests
166+
# Default: 0
167+
useAVX = 0
168+
169+
170+
# The maximum memory allocation for Aida64
171+
# Sets the maximum memory usage during the "RAM" stress test in percent
172+
# Note: Setting this too high can cause your Windows to slow down to a crawl!
173+
# Default: 90
174+
maxMemory = 90
175+
176+
161177

162178

163179
# Y-Cruncher specific settings

script-corecycler.ps1

+81-74
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
.AUTHOR
33
sp00n
44
.VERSION
5-
0.8.0.0 RC2
5+
0.8.0.0 RC3
66
.DESCRIPTION
77
Sets the affinity of the selected stress test program process to only one core and cycles through
88
all the cores to test the stability of a Curve Optimizer setting
@@ -17,7 +17,7 @@
1717
#>
1818

1919
# Global variables
20-
$version = '0.8.0.0 RC2'
20+
$version = '0.8.0.0 RC3'
2121
$curDateTime = Get-Date -format yyyy-MM-dd_HH-mm-ss
2222
$logFilePath = 'logs'
2323
$logFilePathAbsolute = $PSScriptRoot + '\' + $logFilePath + '\'
@@ -80,6 +80,8 @@ $stressTestPrograms = @{
8080
'fullPathToExe' = $null
8181
'testModes' = @(
8282
'CACHE',
83+
'CPU',
84+
'FPU',
8385
'RAM'
8486
)
8587
'windowNames' = @(
@@ -197,7 +199,7 @@ $GetWindowsDefinition = @'
197199
private static CallBackPtr callBackPtr = Callback;
198200
private static List<WinStruct> _WinStructList = new List<WinStruct>();
199201
200-
[DllImport("User32.dll")]
202+
[DllImport("user32.dll")]
201203
[return: MarshalAs(UnmanagedType.Bool)]
202204
private static extern bool EnumWindows(CallBackPtr lpEnumFunc, IntPtr lParam);
203205
@@ -1146,9 +1148,9 @@ function Get-Settings {
11461148
$settings.General.numberOfThreads = $(if ($isHyperthreadingEnabled) { $settings.General.numberOfThreads } else { 1 })
11471149

11481150

1149-
# Default the stress test program to prime95
1151+
# If the selected stress test program is not supported
11501152
if (!$settings.General.stressTestProgram -or !$stressTestPrograms.Contains($settings.General.stressTestProgram)) {
1151-
$settings.General.stressTestProgram = 'prime95'
1153+
Exit-WithFatalError('The selected stress test program "' + $settings.General.stressTestProgram + '" could not be found!')
11521154
}
11531155

11541156

@@ -1173,8 +1175,14 @@ function Get-Settings {
11731175

11741176

11751177
# Sanity check the selected test mode
1176-
if (!$stressTestPrograms[$settings.General.stressTestProgram]['testModes'].Contains($settings.mode)) {
1177-
Exit-WithFatalError('The selected test mode "' + $settings.mode + '" is not available for ' + $stressTestPrograms[$settings.General.stressTestProgram]['displayName'] + '!')
1178+
# For Aida64, you can set a comma separated list of multiple stress tests
1179+
$modesArray = $settings.mode -Split ',\s*'
1180+
$modeString = $modesArray -Join '-'
1181+
1182+
foreach ($mode in $modesArray) {
1183+
if (!$stressTestPrograms[$settings.General.stressTestProgram]['testModes'].Contains($mode)) {
1184+
Exit-WithFatalError('The selected test mode "' + $mode + '" is not available for ' + $stressTestPrograms[$settings.General.stressTestProgram]['displayName'] + '!')
1185+
}
11781186
}
11791187

11801188

@@ -1183,7 +1191,7 @@ function Get-Settings {
11831191

11841192

11851193
# Set the final full path and name of the log file
1186-
$Script:logFileName = $settings.Logging.name + '_' + $curDateTime + '_' + $settings.General.stressTestProgram.ToUpper() + '_' + $settings.mode + '.log'
1194+
$Script:logFileName = $settings.Logging.name + '_' + $curDateTime + '_' + $settings.General.stressTestProgram.ToUpper() + '_' + $modeString + '.log'
11871195
$Script:logFileFullPath = $logFilePathAbsolute + $logFileName
11881196
}
11891197

@@ -1738,17 +1746,13 @@ function Initialize-Prime95 {
17381746
}
17391747

17401748

1741-
$configType = $settings.mode
1749+
$modeString = $settings.mode
17421750
$configFile1 = $stressTestPrograms['prime95']['absolutePath'] + 'local.txt'
17431751
$configFile2 = $stressTestPrograms['prime95']['absolutePath'] + 'prime.txt'
17441752

17451753

1746-
if ($configType -ne 'CUSTOM' -and $configType -ne 'SSE' -and $configType -ne 'AVX' -and $configType -ne 'AVX2') {
1747-
Exit-WithFatalError('Invalid mode type provided!')
1748-
}
1749-
17501754
# The Prime95 results.txt file name and path for this run
1751-
$Script:stressTestLogFileName = 'Prime95_' + $curDateTime + '_' + $configType + '_' + $settings.Prime95.FFTSize + '_FFT_' + $minFFTSize + 'K-' + $maxFFTSize + 'K.txt'
1755+
$Script:stressTestLogFileName = 'Prime95_' + $curDateTime + '_' + $modeString + '_' + $settings.Prime95.FFTSize + '_FFT_' + $minFFTSize + 'K-' + $maxFFTSize + 'K.txt'
17521756
$Script:stressTestLogFilePath = $logFilePathAbsolute + $stressTestLogFileName
17531757

17541758
# Create the local.txt and overwrite if necessary
@@ -1767,11 +1771,11 @@ function Initialize-Prime95 {
17671771
Add-Content $configFile1 ('CoresPerTest=1')
17681772
Add-Content $configFile1 ('CpuNumHyperthreads=' + $settings.General.numberOfThreads)
17691773
Add-Content $configFile1 ('WorkerThreads=' + $settings.General.numberOfThreads)
1770-
Add-Content $configFile1 ('CpuSupportsSSE=' + $prime95CPUSettings[$configType].CpuSupportsSSE)
1771-
Add-Content $configFile1 ('CpuSupportsSSE2=' + $prime95CPUSettings[$configType].CpuSupportsSSE2)
1772-
Add-Content $configFile1 ('CpuSupportsAVX=' + $prime95CPUSettings[$configType].CpuSupportsAVX)
1773-
Add-Content $configFile1 ('CpuSupportsAVX2=' + $prime95CPUSettings[$configType].CpuSupportsAVX2)
1774-
Add-Content $configFile1 ('CpuSupportsFMA3=' + $prime95CPUSettings[$configType].CpuSupportsFMA3)
1774+
Add-Content $configFile1 ('CpuSupportsSSE=' + $prime95CPUSettings[$modeString].CpuSupportsSSE)
1775+
Add-Content $configFile1 ('CpuSupportsSSE2=' + $prime95CPUSettings[$modeString].CpuSupportsSSE2)
1776+
Add-Content $configFile1 ('CpuSupportsAVX=' + $prime95CPUSettings[$modeString].CpuSupportsAVX)
1777+
Add-Content $configFile1 ('CpuSupportsAVX2=' + $prime95CPUSettings[$modeString].CpuSupportsAVX2)
1778+
Add-Content $configFile1 ('CpuSupportsFMA3=' + $prime95CPUSettings[$modeString].CpuSupportsFMA3)
17751779

17761780

17771781

@@ -1795,7 +1799,7 @@ function Initialize-Prime95 {
17951799
Add-Content $configFile2 ('results.txt=' + $logFilePath + '\' + $stressTestLogFileName)
17961800

17971801
# Custom settings
1798-
if ($configType -eq 'CUSTOM') {
1802+
if ($modeString -eq 'CUSTOM') {
17991803
Add-Content $configFile2 ('TortureMem=' + $settings.Custom.TortureMem)
18001804
Add-Content $configFile2 ('TortureTime=' + $settings.Custom.TortureTime)
18011805
}
@@ -1848,14 +1852,21 @@ function Start-Prime95 {
18481852
#$Script:windowProcess = Start-Process -filepath $stressTestPrograms['prime95']['fullPathToExe'] -ArgumentList '-t' -PassThru -WindowStyle Minimized
18491853

18501854
# This doesn't steal the focus
1851-
#$processId = [Microsoft.VisualBasic.Interaction]::Shell(('"' + $stressTestPrograms['prime95']['fullPathToExe'] + '" -t'), 'MinimizedNoFocus')
1852-
#$processId = [Microsoft.VisualBasic.Interaction]::Shell(('"' + $stressTestPrograms['prime95']['fullPathToExe'] + '" -t'), 'NormalNoFocus')
1853-
$processId = [Microsoft.VisualBasic.Interaction]::Shell(('"' + $stressTestPrograms['prime95']['fullPathToExe'] + '" -t'), 'Hide')
1854-
1855-
$Script:windowProcess = Get-Process -Id $processId
1855+
# 0 = Hide
1856+
# 1 = NormalFocus
1857+
# 2 = MinimizedFocus
1858+
# 3 = MaximizedFocus
1859+
# 4 = NormalNoFocus
1860+
# 6 = MinimizedNoFocus
1861+
$windowBehaviour = 0
1862+
$fullPathToExe = $stressTestPrograms['prime95']['fullPathToExe']
1863+
$command = """${fullPathToExe}"" -t"
1864+
$processId = [Microsoft.VisualBasic.Interaction]::Shell($command, $windowBehaviour)
18561865

18571866
# This might be necessary to correctly read the process. Or not
18581867
Start-Sleep -Milliseconds 500
1868+
1869+
$Script:windowProcess = Get-Process -Id $processId -ErrorAction Ignore
18591870

18601871
if (!$Script:windowProcess) {
18611872
Exit-WithFatalError('Could not start the process "' + $stressTestPrograms['prime95']['processName'] + '"!')
@@ -1972,7 +1983,8 @@ function Initialize-Aida64 {
19721983
}
19731984

19741985

1975-
$configType = $settings.mode
1986+
$modesArray = $settings.mode -Split ',\s*'
1987+
$modeString = $modesArray -Join '-'
19761988

19771989
# TODO: Do we want to offer a way to start Aida64 with admin rights?
19781990
$hasAdminRights = $false
@@ -1995,16 +2007,13 @@ function Initialize-Aida64 {
19952007
}
19962008

19972009
# The Aida64 log file name and path for this run
1998-
$Script:stressTestLogFileName = 'Aida64_' + $curDateTime + '_' + $settings.mode + '.csv'
2010+
$Script:stressTestLogFileName = 'Aida64_' + $curDateTime + '_' + $modeString + '.csv'
19992011
$Script:stressTestLogFilePath = $logFilePathAbsolute + $stressTestLogFileName
20002012

20012013
# The aida64.ini and aida64.sst.ini
20022014
$configFile1 = $stressTestPrograms['aida64']['absolutePath'] + 'aida64.ini'
20032015
$configFile2 = $stressTestPrograms['aida64']['absolutePath'] + 'aida64.sst.ini'
20042016

2005-
if ($configType -ne 'CACHE' -and $configType -ne 'RAM') {
2006-
Exit-WithFatalError('Invalid mode type provided!')
2007-
}
20082017

20092018
# Create the aida64.ini and overwrite if necessary
20102019
$null = New-Item $configFile1 -ItemType File -Force
@@ -2114,12 +2123,12 @@ function Initialize-Aida64 {
21142123
}
21152124

21162125

2117-
# No AVX
2118-
Set-Content $configFile2 ('UseAVX=0')
2119-
Add-Content $configFile2 ('UseAVX512=0')
2120-
21212126
# Start the stress test on max 2 threads, not on all
2122-
Add-Content $configFile2 ('CPUMaskAuto=0')
2127+
Set-Content $configFile2 ('CPUMaskAuto=0')
2128+
2129+
# Use AVX?
2130+
Add-Content $configFile2 ('UseAVX=' + $settings.Aida64.useAVX)
2131+
Add-Content $configFile2 ('UseAVX512=' + $settings.Aida64.useAVX)
21232132

21242133
# On CPU 2 & 3 if 2 threads
21252134
if ($settings.General.numberOfThreads -gt 1) {
@@ -2130,8 +2139,8 @@ function Initialize-Aida64 {
21302139
Add-Content $configFile2 ('CPUMask=0x00000004')
21312140
}
21322141

2133-
# Maybe use this later on to limit the amount of memory used for the RAM test?
2134-
#Add-Content $configFile1 ('MemAlloc=95')
2142+
# Set the maximum amount of memory during the RAM stress test
2143+
Add-Content $configFile2 ('MemAlloc=' + $settings.Aida64.maxMemory)
21352144
}
21362145

21372146

@@ -2165,13 +2174,19 @@ function Start-Aida64 {
21652174
Write-Verbose('Starting the main window process')
21662175
}
21672176

2168-
# Minimized to the task bar
21692177
# This doesn't steal the focus
2170-
#$processId = [Microsoft.VisualBasic.Interaction]::Shell(('"' + $stressTestPrograms['aida64']['fullPathToExe'] + '" /SAFEST /SILENT /SST ' + $thisMode), 'NormalNoFocus')
2171-
#$processId = [Microsoft.VisualBasic.Interaction]::Shell(('"' + $stressTestPrograms['aida64']['fullPathToExe'] + '" /SAFEST /SILENT /SST ' + $thisMode), 'Hide')
2172-
$processId = [Microsoft.VisualBasic.Interaction]::Shell(('"' + $stressTestPrograms['aida64']['fullPathToExe'] + '" /SAFEST /SILENT /SST ' + $thisMode), 'MinimizedNoFocus')
2178+
# 0 = Hide
2179+
# 1 = NormalFocus
2180+
# 2 = MinimizedFocus
2181+
# 3 = MaximizedFocus
2182+
# 4 = NormalNoFocus
2183+
# 6 = MinimizedNoFocus
2184+
$windowBehaviour = 6
2185+
$fullPathToExe = $stressTestPrograms['aida64']['fullPathToExe']
2186+
$command = """${fullPathToExe}"" /SAFEST /SILENT /SST ${thisMode}"
2187+
$processId = [Microsoft.VisualBasic.Interaction]::Shell($command, $windowBehaviour)
21732188

2174-
$Script:windowProcess = Get-Process -Id $processId
2189+
$Script:windowProcess = Get-Process -Id $processId -ErrorAction Ignore
21752190

21762191
# /SST = Directly starts the System Stability Test (available tests: Cache, RAM, CPU, FPU, Disk, GPU)
21772192
# /SILENT = No tray icon, which can stay behind if the main window process is killed
@@ -2436,7 +2451,7 @@ function Initialize-YCruncher {
24362451
Exit-WithFatalError
24372452
}
24382453

2439-
$configType = $settings.mode
2454+
$modeString = $settings.mode
24402455
$configName = 'stressTest.cfg'
24412456
$configFile = $stressTestPrograms['ycruncher']['absolutePath'] + $configName
24422457

@@ -2525,33 +2540,34 @@ function Start-YCruncher {
25252540
# This doesn't steal the focus
25262541
# We need to use conhost, otherwise the output would be inside the current console window
25272542
# Caution, calling conhost here will also return the process id of the conhost.exe file, not the one for the Y-Cruncher binary!
2528-
2529-
2530-
# TODO: There seem to be some problems with starting the process here. Need to investigate
2531-
#$processId = [Microsoft.VisualBasic.Interaction]::Shell(('conhost "' + $stressTestPrograms['ycruncher']['fullPathToExe'] + '" config \"' + $stressTestConfigFilePath + '\"'), 'MinimizedNoFocus')
2532-
#$processId = [Microsoft.VisualBasic.Interaction]::Shell(('conhost "' + $stressTestPrograms['ycruncher']['fullPathToExe'] + '" config \"' + $stressTestConfigFilePath + '\"'), 'NormalNoFocus')
2533-
#$processId = [Microsoft.VisualBasic.Interaction]::Shell(('conhost "' + $stressTestPrograms['ycruncher']['fullPathToExe'] + '" config \"' + $stressTestConfigFilePath + '\"'), 'Hide')
2534-
2535-
25362543
# The escape character in Visual Basic for double quotes seems to be... a double quote!
25372544
# So a triple double quote is actually interpreted as a single double quote here
2538-
$processId = [Microsoft.VisualBasic.Interaction]::Shell(('conhost """' + $stressTestPrograms['ycruncher']['fullPathToExe'] + '""" config """' + $stressTestConfigFilePath + '"""'), 'MinimizedNoFocus')
2539-
2545+
#$processId = [Microsoft.VisualBasic.Interaction]::Shell(("conhost.exe """ + $stressTestPrograms['ycruncher']['fullPathToExe'] + """ config """ + $stressTestConfigFilePath + """"), 6) # 6 = MinimizedNoFocus
25402546

2541-
# Possible alternative using cmd /K with even more quotes
2542-
# Note that this will not work with the GetWindows() call to match against "^.*00-x86\.exe$", as the window title doesn't end with .exe, but with
2543-
# "[...]00-x86.exe" config "[...]\stressTest.cfg"
2544-
#$processId = [Microsoft.VisualBasic.Interaction]::Shell(('conhost.exe cmd /K """"""' + $fullPathToExe + '""" config """' + $stressTestConfigFilePath + '""""""'), 'MinimizedNoFocus')
2547+
# 0 = Hide
2548+
# 1 = NormalFocus
2549+
# 2 = MinimizedFocus
2550+
# 3 = MaximizedFocus
2551+
# 4 = NormalNoFocus
2552+
# 6 = MinimizedNoFocus
2553+
$windowBehaviour = 6
25452554

2546-
2547-
# Cannot use the returned $processId here
2548-
#$Script:windowProcess = Get-Process -Id $processId
2549-
$Script:windowProcess = Get-Process $stressTestPrograms['ycruncher']['processName']
2555+
# Apparently on some computers (not mine) the windows title is not set to the binary path, so the Get-StressTestWindowHandler function doesn't work
2556+
# Therefore we're now using "cmd /C start" to be able to set a window title...
2557+
$fileName = $stressTestPrograms['ycruncher']['processName'] + '.' + $stressTestPrograms['ycruncher']['processNameExt']
2558+
$fullPathToExe = $stressTestPrograms['ycruncher']['fullPathToExe']
2559+
$command = "cmd /C start /MIN ""Y-Cruncher - ${fileName}"" ""${fullPathToExe}"" config ""${stressTestConfigFilePath}"""
2560+
$processId = [Microsoft.VisualBasic.Interaction]::Shell($command, $windowBehaviour)
25502561

25512562

25522563
# This might be necessary to correctly read the process. Or not
25532564
Start-Sleep -Milliseconds 500
2554-
2565+
2566+
2567+
# Cannot use the returned $processId here
2568+
#$Script:windowProcess = Get-Process -Id $processId
2569+
$Script:windowProcess = Get-Process $stressTestPrograms['ycruncher']['processName'] -ErrorAction Ignore
2570+
25552571
if (!$Script:windowProcess) {
25562572
Exit-WithFatalError('Could not start the process "' + $stressTestPrograms['ycruncher']['processName'] + '"!')
25572573
}
@@ -3175,16 +3191,7 @@ if (!$counter) {
31753191
$selectedStressTestProgram = $stressTestPrograms[$settings.General.stressTestProgram]['displayName']
31763192

31773193
# Set the correct process name
3178-
# Eventually this could be something different than just Prime95
3179-
if ($stressTestPrograms.Contains($settings.General.stressTestProgram)) {
3180-
$processName = $stressTestPrograms[$settings.General.stressTestProgram]['processNameForLoad']
3181-
}
3182-
3183-
# Default is Prime95
3184-
else {
3185-
$processName = $stressTestPrograms['prime95']['processNameForLoad']
3186-
}
3187-
3194+
$processName = $stressTestPrograms[$settings.General.stressTestProgram]['processNameForLoad']
31883195

31893196
# Check if the stress test process is already running
31903197
$stressTestProcess = Get-Process $processName -ErrorAction Ignore
@@ -3498,7 +3505,7 @@ for ($iteration = 1; $iteration -le $settings.General.maxIterations; $iteration+
34983505
Write-ColorText(' Apparently Aida64 doesn''t like running the stress test on the first thread of Core 0.') Black Yellow
34993506
Write-ColorText(' Setting it to thread 2 of Core 0 instead (Core 0 CPU 1).') Black Yellow
35003507

3501-
$affinity = 2
3508+
$affinity = [System.IntPtr][Int64] 2
35023509
$cpuNumber = 1
35033510
$cpuNumberString = 1
35043511
}
@@ -3570,7 +3577,7 @@ for ($iteration = 1; $iteration -le $settings.General.maxIterations; $iteration+
35703577
Start-Sleep -Milliseconds 300
35713578

35723579
try {
3573-
$stressTestProcess.ProcessorAffinity = $affinity
3580+
$stressTestProcess.ProcessorAffinity = [System.IntPtr][Int64] $affinity
35743581
}
35753582
catch {
35763583
Close-StressTestProgram

0 commit comments

Comments
 (0)