93 lines
7.2 KiB
PowerShell
93 lines
7.2 KiB
PowerShell
# Counter ASIC 3.0, PC 1 AMD reset job (6 October 2026, after Ember run 6): the RX 9070 XT's ADLX tuning state back to
|
|
# factory, and the identities question answered by reading. Main's facts: after Ember the card reads `gmax 0 plimit 0
|
|
# factory 0` (every offset zero, nothing applied, but the factory flag is off). This job prints the state line BEFORE
|
|
# (`RESULT amd_state before gmax= plimit= factory=`), applies the factory reset the way the Ember playbook did
|
|
# (`igneum-gpu-telemetry --card <ordinal> --reset`, ember-tune ca990c2: the helper prints the `tune` line read back after
|
|
# the change), prints the state line AFTER, and fails loudly if the after line does not read factory 1. The helper is the
|
|
# one that answers `--tune`: the installed app's igneum-gpu-telemetry.exe first, else the newest copy under an amd-kit
|
|
# job folder (the Ember kit); which one answered is printed. Then, READ ONLY: every gfx1201 entry of settings.json (key,
|
|
# enabled, identities) and the app's /api/state card list (key, identities, state, MH/s, watts), so the 15:56Z restore
|
|
# question (identities 8 or 2 on the live key) is answered in this report; NO POST of identities here. Beside the miners,
|
|
# no card switch; the only write is the ADLX reset on the card's tuning (not the app). Never quits, pauses, resumes or
|
|
# updates the installed app; never writes settings.json. Every result line starts with RESULT; a `SUMMARY {json}` line
|
|
# ends the job. Read back with `node tools/jobs.mjs <job id>`.
|
|
$ErrorActionPreference = 'Continue'
|
|
$jobName = 'pc1-amd-reset'
|
|
$started = Get-Date
|
|
function Stamp { (Get-Date).ToUniversalTime().ToString('yyyy-MM-ddTHH:mm:ssZ') }
|
|
function Summary([string] $status, [hashtable] $extra) {
|
|
$o = [ordered]@{ job = $jobName; status = $status; duration_s = [int]((Get-Date) - $started).TotalSeconds; finished_at = (Stamp) }
|
|
foreach ($k in $extra.Keys) { $o[$k] = $extra[$k] }
|
|
'SUMMARY ' + ($o | ConvertTo-Json -Compress -Depth 4)
|
|
}
|
|
"RESULT start $(Stamp) job=$jobName machine=$env:COMPUTERNAME app_version=$env:IGNEUM_APP_VERSION"
|
|
$inst = @("$env:LOCALAPPDATA\Programs\Igneum Miner", "$env:ProgramFiles\Igneum Miner") | Where-Object { Test-Path (Join-Path $_ 'igneum-app.exe') } | Select-Object -First 1
|
|
$appDir = if ($env:IGNEUM_APP_DIR) { $env:IGNEUM_APP_DIR } else { Join-Path $env:LOCALAPPDATA 'igneum\app' }
|
|
$urlFile = Join-Path $appDir 'app.url'
|
|
$base = $null
|
|
if (Test-Path $urlFile) { $base = (Get-Content -LiteralPath $urlFile -Raw).Trim().TrimEnd('/') }
|
|
"RESULT app install=$inst app_dir=$appDir url_present=$([bool]$base)"
|
|
|
|
# ---- the helper that answers --tune ----
|
|
$cands = @()
|
|
if ($inst -and (Test-Path (Join-Path $inst 'igneum-gpu-telemetry.exe'))) { $cands += (Join-Path $inst 'igneum-gpu-telemetry.exe') }
|
|
$kits = @(Get-ChildItem -Path (Join-Path $appDir 'jobs') -Recurse -Filter 'igneum-gpu-telemetry.exe' -ErrorAction SilentlyContinue | Where-Object { $_.FullName -match 'amd-kit' } | Sort-Object LastWriteTime -Descending | ForEach-Object { $_.FullName })
|
|
$cands += $kits
|
|
$tele = $null; $tuneBefore = @()
|
|
foreach ($c in $cands) {
|
|
$t = @(& $c --tune 2>&1 | ForEach-Object { "$_" })
|
|
$t | ForEach-Object { "RESULT tune_probe helper=$c $_" }
|
|
if (($t | Where-Object { $_ -match '^tune \d+ name ' }).Count -gt 0) { $tele = $c; $tuneBefore = $t; break }
|
|
}
|
|
if (-not $tele) { "RESULT amd_state error=no igneum-gpu-telemetry.exe answered --tune (tried: $($cands -join ' ; '))"; Summary 'failed' @{ error = 'no helper with --tune' }; exit 2 }
|
|
"RESULT tele helper=$tele sha256=$((Get-FileHash -Algorithm SHA256 $tele).Hash.ToLower())"
|
|
# tune <ordinal> name "<name>" gmax <MHz> gmax_range <min> <max> plimit <offset %> plimit_range <min> <max> factory 0|1 ok|<error>
|
|
$re = '^tune (\d+) name "([^"]*)" gmax (\S+) gmax_range (\S+) (\S+) plimit (\S+) plimit_range (\S+) (\S+) factory (\S+) (.*)$'
|
|
$line = $tuneBefore | Where-Object { $_ -match $re -and $_ -match '9070' } | Select-Object -First 1
|
|
if (-not $line) { "RESULT amd_state error=no tune line for the 9070 XT in: $($tuneBefore -join ' | ')"; Summary 'failed' @{ error = 'no 9070 XT tune line' }; exit 2 }
|
|
$null = $line -match $re
|
|
$ordinal = [int]$Matches[1]; $name = $Matches[2]
|
|
"RESULT amd_state before gmax=$($Matches[3]) gmax_range=$($Matches[4])..$($Matches[5]) plimit=$($Matches[6]) plimit_range=$($Matches[7])..$($Matches[8]) factory=$($Matches[9]) verdict=$($Matches[10]) ordinal=$ordinal name='$name'"
|
|
$factoryBefore = $Matches[9]
|
|
$factoryAfter = ''
|
|
if ($factoryBefore -eq '1') {
|
|
"RESULT amd_reset skipped: the card already reads factory 1"
|
|
$factoryAfter = '1'
|
|
} else {
|
|
$r = @(& $tele --card $ordinal --reset 2>&1 | ForEach-Object { "$_" })
|
|
$r | ForEach-Object { "RESULT amd_reset $_" }
|
|
Start-Sleep -Seconds 2
|
|
$after = @(& $tele --tune 2>&1 | ForEach-Object { "$_" })
|
|
$la = $after | Where-Object { $_ -match $re -and $_ -match '9070' } | Select-Object -First 1
|
|
if ($la -and ($la -match $re)) {
|
|
$factoryAfter = $Matches[9]
|
|
"RESULT amd_state after gmax=$($Matches[3]) gmax_range=$($Matches[4])..$($Matches[5]) plimit=$($Matches[6]) plimit_range=$($Matches[7])..$($Matches[8]) factory=$factoryAfter verdict=$($Matches[10]) ordinal=$ordinal name='$name'"
|
|
} else { "RESULT amd_state after error=no tune line for the 9070 XT after the reset: $($after -join ' | ')" }
|
|
if ($factoryAfter -ne '1') { "RESULT amd_reset error=the card does not read factory 1 after --reset (reads '$factoryAfter'); the reset did not take or the flag does not follow a zero-offset reset" }
|
|
}
|
|
|
|
# ---- READ ONLY: settings.json entries and the app's live card list ----
|
|
$entries = 0
|
|
try {
|
|
$sj = Get-Content -LiteralPath (Join-Path $appDir 'settings.json') -Raw | ConvertFrom-Json
|
|
foreach ($prop in $sj.cards.PSObject.Properties) {
|
|
if ($prop.Name -like 'amd:*' -and $prop.Name -match 'gfx1201') { $entries++; "RESULT settings_entry key=$($prop.Name) enabled=$([bool] $prop.Value.enabled) identities=$($prop.Value.identities) power_pct=$($prop.Value.power_pct) pinned=$($prop.Value.pinned)" }
|
|
}
|
|
} catch { "RESULT settings_read_failed $($_.Exception.Message)" }
|
|
$liveKey = ''; $liveIdent = ''
|
|
if ($base) {
|
|
try {
|
|
$st = Invoke-RestMethod -Uri "$base/api/state" -Method GET -TimeoutSec 10
|
|
$cards = $st.mining.cards; if (-not $cards) { $cards = $st.cards }
|
|
foreach ($c in @($cards)) {
|
|
"RESULT state_card key=$($c.key) vendor=$($c.vendor) name='$($c.name)' device=$($c.device) enabled=$($c.enabled) identities=$($c.identities) state=$($c.state) pid=$($c.pid) mhs_now=$($c.hash_now) mhs_avg=$($c.hash_avg) watts=$($c.power_w) temp=$($c.temp_gpu)"
|
|
if ($c.vendor -eq 'amd' -and ("$($c.key)" -match 'gfx1201') -and $c.state -ne 'off') { $liveKey = $c.key; $liveIdent = $c.identities }
|
|
}
|
|
"RESULT identities_answer live_key=$liveKey identities=$liveIdent (the entry the app runs the 9070 XT under, and its identities as it mines now; settings entries above: $entries)"
|
|
} catch { "RESULT state_read_failed $($_.Exception.Message) (api/state answered nothing: the settings entries above are the record)" }
|
|
} else { "RESULT state_read_skipped no app.url" }
|
|
"RESULT end $(Stamp)"
|
|
$status = if ($factoryAfter -eq '1') { 'done' } else { 'failed' }
|
|
Summary $status @{ factory_before = $factoryBefore; factory_after = $factoryAfter; helper = $tele; live_key = $liveKey; live_identities = "$liveIdent"; settings_entries = $entries }
|
|
if ($status -eq 'failed') { exit 1 }
|
|
exit 0
|