|
2 | 2 | .AUTHOR
|
3 | 3 | sp00n
|
4 | 4 | .VERSION
|
5 |
| - 0.10.0.0alpha3 |
| 5 | + 0.10.0.0alpha4 |
6 | 6 | .DESCRIPTION
|
7 | 7 | Sets the affinity of the selected stress test program process to only one
|
8 | 8 | core and cycles through all the cores which allows to test the stability of
|
|
23 | 23 |
|
24 | 24 |
|
25 | 25 | # Our current version
|
26 |
| -$version = '0.10.0.0alpha3' |
| 26 | +$version = '0.10.0.0alpha4' |
27 | 27 |
|
28 | 28 |
|
29 | 29 | # This defines the strict mode
|
@@ -723,7 +723,7 @@ memory = 2GB
|
723 | 723 | # Also note that enabling this setting will require the script to be run with administrator privileges
|
724 | 724 | # And lastly, enabling it will set "skipCoreOnError" to 0 and "stopOnError" to 0 as long as the limit has not been reached
|
725 | 725 | #
|
726 |
| -# IMPORTANT: This is currently untested for Ryzen 9000 (Zen 5) CPUs |
| 726 | +# IMPORTANT: This currently does NOT work for Ryzen 9000 (Zen 5) CPUs :( |
727 | 727 | # IMPORTANT: The automatically adjusted Curve Optimizer / voltage offset values are NOT permanent, so after a regular reboot they
|
728 | 728 | # will not be applied anymore
|
729 | 729 | # If you want to permanently set these values, you will need to set them in the BIOS, or use a startup script to
|
@@ -4561,9 +4561,30 @@ function Initialize-AutomaticTestMode {
|
4561 | 4561 | return
|
4562 | 4562 | }
|
4563 | 4563 |
|
| 4564 | + Write-Debug('Initializing Automatic Test Mode') |
| 4565 | + |
| 4566 | + # This currently does not work on Ryzen 9000 :( |
| 4567 | + # Maybe also Ryzen 8000? |
| 4568 | + if ( $processor.Name -match '.*AMD.*' -and $processor.Name -match '9\d{3}' ) { |
| 4569 | + Write-Text('') |
| 4570 | + Write-Text('') |
| 4571 | + Write-ColorText('┌───────────────────────────────────┤ ERROR ├──────────────────────────────────┐') Yellow DarkRed |
| 4572 | + Write-ColorText('│ ' + 'You have selected to use the Automatic Test Mode.'.PadRight(76, ' ') + ' │') Yellow DarkRed |
| 4573 | + Write-ColorText('│ ' + 'Unfortunately this does not (yet) work with Ryzen 9000 processors, so please'.PadRight(76, ' ') + ' │') Yellow DarkRed |
| 4574 | + Write-ColorText('│ ' + 'disable the Automatic Test Mode in the config.ini file.'.PadRight(76, ' ') + ' │') Yellow DarkRed |
| 4575 | + Write-ColorText('│ ' + ''.PadRight(76, ' ') + ' │') Yellow DarkRed |
| 4576 | + Write-ColorText('│ ' + 'The detected processor:'.PadRight(76, ' ') + ' │') Yellow DarkRed |
| 4577 | + Write-ColorText('│ ' + $processor.Name.PadRight(76, ' ') + ' │') Yellow DarkRed |
| 4578 | + Write-ColorText('└──────────────────────────────────────────────────────────────────────────────┘') Yellow DarkRed |
| 4579 | + Write-Text('') |
| 4580 | + Write-Text('') |
| 4581 | + Write-ColorText('Exiting...') Red |
| 4582 | + Write-Text('') |
| 4583 | + |
| 4584 | + Exit-Script |
| 4585 | + } |
4564 | 4586 |
|
4565 | 4587 | # The Automatic Test Mode has been enabled, we require administrator privileges!
|
4566 |
| - Write-Debug('Initializing Automatic Test Mode') |
4567 | 4588 | Write-Debug('Are we admin: ' + $areWeAdmin)
|
4568 | 4589 |
|
4569 | 4590 |
|
@@ -8274,107 +8295,153 @@ function Test-StressTestProgrammIsRunning {
|
8274 | 8295 |
|
8275 | 8296 | # Note: For two threads, the processor time is actually 2x the measure time
|
8276 | 8297 | # We're handling this by using the "factor" variables
|
8277 |
| - $measureTime = 100 |
8278 |
| - $expectedTime = $measureTime * $factorForExpectedUsage # 100 * 1 for 1 thread = 100ms or 100 * 2 = 200ms for 2 threads |
8279 |
| - $minTime = $measureTime * $factorForMinProcessorTime # 50% usage of the expected usage |
8280 |
| - $waitTime = 2000 |
8281 |
| - $maxChecks = 3 |
| 8298 | + do { |
| 8299 | + $measureTime = 100 |
| 8300 | + $expectedTime = $measureTime * $factorForExpectedUsage # 100 * 1 for 1 thread = 100ms or 100 * 2 = 200ms for 2 threads |
| 8301 | + $minTime = $measureTime * $factorForMinProcessorTime # 50% usage of the expected usage |
| 8302 | + $waitTime = 2000 |
| 8303 | + $maxChecks = 3 |
8282 | 8304 |
|
8283 |
| - $cpuTime1 = $checkProcess.UserProcessorTime.TotalSeconds |
8284 |
| - Start-Sleep -Milliseconds $measureTime |
8285 |
| - $cpuTime2 = $checkProcess.UserProcessorTime.TotalSeconds |
8286 |
| - $measuredTime = [Math]::Round(($cpuTime2 - $cpuTime1) * 1000, 0) |
| 8305 | + try { |
| 8306 | + $cpuTime1 = $checkProcess.UserProcessorTime.TotalSeconds |
| 8307 | + Start-Sleep -Milliseconds $measureTime |
| 8308 | + $cpuTime2 = $checkProcess.UserProcessorTime.TotalSeconds |
| 8309 | + } |
8287 | 8310 |
|
8288 |
| - # For 100% core usage, this should be 0.1 seconds time increase during 100 milliseconds |
8289 |
| - Write-Verbose($timestamp + ' - Checking CPU usage: ' + $measuredTime + 'ms (expected: ' + $expectedTime + 'ms, lower limit: ' + $minTime + 'ms)') |
| 8311 | + # We assume that the process doesn't exist anymore if this fails |
| 8312 | + catch { |
| 8313 | + $timestamp = Get-Date -Format HH:mm:ss |
8290 | 8314 |
|
8291 |
| - if ($measuredTime -le $minTime) { |
8292 |
| - # For Prime95 |
8293 |
| - if ($isPrime95) { |
8294 |
| - # Look for a line with an "error" string in the new log entries |
8295 |
| - $errorResults = $newLogEntries | Where-Object { $_.Line -Match '.*error.*' } | Select-Object -Last 1 |
| 8315 | + # Does the stress test process still exist? |
| 8316 | + $checkProcess = Get-Process -Id $stressTestProcessId -ErrorAction Ignore |
8296 | 8317 |
|
8297 |
| - # Found the "error" string |
8298 |
| - if ($errorResults) { |
8299 |
| - # We don't need to check for a false alarm anymore, as we're already checking only new log entries |
8300 |
| - $stressTestError = $errorResults.Line |
8301 |
| - $errorType = 'CALCULATIONERROR' |
| 8318 | + Write-Debug($timestamp + ' - Checking for stress test errors') |
| 8319 | + |
| 8320 | + if (!$checkProcess) { |
| 8321 | + $stressTestError = 'The ' + $selectedStressTestProgram + ' process doesn''t exist anymore.' |
| 8322 | + $errorType = 'PROCESSMISSING' |
| 8323 | + break |
| 8324 | + } |
| 8325 | + else { |
| 8326 | + throw $_ |
8302 | 8327 | }
|
8303 | 8328 | }
|
8304 | 8329 |
|
| 8330 | + $measuredTime = [Math]::Round(($cpuTime2 - $cpuTime1) * 1000, 0) |
8305 | 8331 |
|
8306 |
| - # For y-cruncher with logging enabled |
8307 |
| - elseif ($isYCruncherWithLogging) { |
8308 |
| - # Look for a line with an "error" string in the new log entries |
8309 |
| - $errorResults = $newLogEntries | Where-Object { $_.Line -Match '.*error\(s\).*' } | Select-Object -Last 1 |
| 8332 | + # For 100% core usage, this should be 0.1 seconds time increase during 100 milliseconds |
| 8333 | + Write-Verbose($timestamp + ' - Checking CPU usage: ' + $measuredTime + 'ms (expected: ' + $expectedTime + 'ms, lower limit: ' + $minTime + 'ms)') |
8310 | 8334 |
|
8311 |
| - # Found the "error" string |
8312 |
| - if ($errorResults) { |
8313 |
| - # We don't need to check for a false alarm anymore, as we're already checking only new log entries |
8314 |
| - $stressTestError = $errorResults.Line |
8315 |
| - $errorType = 'CALCULATIONERROR' |
| 8335 | + if ($measuredTime -le $minTime) { |
| 8336 | + # For Prime95 |
| 8337 | + if ($isPrime95) { |
| 8338 | + # Look for a line with an "error" string in the new log entries |
| 8339 | + $errorResults = $newLogEntries | Where-Object { $_.Line -Match '.*error.*' } | Select-Object -Last 1 |
| 8340 | + |
| 8341 | + # Found the "error" string |
| 8342 | + if ($errorResults) { |
| 8343 | + # We don't need to check for a false alarm anymore, as we're already checking only new log entries |
| 8344 | + $stressTestError = $errorResults.Line |
| 8345 | + $errorType = 'CALCULATIONERROR' |
| 8346 | + } |
8316 | 8347 | }
|
8317 |
| - } |
8318 | 8348 |
|
8319 |
| - # For Linpack |
8320 |
| - elseif ($isLinpack) { |
8321 |
| - # Look for a line with a "fail" string in the new log entries |
8322 |
| - $errorResults = $newLogEntries | Where-Object { $_.Line -Match '.*fail.*' } | Select-Object -Last 1 |
8323 | 8349 |
|
8324 |
| - # Found the "fail" string |
8325 |
| - if ($errorResults) { |
8326 |
| - # We don't need to check for a false alarm anymore, as we're already checking only new log entries |
8327 |
| - $stressTestError = $errorResults.Line |
8328 |
| - $errorType = 'CALCULATIONERROR' |
| 8350 | + # For y-cruncher with logging enabled |
| 8351 | + elseif ($isYCruncherWithLogging) { |
| 8352 | + # Look for a line with an "error" string in the new log entries |
| 8353 | + $errorResults = $newLogEntries | Where-Object { $_.Line -Match '.*error\(s\).*' } | Select-Object -Last 1 |
| 8354 | + |
| 8355 | + # Found the "error" string |
| 8356 | + if ($errorResults) { |
| 8357 | + # We don't need to check for a false alarm anymore, as we're already checking only new log entries |
| 8358 | + $stressTestError = $errorResults.Line |
| 8359 | + $errorType = 'CALCULATIONERROR' |
| 8360 | + } |
8329 | 8361 | }
|
8330 |
| - } |
8331 | 8362 |
|
| 8363 | + # For Linpack |
| 8364 | + elseif ($isLinpack) { |
| 8365 | + # Look for a line with a "fail" string in the new log entries |
| 8366 | + $errorResults = $newLogEntries | Where-Object { $_.Line -Match '.*fail.*' } | Select-Object -Last 1 |
8332 | 8367 |
|
| 8368 | + # Found the "fail" string |
| 8369 | + if ($errorResults) { |
| 8370 | + # We don't need to check for a false alarm anymore, as we're already checking only new log entries |
| 8371 | + $stressTestError = $errorResults.Line |
| 8372 | + $errorType = 'CALCULATIONERROR' |
| 8373 | + } |
| 8374 | + } |
8333 | 8375 |
|
8334 |
| - # Error string still not found |
8335 |
| - # This might have been a false alarm, wait a bit and try again |
8336 |
| - if (!$stressTestError) { |
8337 |
| - # Repeat the CPU usage check $maxChecks times and only throw an error if the process hasn't recovered by then |
8338 |
| - for ($curCheck = 1; $curCheck -le $maxChecks; $curCheck++) { |
8339 |
| - $timestamp = Get-Date -Format HH:mm:ss |
8340 |
| - Write-Verbose($timestamp + ' - ...the CPU usage was too low, waiting ' + $waitTime + 'ms for another check...') |
8341 | 8376 |
|
8342 |
| - # Let's use the wait time as the measure time! |
8343 |
| - $measureTime = $waitTime |
8344 |
| - $cpuTime1 = $checkProcess.UserProcessorTime.TotalSeconds |
8345 |
| - Start-Sleep -Milliseconds $measureTime |
8346 |
| - $cpuTime2 = $checkProcess.UserProcessorTime.TotalSeconds |
8347 |
| - $measuredTime = [Math]::Round(($cpuTime2 - $cpuTime1) * 1000, 0) |
8348 | 8377 |
|
8349 |
| - $expectedTime = $measureTime * $factorForExpectedUsage |
8350 |
| - $minTime = $measureTime * $factorForMinProcessorTime |
| 8378 | + # Error string still not found |
| 8379 | + # This might have been a false alarm, wait a bit and try again |
| 8380 | + if (!$stressTestError) { |
| 8381 | + # Repeat the CPU usage check $maxChecks times and only throw an error if the process hasn't recovered by then |
| 8382 | + for ($curCheck = 1; $curCheck -le $maxChecks; $curCheck++) { |
| 8383 | + $timestamp = Get-Date -Format HH:mm:ss |
| 8384 | + Write-Verbose($timestamp + ' - ...the CPU usage was too low, waiting ' + $waitTime + 'ms for another check...') |
| 8385 | + |
| 8386 | + # Let's use the wait time as the measure time! |
| 8387 | + try { |
| 8388 | + $measureTime = $waitTime |
| 8389 | + $cpuTime1 = $checkProcess.UserProcessorTime.TotalSeconds |
| 8390 | + Start-Sleep -Milliseconds $measureTime |
| 8391 | + $cpuTime2 = $checkProcess.UserProcessorTime.TotalSeconds |
| 8392 | + $measuredTime = [Math]::Round(($cpuTime2 - $cpuTime1) * 1000, 0) |
| 8393 | + |
| 8394 | + $expectedTime = $measureTime * $factorForExpectedUsage |
| 8395 | + $minTime = $measureTime * $factorForMinProcessorTime |
| 8396 | + } |
8351 | 8397 |
|
8352 |
| - $timestamp = Get-Date -Format HH:mm:ss |
8353 |
| - Write-Verbose($timestamp + ' - Checking CPU usage again (#' + $curCheck + '): ' + $measuredTime + 'ms (expected: ' + $expectedTime + 'ms, lower limit: ' + $minTime + 'ms)') |
| 8398 | + # We assume that the process doesn't exist anymore if this fails |
| 8399 | + catch { |
| 8400 | + $timestamp = Get-Date -Format HH:mm:ss |
8354 | 8401 |
|
8355 |
| - # If we have recovered, break and continue with stresss testing |
8356 |
| - if ($measuredTime -ge $minTime) { |
8357 |
| - Write-Verbose(' The process seems to have recovered, continuing with stress testing') |
8358 |
| - break |
8359 |
| - } |
| 8402 | + # Does the stress test process still exist? |
| 8403 | + $checkProcess = Get-Process -Id $stressTestProcessId -ErrorAction Ignore |
8360 | 8404 |
|
8361 |
| - else { |
8362 |
| - if ($curCheck -lt $maxChecks) { |
8363 |
| - Write-Verbose(' Still not enough usage (#' + $curCheck + ')') |
| 8405 | + Write-Debug($timestamp + ' - Checking for stress test errors') |
| 8406 | + |
| 8407 | + if (!$checkProcess) { |
| 8408 | + $stressTestError = 'The ' + $selectedStressTestProgram + ' process doesn''t exist anymore.' |
| 8409 | + $errorType = 'PROCESSMISSING' |
| 8410 | + } |
| 8411 | + else { |
| 8412 | + throw $_ |
| 8413 | + } |
| 8414 | + |
| 8415 | + break |
| 8416 | + } |
| 8417 | + |
| 8418 | + $timestamp = Get-Date -Format HH:mm:ss |
| 8419 | + Write-Verbose($timestamp + ' - Checking CPU usage again (#' + $curCheck + '): ' + $measuredTime + 'ms (expected: ' + $expectedTime + 'ms, lower limit: ' + $minTime + 'ms)') |
| 8420 | + |
| 8421 | + # If we have recovered, break and continue with stresss testing |
| 8422 | + if ($measuredTime -ge $minTime) { |
| 8423 | + Write-Verbose(' The process seems to have recovered, continuing with stress testing') |
| 8424 | + break |
8364 | 8425 | }
|
8365 | 8426 |
|
8366 |
| - # Reached the maximum amount of checks for the CPU usage |
8367 | 8427 | else {
|
8368 |
| - Write-Verbose(' Still not enough usage, throw an error') |
| 8428 | + if ($curCheck -lt $maxChecks) { |
| 8429 | + Write-Verbose(' Still not enough usage (#' + $curCheck + ')') |
| 8430 | + } |
8369 | 8431 |
|
8370 |
| - # We don't care about an error string here anymore |
8371 |
| - $stressTestError = 'The ' + $selectedStressTestProgram + ' process doesn''t use enough CPU power anymore (only ' + $measuredTime + 'ms instead of the expected ' + $expectedTime + 'ms)' |
8372 |
| - $errorType = 'CPULOAD' |
| 8432 | + # Reached the maximum amount of checks for the CPU usage |
| 8433 | + else { |
| 8434 | + Write-Verbose(' Still not enough usage, throw an error') |
| 8435 | + |
| 8436 | + # We don't care about an error string here anymore |
| 8437 | + $stressTestError = 'The ' + $selectedStressTestProgram + ' process doesn''t use enough CPU power anymore (only ' + $measuredTime + 'ms instead of the expected ' + $expectedTime + 'ms)' |
| 8438 | + $errorType = 'CPULOAD' |
| 8439 | + } |
8373 | 8440 | }
|
8374 | 8441 | }
|
8375 | 8442 | }
|
8376 | 8443 | }
|
8377 |
| - } |
| 8444 | + } while (0) |
8378 | 8445 | }
|
8379 | 8446 |
|
8380 | 8447 |
|
@@ -10943,6 +11010,11 @@ try {
|
10943 | 11010 |
|
10944 | 11011 | # Special handling for Linpack
|
10945 | 11012 | if ($testProgram.Name -eq 'linpack') {
|
| 11013 | + if ($isLinpack) { |
| 11014 | + $Script:stressTestLogFileName = 'Linpack_' + $scriptStartDateTime + '_Version_' + $settings.Linpack.version + '_' + $settings.mode + '.log' |
| 11015 | + $Script:stressTestLogFilePath = $logFilePathAbsolute + $stressTestLogFileName |
| 11016 | + } |
| 11017 | + |
10946 | 11018 | $stressTestPrograms[$testProgram.Name]['fullPathToLoadExe'] = $testProgram.Value['absolutePath'] + $testProgram.Value['processNameForLoad']
|
10947 | 11019 |
|
10948 | 11020 | $data['%fileName%'] = ($testProgram.Value['processNameForLoad'] + '.' + $testProgram.Value['processNameExt'])
|
@@ -11018,12 +11090,6 @@ try {
|
11018 | 11090 | $linpackMode = $(if ($settings.Linpack.version -eq '2018' -or $settings.Linpack.version -eq '2019') { $settings.Linpack.mode.ToUpperInvariant() } else { 'FASTEST' })
|
11019 | 11091 |
|
11020 | 11092 | $data.add('%MKL_DEBUG_CPU_TYPE%', '$env:MKL_DEBUG_CPU_TYPE = ' + $MKL_DEBUG_CPU_TYPES[$linpackMode][$processorType] + ';')
|
11021 |
| - |
11022 |
| - |
11023 |
| - if ($isLinpack) { |
11024 |
| - $Script:stressTestLogFileName = 'Linpack_' + $scriptStartDateTime + '_Version_' + $settings.Linpack.version + '_' + $settings.mode + '.log' |
11025 |
| - $Script:stressTestLogFilePath = $logFilePathAbsolute + $stressTestLogFileName |
11026 |
| - } |
11027 | 11093 | }
|
11028 | 11094 |
|
11029 | 11095 |
|
@@ -12933,7 +12999,7 @@ try {
|
12933 | 12999 | 'checkType' = 'LAST_ERROR_CHECK'
|
12934 | 13000 | 'actualCoreNumber' = $actualCoreNumber
|
12935 | 13001 | 'coreTestOrderArray' = $coreTestOrderArray
|
12936 |
| - 'coreIndex' = $coreIndex |
| 13002 | + 'coreIndex' = [Ref] $coreIndex |
12937 | 13003 | 'ExceptionObj' = $_
|
12938 | 13004 | 'ErrorObj' = $Error
|
12939 | 13005 | }
|
|
0 commit comments