Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion records/SCHEMA.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ records/<device>/<os>/<date>-<id>/
| `os_version` | string | `/etc/os-release` PRETTY_NAME, or `sw_vers` product version |
| `os_build` | string | macOS build (`sw_vers -buildVersion`), `null` on Linux |
| `kernel` | string | `uname -r` (Linux), `uname -v` (macOS) |
| `kernel_module` | object | Linux: `{"name": "asahi", "build_id": "...", "srcversion": "...", "params": {...}}` |
| `kernel_module` | object | Linux: `{"name": "aurora", "build_id": "...", "srcversion": "...", "params": {...}}` (`asahi` on kernels before the rename) |
| `driver` | object | from the executor `--info`: `name`, `info` (driver info string), `version`, `api_version`, `mesa_sha` (Linux) |
| `gpu` | object | `name`, `cores` when known, `family` |
| `firmware` | string | GPU firmware version when visible, else `null` |
Expand Down
12 changes: 7 additions & 5 deletions rt/tools/run-record.sh
Original file line number Diff line number Diff line change
Expand Up @@ -73,11 +73,13 @@ ENVJ=$(env | grep -E '^(VK_DRIVER_FILES|VK_ICD_FILENAMES|MESA_|HK_|AGX_|ASAHI_)'
if [ "$OS" = macos ]; then
KMOD=null; HEALTH=null; FW=null
else
bid=$(modinfo -F srcversion asahi 2>/dev/null); par=""
for f in /sys/module/asahi/parameters/*; do [ -r "$f" ] && par="$par${par:+,}\"$(basename "$f")\":\"$(cat "$f" 2>/dev/null)\""; done
bidf=$(readelf -n "$(modinfo -n asahi 2>/dev/null)" 2>/dev/null | awk '/Build ID/ { print $3; exit }')
KMOD="{\"name\":\"asahi\",\"build_id\":\"$bidf\",\"srcversion\":\"$bid\",\"params\":{$par}}"
KL=$(journalctl -k -b --since "@$T0" 2>/dev/null | grep -i -E 'asahi|agx|gpu|drm|fault|timeout' | tail -40 | esc)
# The GPU kernel module: aurora, or asahi on kernels before the rename.
km=aurora; [ -d /sys/module/aurora ] || km=asahi
bid=$(modinfo -F srcversion $km 2>/dev/null); par=""
for f in /sys/module/$km/parameters/*; do [ -r "$f" ] && par="$par${par:+,}\"$(basename "$f")\":\"$(cat "$f" 2>/dev/null)\""; done
bidf=$(readelf -n "$(modinfo -n $km 2>/dev/null)" 2>/dev/null | awk '/Build ID/ { print $3; exit }')
KMOD="{\"name\":\"$km\",\"build_id\":\"$bidf\",\"srcversion\":\"$bid\",\"params\":{$par}}"
KL=$(journalctl -k -b --since "@$T0" 2>/dev/null | grep -i -E 'aurora|asahi|agx|gpu|drm|fault|timeout' | tail -40 | esc)
alive=false; pgrep -x Hyprland > /dev/null && alive=true
HEALTH="{\"kernel_log\":\"$KL\",\"desktop_alive\":$alive}"
FW=null
Expand Down
2 changes: 1 addition & 1 deletion stress/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ the run exits with status 2. The default patterns are generic for Linux DRM driv
```
\b(gpu|drm)\b.*(hang|hung|time ?out|timed out|reset|recover|lost|crash|fault|wedged)
\[drm(:[^]]*)?\] \*error\*
\b(amdgpu|radeon|i915|xe|nouveau|msm|freedreno|panfrost|panthor|lima|v3d|vc4|etnaviv|powervr|asahi)\b.*(error|fail|fault|time ?out|timed out|hang|reset|lost|crash)
\b(amdgpu|radeon|i915|xe|nouveau|msm|freedreno|panfrost|panthor|lima|v3d|vc4|etnaviv|powervr|aurora|asahi)\b.*(error|fail|fault|time ?out|timed out|hang|reset|lost|crash)
firmware.*(crash|hang|time ?out|timed out)
\b(etimedout|device lost)\b
\b(oops|kernel bug|bug:|unable to handle kernel|general protection fault|use-after-free|kasan)
Expand Down
2 changes: 1 addition & 1 deletion stress/src/klog.c
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
static const char *const default_patterns[] = {
"\\b(gpu|drm)\\b.*(hang|hung|time ?out|timed out|reset|recover|lost|crash|fault|wedged)",
"\\[drm(:[^]]*)?\\] \\*error\\*",
"\\b(amdgpu|radeon|i915|xe|nouveau|msm|freedreno|panfrost|panthor|lima|v3d|vc4|etnaviv|powervr|asahi)\\b.*"
"\\b(amdgpu|radeon|i915|xe|nouveau|msm|freedreno|panfrost|panthor|lima|v3d|vc4|etnaviv|powervr|aurora|asahi)\\b.*"
"(error|fail|fault|time ?out|timed out|hang|reset|lost|crash)",
"firmware.*(crash|hang|time ?out|timed out)",
"\\b(etimedout|device lost)\\b",
Expand Down
2 changes: 1 addition & 1 deletion tools/compare.py
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ def describe(meta, label):
bits = [meta.get("device", "?"), meta.get("os", "?"), meta.get("os_version", "")]
if meta.get("os") == "linux":
km = meta.get("kernel_module") or {}
bits += [f"kernel {meta.get('kernel')}", f"asahi.ko {str(km.get('build_id') or '?')[:12]}",
bits += [f"kernel {meta.get('kernel')}", f"{km.get('name') or 'asahi'}.ko {str(km.get('build_id') or '?')[:12]}",
f"Mesa {meta.get('mesa_sha')}"]
else:
bits += [f"build {meta.get('os_build')}"]
Expand Down
5 changes: 3 additions & 2 deletions tools/performance-gate.py
Original file line number Diff line number Diff line change
Expand Up @@ -244,8 +244,9 @@ def qualification_errors(record):
digest = lambda value: isinstance(value, str) and re.fullmatch(r'[0-9a-f]{64}', value)
if not isinstance(module_id, str) or not re.fullmatch(r'[0-9a-f]{40}', module_id):
errors.append('Linux module build ID is missing or malformed')
if not isinstance(module, dict) or module.get('name') != 'asahi':
errors.append('Linux stack does not identify the asahi module')
# The GPU module is aurora, or asahi on kernels before the rename.
if not isinstance(module, dict) or module.get('name') not in ('aurora', 'asahi'):
errors.append('Linux stack does not identify the GPU kernel module (aurora)')
if not commit(meta.get('mesa_sha')) or not digest(meta.get('mesa_sha256')):
errors.append('Linux Mesa source/library identity is missing or malformed')
assets = meta.get('assets_manifest')
Expand Down
17 changes: 9 additions & 8 deletions tools/run-linux.sh
Original file line number Diff line number Diff line change
Expand Up @@ -63,12 +63,13 @@ state_json() {
printf '},"loadavg":%s}' "$(jstr "$(cat /proc/loadavg)")"
}

module_json() {
local m=/sys/module/asahi f bid="" first=1
module_json() { # the GPU kernel module: aurora, or asahi on kernels before the rename
local m=/sys/module/aurora f bid="" first=1
[ -d "$m" ] || m=/sys/module/asahi
[ -d "$m" ] || { printf null; return; }
f=$m/notes/.note.gnu.build-id
bid=$( (cat "$f" 2>/dev/null || sudo -n cat "$f" 2>/dev/null) | od -An -tx1 -v | tr -d ' \n' | tail -c 40)
printf '{"name":"asahi","build_id":%s,"srcversion":%s,"params":{' "$(jstr_or_null "$bid")" \
printf '{"name":"%s","build_id":%s,"srcversion":%s,"params":{' "${m##*/}" "$(jstr_or_null "$bid")" \
"$(jstr_or_null "$(cat $m/srcversion 2>/dev/null)")"
for f in $m/parameters/*; do
[ -r "$f" ] || continue
Expand All @@ -80,13 +81,13 @@ module_json() {

gpu_log() { # kernel log lines since the run started that point at GPU trouble
journalctl -k --since "@$T0" --no-pager -q 2>/dev/null |
grep -iE 'asahi|agx|drm' | grep -iE 'GPU fault|page fault|crashed|runtime stopped|client failed|timed out|timeout|still draining|queued-failure|hang|recover' || true
grep -iE 'aurora|asahi|agx|drm' | grep -iE 'GPU fault|page fault|crashed|runtime stopped|client failed|timed out|timeout|still draining|queued-failure|hang|recover' || true
}

gpu_notes() { # other asahi lines worth keeping with the record (do not stop the run)
journalctl -k --since "@$T0" --no-pager -q 2>/dev/null | grep -iE 'asahi|agx' |
gpu_notes() { # other GPU driver lines worth keeping with the record (do not stop the run)
journalctl -k --since "@$T0" --no-pager -q 2>/dev/null | grep -iE 'aurora|asahi|agx' |
grep -viE 'GPU fault|page fault|crashed|runtime stopped|client failed|timed out|timeout|still draining|queued-failure|hang|recover' |
sed -E 's/^.*(asahi|agx)/\1/I; s/[0-9]{4,}/N/g' | sort | uniq -c | sort -rn | head -20 || true
sed -E 's/^.*(aurora|asahi|agx)/\1/I; s/[0-9]{4,}/N/g' | sort | uniq -c | sort -rn | head -20 || true
}

desktop_alive() {
Expand Down Expand Up @@ -125,7 +126,7 @@ for c in $SEL; do
fi
done
STATE_AFTER=$(state_json)
FW=$(journalctl -k -b --no-pager -q 2>/dev/null | grep -iE 'asahi.*(firmware|fw).*version|firmware version' | tail -1 | sed 's/.*\(irmware\|fw\)[^0-9]*//I' | cut -c1-40)
FW=$(journalctl -k -b --no-pager -q 2>/dev/null | grep -iE '(aurora|asahi).*(firmware|fw).*version|firmware version' | tail -1 | sed 's/.*\(irmware\|fw\)[^0-9]*//I' | cut -c1-40)
OSV=$(. /etc/os-release 2>/dev/null; echo "${PRETTY_NAME:-linux}")
GPU_NAME=$(printf '%s' "$INFO" | sed -n 's/.*"device_name":"\([^"]*\)".*/\1/p')
SUITE_SHA=$(cat "$BIN/SUITE_SHA" 2>/dev/null || git -C "$ROOT" describe --always --dirty=+dirty --abbrev=7 2>/dev/null || echo unknown)
Expand Down
9 changes: 9 additions & 0 deletions tools/tests/test_performance_gate.py
Original file line number Diff line number Diff line change
Expand Up @@ -184,6 +184,15 @@ def test_numeric_comparison_does_not_claim_unknown_or_failed_stack_eligible(self
self.assertFalse(ledger['qualification_eligible'])
self.assertFalse(ledger['passed'])

def test_both_gpu_module_names_identify_the_stack(self):
for name, eligible in (('aurora', True), ('asahi', True), ('panfrost', False)):
with self.subTest(name=name):
meta = metadata('linux')
meta['kernel_module'].update(name=name)
candidate = gate.load_record(self.record([result(9)], meta=meta), 'linux')
errors = gate.qualification_errors(candidate)
self.assertEqual(not any('GPU kernel module' in e for e in errors), eligible)

def test_retained_evidence_contradictions_block_eligibility(self):
for name, data in [('assets-manifest.json', '{}'), ('new-faults.txt', 'GPU fault'),
('commands.jsonl', '{"rc":1}\n')]:
Expand Down