diff --git a/.github/ISSUE_TEMPLATE/drain-report.yml b/.github/ISSUE_TEMPLATE/drain-report.yml index 01382a4..7b6e365 100644 --- a/.github/ISSUE_TEMPLATE/drain-report.yml +++ b/.github/ISSUE_TEMPLATE/drain-report.yml @@ -83,7 +83,7 @@ body: id: events attributes: label: Events JSON - description: Output of `berth events --json` captured around the scenario, pasted whole + description: Output of `berth events --format json` captured around the scenario, pasted whole validations: required: true diff --git a/.gitignore b/.gitignore index ee8156a..03ecc76 100644 --- a/.gitignore +++ b/.gitignore @@ -8,3 +8,7 @@ bin/ # OME boards stay local; this repo is public .ome/ + +# the binary a plain `go build` leaves at the root: untracked, it marks every later build +dirty +/berth +/berth.exe diff --git a/CHANGELOG.md b/CHANGELOG.md index 43083c5..f4fd8b3 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -24,6 +24,14 @@ has a matching GitHub release whose body comes from its section below. one WARN line. A relative path fails `berth config check`, and `berth prefetch MODEL` makes the same ask by hand. +### Fixed + +- The Windows check kit (`contrib/windows/check.ps1`): the per-process rows render again, the label and + the MiB figure computed before the row list, and the status reads the keys it actually has + (`squatters`, `unprotected`, `leases`; there is no `holders`). `berth events` is called with + `--format json`, and a berth that answers nothing leaves its stderr in the report instead of + a silent "returned nothing". + ## [v0.3.2] - 2026-10-20 Fixes from the first Windows testers, and four contributions. On Windows, the Epic Games diff --git a/contrib/chaos/README.md b/contrib/chaos/README.md index b1af04d..da2cd15 100644 --- a/contrib/chaos/README.md +++ b/contrib/chaos/README.md @@ -60,5 +60,5 @@ Use the [drain report issue form](https://github.com/T-Crypt/berth/issues/new?te It collects: which scenario, pass / fail / other, the GPU and its VRAM, the driver version (`nvidia-smi` prints it), the OS, the engines on the card, the berth version (`berth version`) and the event log around the run -(`berth events --json`). Capture the events output before you restart +(`berth events --format json`). Capture the events output before you restart anything, and paste it whole. diff --git a/contrib/windows/README.md b/contrib/windows/README.md index 66c917b..d160f1e 100644 --- a/contrib/windows/README.md +++ b/contrib/windows/README.md @@ -19,7 +19,7 @@ collects, so a report takes one run instead of a dozen screenshots. unexpected one for a misbehaving engine. - When you give it a CUDA app, one run of it under `berth run --as hog`, its output and its exit code. -- The event log around the run (`berth events --json`, the last 200 lines). +- The event log around the run (`berth events --format json`, the last 200 lines). It is captured before you restart anything. ## What it needs diff --git a/contrib/windows/check.ps1 b/contrib/windows/check.ps1 index ff44d23..3c50148 100644 --- a/contrib/windows/check.ps1 +++ b/contrib/windows/check.ps1 @@ -27,7 +27,7 @@ function Note($text) { } Note "berth windows check - $(Get-Date -Format 'yyyy-MM-dd HH:mm:ss')" -Note "machine: $env:COMPUTERNAME, user: $env:USERNAME, powershell: $PSVersionTable.PSVersion.ToString()" +Note "machine: $env:COMPUTERNAME, user: $env:USERNAME, powershell: $($PSVersionTable.PSVersion.ToString())" # 1. The berth version and the node it talks to. Note "" @@ -91,24 +91,33 @@ else { Note "PID NAME BERTH(MiB) DRIVER(MiB)" $berthPids = @{} $rows = @() - if ($null -ne $stat.holders) { - foreach ($h in $stat.holders) { - $berthPids[$h.pid] = $true - $d = "-" - if ($driverMiB.ContainsKey($h.pid)) { $d = "$($driverMiB[$h.pid])" } - $rows += ,@($h.pid, "holder " + $h.name, $h.used / 1MB, $d) - } - } + # The label and the MiB figure go into variables first: in PowerShell the + # comma binds tighter than + and /, so inside a @(...) list they split + # one element into two and shift every column after it. if ($null -ne $stat.squatters) { foreach ($s in $stat.squatters) { $berthPids[$s.pid] = $true $d = "-" if ($driverMiB.ContainsKey($s.pid)) { $d = "$($driverMiB[$s.pid])" } - $rows += ,@($s.pid, "stowaway " + $s.name, $s.used / 1MB, $d) + $label = "stowaway " + $s.name + $mib = [string][math]::Round([double]$s.used / 1MB) + $rows += ,@($s.pid, $label, $mib, $d) + } + } + # Unprotected runs: the daemon stopped keeping them, so status has no + # berth figure for them; the driver's counter is the check of the run. + if ($null -ne $stat.unprotected) { + foreach ($u in $stat.unprotected) { + if ($u.pid -le 0) { continue } + $berthPids[$u.pid] = $true + $d = "-" + if ($driverMiB.ContainsKey($u.pid)) { $d = "$($driverMiB[$u.pid])" } + $label = "unprotected " + $u.engine + $rows += ,@($u.pid, $label, "-", $d) } } foreach ($r in $rows) { - Note ("{0,-8} {1,-24} {2,9} {3,12}" -f $r[0], $r[1], [math]::Round($r[2]), $r[3]) + Note ("{0,-8} {1,-24} {2,9} {3,12}" -f $r[0], $r[1], $r[2], $r[3]) } if ($rows.Count -eq 0) { Note "(no process on the card that berth knows)" @@ -146,15 +155,17 @@ if ($App -ne "") { # 6. The event log around the run, the form's last field. Capture it before # you restart anything. Note "" -Note "== berth events --json (last 200 lines)" -$events = & $Berth events --json 2>$null +Note "== berth events --format json (last 200 lines)" +# stderr rides along in the capture, so a berth that answers nothing still +# leaves its error in the report instead of a silent "returned nothing". +$events = & $Berth events --format json 2>&1 if ($null -ne $events) { $events | Select-Object -Last 200 | ForEach-Object { if ($null -ne $_ -and "$_" -ne "") { Note $_ } } } else { - Note "berth events returned nothing" + Note "berth events wrote nothing (exit code $LASTEXITCODE)" } [System.IO.File]::WriteAllLines($Report, $lines, (New-Object System.Text.UTF8Encoding($false)))