Skip to content

accel_sampler: the fault stream greps IO_PAGE_FAULT alone, so an NPU TDR/power-cycle is invisible to the instrument that attributes faults #3067

Closed

Description

@bong-water-water-bong

The fault sampler's capture stream greps one class of line, so an NPU TDR never reaches the record and the window reads clean.

Measured

tools/diag/accel_sampler.sh watches the kernel log with

journalctl -k -f -o short-unix | grep --line-buffered 'IO_PAGE_FAULT'

At 2026-11-20 18:10:43 AST (22:10:43Z) the kernel logged an NPU TDR + power-cycle — four lines:

amdxdna 0000:c6:00.1: [drm] *ERROR* aie2_tdr_dead_fw_detect: TDR timeout detected
amdxdna 0000:c6:00.1: [drm] aie2_tdr_work_func: Device isn't making progress
amdxdna 0000:c6:00.1: [drm] aie2_tdr_dead_fw_recover_all: Array stopped dispatching, power-cycling NPU to recover
amdxdna 0000:c6:00.1: [drm] aie2_hw_reset: NPU firmware unhealthy: power-cycling NPU

cat /sys/module/amdxdna/srcversion → 5682285F370899D14A057FF.

The sampler was running at that moment (unit accel-sampler.service, active since 14:10:23 AST / 18:10:23Z, ~4 h
before the event) and:

$ grep -cE 'aie2_tdr|power-cycling' ~/.cache/accel-sampler/samples.log        -> 0
$ grep -cE 'aie2_tdr|power-cycling' ~/.cache/accel-sampler/attributed.log     -> 0
$ grep -cE 'aie2_tdr|power-cycling' ~/.cache/accel-sampler/summary.txt        -> 0
$ journalctl -k --since -3h | grep -cE 'aie2_tdr|power-cycling|hw_reset'      -> 4

So the instrument whose whole purpose is "was a fault inside this window?" recorded nothing for a window it covered,
and the summary for that window — which prints ## no IO_PAGE_FAULT was seen in this window — reads as a clean window
to anyone who does not know that a TDR is a different line.

Why the stream has to be a superset, not a diagnosis

scripts/gpu-hold decides refusals with one pattern (GPU_FAULT_RE, engine#2480/#2486/#2498): a page fault, any
amdgpu/MES reset, ring ... timeout, amdxdna command timeout / power-cycling / fault. The sampler is a
recorder, so its pattern must cover at least that set: it may carry a line the gate ignores, never miss one the gate
acts on. Note the same episode shows the gate's own pattern is narrower than the episode — it matches the two
power-cycling lines but neither aie2_tdr_dead_fw_detect: TDR timeout detected nor aie2_tdr_work_func — which is
correct for a refusal gate (it acted, takes were refused) and wrong for an attribution record, where the first line is
the diagnosis.

Fix

One line in watch_faults() — the streaming grep — plus the summary's empty-window wording:

FAULT_RE='IO_PAGE_FAULT|aie2_tdr|aie2_hw_reset|amdxdna.*(command timeout|power.?cycl(e|ing)|fault)|MES.*(reset|failure|failed to respond)'

The per-device split needs no change: a TDR line's token after kernel: is still amdxdna, the token the summary's
awk already reads (verified in a fixture).

Metadata

Metadata

Labels

No labels
No labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions