66 lines
5.2 KiB
PowerShell
66 lines
5.2 KiB
PowerShell
# Igneum run job (bench only): the class v3 dataset construction (mixer x4, docs/plans/mixer-x4.md) on PC 1's RX 9070 XT on the eGPU (machine ae432dc7), 5 October 2026.
|
|
# Published as a plain `run` job (NOT --stop-miners): the installed app keeps every other card mining; this script switches
|
|
# off ONLY the NVIDIA card in the app through POST <app.url>api/cards, waits for its worker to stop, runs the fetched
|
|
# igneum-worker-opencl.exe on the v2 pack and the two v3 packs of the fetched packs folder (the dataset build time per pack is the
|
|
# number this job is for: the worker's own `cache ... dataset ... ms` line, the same line the readwidth round printed),
|
|
# and switches the card back on with the settings it had. Every result line starts with RESULT so `node tools/jobs.mjs <job id>` shows them.
|
|
# The packs folder of the fetch job: proto-cuda/packs-ca2-mixer/mx4-genesis, mx4-devnet-epoch0, mx8-genesis and mx8-devnet-epoch0 (the x8 candidate) from branch ca2-mixer, plus
|
|
# proto-cuda/packs/igneum-genesis-mh copied in as v2-genesis-mh (the version 2 control, same card, same run).
|
|
$ErrorActionPreference = 'Continue'
|
|
function Say([string] $m) { Write-Host ("[" + (Get-Date -Format 'HH:mm:ss') + "] " + $m) }
|
|
$jobs = Split-Path $env:IGNEUM_JOB_DIR
|
|
$fetched = Join-Path $jobs 'fetch-mixer-x4-20261005'
|
|
$exe = Join-Path $fetched 'igneum-worker-opencl.exe'
|
|
$packs = Join-Path $fetched 'packs-ca2-mixer'
|
|
if (-not (Test-Path $exe)) { Write-Output "RESULT error worker missing at $exe (the fetch job runs first)"; exit 2 }
|
|
if (-not (Test-Path $packs)) { Write-Output "RESULT error packs missing at $packs"; exit 2 }
|
|
Write-Output "RESULT worker $exe sha256 $((Get-FileHash -Algorithm SHA256 $exe).Hash.ToLower())"
|
|
# the card's OpenCL device index on the current (3683.0) platform, from the worker's own list (the older platform's duplicate is marked dup)
|
|
$list = & $exe --list 2>&1
|
|
$list | ForEach-Object { "RESULT list $_" }
|
|
$dev = $null
|
|
foreach ($l in $list) { if ($l -match '^\s*\[(\d+)\].*gfx1201' -and $l -notmatch 'dup') { $dev = [int]$Matches[1]; break } }
|
|
# the 9070 XT when it is on the bus, else the integrated gfx1036 (the coordinator's rule for the AMD build-time row)
|
|
if ($null -eq $dev) { foreach ($l in $list) { if ($l -match '^\s*\[(\d+)\].*gfx1036' -and $l -notmatch 'dup') { $dev = [int]$Matches[1]; Write-Output 'RESULT device-fallback gfx1036 (no gfx1201 on the bus)'; break } } }
|
|
if ($null -eq $dev) { Write-Output 'RESULT error no gfx1201 or gfx1036 device in --list'; exit 2 }
|
|
Write-Output "RESULT device $dev"
|
|
|
|
# the app: switch off the NVIDIA card only, remember its settings
|
|
$appDir = $env:IGNEUM_APP_DIR
|
|
if (-not $appDir) { $appDir = Join-Path $env:LOCALAPPDATA 'igneum\app' }
|
|
$urlFile = Join-Path $appDir 'app.url'
|
|
$url = $null
|
|
if (Test-Path $urlFile) { $url = (Get-Content -LiteralPath $urlFile -Raw).Trim() }
|
|
$card = $null
|
|
if ($url) {
|
|
try {
|
|
$st = Invoke-RestMethod -Uri ($url + 'api/state') -Method GET -TimeoutSec 10
|
|
$card = $st.mining.cards | Where-Object { ($_.vendor -eq 'amd' -and $_.key -match 'gfx1201') } | Select-Object -First 1
|
|
if (-not $card) { $card = $st.cards | Where-Object { ($_.vendor -eq 'amd' -and $_.key -match 'gfx1201') } | Select-Object -First 1 }
|
|
} catch { Say ("api/state: " + $_.Exception.Message) }
|
|
}
|
|
if ($card) {
|
|
Write-Output ("RESULT card " + $card.key + " enabled=" + $card.enabled + " identities=" + $card.identities + " power_pct=" + $card.power_pct + " state=" + $card.state)
|
|
$body = @{ cards = @(@{ key = $card.key; enabled = $false; identities = [int]$card.identities; power_pct = [int]$card.power_pct }) } | ConvertTo-Json -Depth 5
|
|
try { Invoke-RestMethod -Uri ($url + 'api/cards') -Method POST -Body $body -ContentType 'application/json' -TimeoutSec 10 | Out-Null; Say "card off requested" } catch { Say ("api/cards off: " + $_.Exception.Message) }
|
|
$t = 0
|
|
while ($t -lt 90) {
|
|
Start-Sleep -Seconds 5; $t += 5
|
|
try { $st = Invoke-RestMethod -Uri ($url + 'api/state') -Method GET -TimeoutSec 10; $c2 = $st.mining.cards | Where-Object { $_.key -eq $card.key }; if (-not $c2) { $c2 = $st.cards | Where-Object { $_.key -eq $card.key } }; if ($c2 -and $c2.state -eq 'off' -and $c2.pid -eq 0) { break } } catch { }
|
|
}
|
|
Write-Output ("RESULT card-off after " + $t + " s")
|
|
Start-Sleep -Seconds 5
|
|
} else { Write-Output 'RESULT card none-found (the app is not running or has no NVIDIA card); measuring with whatever else runs on the GPU' }
|
|
|
|
# the probe ran in run-readwidth-9070-20261005 (bench-log, 5 October 2026); this second run is the bench only
|
|
foreach ($pk in @('v2-genesis-mh', 'mx4-genesis', 'mx4-devnet-epoch0', 'mx8-genesis', 'mx8-devnet-epoch0')) {
|
|
$d = Join-Path $packs $pk
|
|
Write-Output "RESULT bench $pk start $(Get-Date -Format HH:mm:ss)"
|
|
& $exe --bench-pack --pack $d --batches 5 --batch-log2 24 --device $dev 2>&1 | ForEach-Object { "RESULT $_" }
|
|
}
|
|
|
|
if ($card) {
|
|
$body = @{ cards = @(@{ key = $card.key; enabled = [bool]$card.enabled; identities = [int]$card.identities; power_pct = [int]$card.power_pct }) } | ConvertTo-Json -Depth 5
|
|
try { Invoke-RestMethod -Uri ($url + 'api/cards') -Method POST -Body $body -ContentType 'application/json' -TimeoutSec 10 | Out-Null; Write-Output ("RESULT card restored enabled=" + $card.enabled) } catch { Write-Output ("RESULT error card restore: " + $_.Exception.Message) }
|
|
}
|
|
exit 0
|