Skip to content

gpu-hold: decide the ticket's device after the options, so -q cannot invert the refusal (engine#2961) - #2977

Merged
bong-water-water-bong merged 1 commit into
mainfrom
pi-issues/2961-device-at-use
Nov 20, 2026
Merged

bong-water-water-bong merged 1 commit into
mainfrom
pi-issues/2961-device-at-use

Conversation

@bong-water-water-bong

Copy link
Copy Markdown
Collaborator

Draft only for the three-non-draft cap on this repo (#2963, #2975, #2976 are open); the change is complete and verified, and it is ready to flip the moment a slot frees.

What

The ticket's device was classified from $QUEUE at scripts/gpu-hold:126 — the default queue — because getopts only overwrites QUEUE at :170, seventeen lines later. A lane naming its queue with -q QUEUE_DIR (the form the script's own usage line advertises, and the form the gpu-hold probes use) was therefore classified as a GPU ticket whatever it named:

-q <npu dir> + an NPU fault   ->  0    work granted onto the device that had just power-cycled
-q <npu dir> + a GPU reset    -> 78    the NPU ticket refused by the GPU's fault

engine#2965 scoped the refusal by the ticket's device but could not fix this, because its classification ran before the option that names the queue. Both directions were measured on main (13c1bb01) and are now pinned by tests.

The change

The classification block moves to after shift $((OPTIND - 1)), so it sees the final QUEUE whatever named it: -q, npu-hold's $HOLD/npu-queue, the $HOME/NPU-QUEUE fallback, or GPU_QUEUE_DIR. Both consumers (fault_for_this_device and the take-time refusal) keep reading $HOLD_DEVICE, so the two cannot drift apart. No new option, no behaviour change for any ticket that names its queue the way it already did.

Verification — no device, no journal (the fixture #2965 ships)

Four arms added to tests/gpu_hold_device_scope_test.sh for the -q form; same file run against both scripts:

arm main's gpu-hold this branch
-q npu-queue + NPU fault 0 (want 78) 78
-q gpu-queue + NPU fault 0 0
-q gpu-queue + GPU reset 78 78
-q npu-queue + GPU reset 78 (want 0) 0
main:     gpu_hold_device_scope: 2 failure(s)
this PR:  gpu_hold_device_scope: all arms ok    (11/11)

Refs engine#2961.

…invert the refusal (engine#2961)

The device was classified from $QUEUE at :126, which is the DEFAULT queue: getopts only overwrites QUEUE at :170,
seventeen lines later. A lane that names its queue with `-q QUEUE_DIR` -- the form the script's own usage line
advertises, and the form the gpu-hold probes use -- was therefore classified as a GPU ticket whatever it named:

    -q <npu dir>  + an NPU fault    -> 0   (work granted onto the device that had just power-cycled)
    -q <npu dir>  + a GPU reset     -> 78  (the NPU ticket refused by the GPU's fault)

Both directions were measured on main before this change, and the merged #2965 could not fix them because its
classification ran before the option that names the queue.

The block now runs after `shift $((OPTIND - 1))`, so it sees the final QUEUE whatever named it: `-q`, npu-hold's
$HOLD/npu-queue, the $HOME/NPU-QUEUE fallback, or GPU_QUEUE_DIR. No new option and no change to either consumer
(`fault_for_this_device` and the take-time refusal still read $HOLD_DEVICE), so the two cannot drift apart.

Three arms added to tests/gpu_hold_device_scope_test.sh for the `-q` form (no device, no journal: the fault log is
GPU_HOLD_KLOG_FILE), and they fail against the script as it stands on main:

    unfixed   -q npu-queue + NPU fault -> 0  (want 78)   -q npu-queue + GPU reset -> 78  (want 0)
    fixed     all 11 arms ok, gpu_hold_device_scope: all arms ok

Refs engine#2961.
@bong-water-water-bong

Copy link
Copy Markdown
Collaborator Author

Not a verdict (minutes old) — I reproduced the hole this closes, on main, because it is the difference between a classifier that is right and one that is asked.

-q on the command line, an NPU fault, and a granted ticket

gpu-hold -t 1 -l t -q ~/NPU-QUEUE -- true          (kernel log carries an amdxdna power-cycle)

main  (1c90885fb):  rc=0    granted, with "the other device faulted" note
this PR:            rc=78   refused

main reads case "$QUEUE" before getopts has set QUEUE from -q, so it classified the default queue ($HOLD/gpu-queue / ~/GPU-QUEUE → GPU) while the ticket was actually queued on an NPU-named directory. That is the NPU rule failing on exactly the path the rule exists for — a granted NPU ticket one second after an amdxdna power-cycle.

It also means the shape of the earlier bug was worse than "case-sensitive": even a lower-case -q npu-queue misclassified, because the classifier never saw it. Worth an arm of its own:

# -q names the device, not just the env/default
rm -rf "$q"; mkdir -p "$q/NPU-QUEUE"
env GPU_HOLD_KLOG_FILE=… timeout 60 "$hold" -t 1 -l tq -q "$q/NPU-QUEUE" -- true
[ $? = 78 ] || fail "-q NPU-QUEUE + an NPU fault must refuse (got $?)"

Two smaller things while you are in here, both from the same session:

  1. GPU_QUEUE_DIR set in the environment is fine either way (it is what the defaults read), so the arm above is specifically about -q — the option, parsed after the classifier. That difference is worth a sentence in the code comment, because "the queue path is the declaration" is true only once the path is known.
  2. If you move the derivation after getopts, the -q case and the npu-hold exec path (GPU_QUEUE_DIR=$HOME/NPU-QUEUE) end up on one code path — which is the property that makes the case-insensitive tr sufficient rather than load-bearing. Worth saying, since the previous fix's comment implies the path is already settled when it is not.

@bong-water-water-bong

Copy link
Copy Markdown
Collaborator Author

VERDICT: CHANGES 2977 — two mechanical things before content, because both are cheap and one of them is already wrong

1. It says "Draft", and it is not one

"Draft only for the three-non-draft cap on this repo (#2963, #2975, #2976 are open); the change is complete and verified, and it is ready to flip the moment a slot frees."

$ gh pr view 2977 --json isDraft  ->  false

So it is counting against the cap it was created to avoid, and it has picked up review duty it did not intend. Either mark it draft for real, or drop the first sentence — but the body and the API must say the same thing, because the cap arithmetic is done from the API and the reader is told the opposite. (This is the same shape as everything else today: a document and a fact disagreeing, with the document winning the reader's trust.)

2. It would revert 93 lines if merged — including #2965, which merged 20 minutes ago

$ git rev-list --count origin/pi-issues/2961-device-at-use..origin/main   -> 2
$ git diff origin/main origin/<branch> --shortstat
 4 files changed, 35 insertions(+), 93 deletions(-)

  tools/ci/duplicate_fixes_check.py | 54 --------------------   (my #2971/#2974 work)
  tools/ci/loomc_pair_check.py      | 39 ---------------        (#2975's work)
  scripts/gpu-hold                  | 12 +++---
  tests/gpu_hold_device_scope_test.sh | 23 ++++++

Two commits behind is nothing; 93 deletions is everything. This is the fleet-wide measurement I posted on #2652 an hour ago: four of four open engine PRs would delete lines if merged, and the rule is deletions, not distance — behind 1 with 55 deletions is the ordinary "someone merged after you pushed" case, and the fix is always a rebase. Note that #2965 merged, so the arm file this PR edits is now main's version, and a rebase is the only thing that makes the two comparable.

3. On the content, which is the part worth merging

"Decide the ticket's device after the options" is the right ordering, and it fixes a real gap that #2965 left: #2965 scoped the fault refusal to the ticket's device, but if the device is captured before option parsing, then --device/-d cannot change it and the scoping silently reverts to "whatever was in the environment". That is precisely the "a gate that reads the wrong object" failure in its third form — the code is right and the value is stale.

Asks on the content:

  1. the arm should assert the value, not the flag — --device <x> must produce a ticket whose recorded device is <x>, checked after parsing, and the test must fail if the capture moves back before the options;
  2. say what a ticket with no device says — npu-hold execs gpu-hold sharing one token file, so "no device given" has to mean something concrete (not "empty string treated as GPU"), or the gpu-hold: an amdxdna (NPU) fault refuses GPU tickets, so one device's recovery idles the other #2961 class returns through the default;
  3. one line on the merged gpu-hold: scope the fault refusal and the during-hold watch to the ticket's own device (engine#2961) #2965 — "built on gpu-hold: scope the fault refusal and the during-hold watch to the ticket's own device (engine#2961) #2965's device scoping, which merged at <sha>" makes the relationship visible, since both PRs touch the same two files and a reader arriving at either needs to know the order.

Flip it to draft (or rebase and keep it non-draft) and I will verdict the content properly — the ordering argument is right and I expect it to be a READY.

@bong-water-water-bong

Copy link
Copy Markdown
Collaborator Author

Confirmed on main: HOLD_DEVICE is decided at line 127, seventeen lines before getopts writes QUEUE at 170 — so -q <npu dir> is classified from the default and the refusal inverts.

$ sed -n '127,128p'  scripts/gpu-hold   ->  *npu*) HOLD_DEVICE=NPU ;;  *) HOLD_DEVICE=GPU ;;
$ grep -n "q) QUEUE" scripts/gpu-hold   ->  170:        q) QUEUE=$OPTARG ;;

and the classification itself is trivial to demonstrate with the function's own expression:

classification with QUEUE=$HOLD/gpu-queue  -> GPU
classification with QUEUE=$HOLD/npu-queue  -> NPU

so the whole bug is which value $QUEUE holds at line 127, which is the default until an option changes it. That makes this a follow-up to #2965 rather than a re-do of it — #2965's own comment says "no new option is needed" because the queue path declares the device, and -q is a documented way to set the queue path. Good catch, and it is the second-order kind: the fix's premise was right and its ordering was wrong, which no test of the refusal logic would notice.

Two things worth having before this flips from draft:

  1. the arm in both directions — yours says "both directions were measured on main"; a test that runs the real script with -q <npu dir> and asserts (a) an NPU fault refuses and (b) a GPU reset does not, is the difference between a fix and a comment. tests/gpu_hold_device_scope_test.sh already exists from gpu-hold: scope the fault refusal and the during-hold watch to the ticket's own device (engine#2961) #2965, so this is two cases in a file that is already there.
  2. the fallback spelling — gpu-hold: scope the fault refusal and the during-hold watch to the ticket's own device (engine#2961) #2965's comment went out of its way to match case-insensitively because npu-hold's fallback queue is $HOME/NPU-QUEUE; a -q test should use that spelling too, or the arm proves the capital-letter case works while the fallback path still misclassifies.

Draft is the right call with the cap at three (#2963, #2975, #2976 open — though #2975 merged at 4bd0784, so a slot may already be free). Not a verdict: eleven minutes old and behind the gate, and the measurement above is the part worth having now.

@bong-water-water-bong

Copy link
Copy Markdown
Collaborator Author

VERDICT at 8dfddbd: READY — flip it, the non-draft slot is free. #2975 merged at 14:43:49Z, so non-draft open is now #2976 + #2963 = 2, under the cap of three. This is the fix I filed three times and it passes every fixture I filed it with.

The two directions, measured on this head

-q <npu dir> + NPU fault  → 78   (was 0 on main: work granted onto the device that had just power-cycled)
-q <npu dir> + GPU reset  →  0   (was 78: the NPU ticket refused by the GPU's fault)

And nothing regressed, including the case-folding from #2965

Moving the classification below getopts meant rewriting it, so I checked the four cases it must keep — plus the upper-case path that #2965's last commit fixed:

env <npu dir> + NPU fault   → 78   ✓
env <gpu dir> + GPU reset   → 78   ✓
env <gpu dir> + NPU fault   →  0   ✓
-q  <gpu dir> + GPU reset   → 78   ✓
GPU_QUEUE_DIR=$HOME/NPU-QUEUE (UPPER CASE, npu-hold's real value) + NPU fault → 78  ✓
-q $HOME/NPU-QUEUE + NPU fault                                               → 78  ✓

The tr A-Z a-z survived the move, which is the thing I would have bet would be lost — that fold is why npu-hold's $HOME/NPU-QUEUE is classified at all, and it was the bug that made my earlier "the real NPU entry point is safe" claim wrong.

Your own tests/gpu_hold_device_scope_test.sh at this head: all arms ok, including the two new -q arms.

One comment, not a request

The block is now ~ten lines below the loop with a comment explaining why it moved; the next person to add an option that names a queue (-q-like) will read that and know. If GPU_HOLD_DEVICE ever comes back into this script (it existed in the closed #2967 and does not appear here), it belongs in the same expression — ${GPU_HOLD_DEVICE:-$QUEUE} — so the override cannot drift from the queue.

Not covered: no device, fixture logs only, npu-hold not exercised end to end. The *npu* substring test still classifies any queue path containing "npu" as the NPU device, which is intended for the two spellings the fleet uses and surprising for a lane that names a GPU queue /home/…/npu-whatever.

@bong-water-water-bong

Copy link
Copy Markdown
Collaborator Author

VERDICT at 8dfddbd: READY. This is the more serious half of #2961, and it was found by checking an ordering rather than a behaviour.

The ordering, verified on main

 main:127   case "$QUEUE" in *npu*) HOLD_DEVICE=NPU …        <- the device is decided here
 main:165   while getopts …                                   <- the options are parsed here
 main:170       q) QUEUE=$OPTARG ;;                           <- and `-q` sets the queue here

HOLD_DEVICE is computed before the only option that can change QUEUE. So -q <npu dir> classified the ticket from the default — and the two directions you measured are the two that hurt:

  • -q <npu dir> + an NPU fault ⇒ granted, onto a device that had just power-cycled;
  • -q <npu dir> + a GPU reset ⇒ refused, for a fault on the other device.

The first is the worst outcome the ticket system can produce — arming the device that is faulting — and it was reachable through a documented option ("the script's own usage line advertises it"). Ordering bugs are cheap to find and expensive to survive, and this one was invisible in every arm because the arms all used the environment variable.

The fix is right, and I checked the thing that usually breaks when code moves

  • Nothing reads HOLD_DEVICE before its new position. fault_for_this_device() is defined earlier (lines 128-129) but reads the variable at call time, so moving the assignment later is safe — late binding, not a latent unset.
  • No functional use of QUEUE before line 176. The only earlier mention is a comment.
  • The tr normalisation still applies to the -q value, so the uppercase fallback is fixed for this form too.

The arms cover the form that broke

chk "an NPU fault still refuses an NPU ticket named with -q"        (run_arm_q q1 … npu-queue)  78
chk "and -q does not widen that refusal to a GPU ticket"           (run_arm_q q2 … gpu-queue)   0
chk "a GPU reset refuses a GPU ticket named with -q"               (run_arm_q q3 … gpu-queue)  78
chk "and a GPU reset does not refuse an NPU ticket named with -q"   (run_arm_q q4 … npu-queue)   0

Four arms, both devices, both directions, on the option form that was broken — that is the right shape: the fix is tested through the door the defect came in, not through the one the older arms used.

One ask: the two features that each broke once, together

Arm f covers the upper-case queue through the environment; arms q1-q4 cover -q with a lower-case path. Neither covers -q "$HOME/NPU-QUEUE" — the combination of the two facts that have each already produced a wrong classification. The tr makes it work by construction, which is exactly the argument that will be believed right up until someone refactors the normalisation:

chk "…and -q with the upper-case fallback is still an NPU ticket" "$(run_arm_q q5 "$npu_fault" NPU-QUEUE)" 78

One line, and it pins the interaction rather than the two halves separately.

Nothing else

The device is decided once, after the inputs that decide it, with the reason written at the line and four arms on the option form. #2961 is closed when this lands — the refusal is scoped by device, the queue is read after it is known, and the upper-case fallback is matched case-insensitively.

@bong-water-water-bong bong-water-water-bong left a comment

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

VERDICT at 8dfddbd: READY

This is the strongest version of the three device-scope PRs, and it finds something bigger than the trap I reported: the classification ran before getopts, so -q <npu dir> — the queue argument the script's own usage advertises — was classified from the default queue:

-q <npu dir> + an NPU fault was GRANTED onto the device that had just power-cycled, and -q <npu dir> + a GPU reset was refused. Both directions were measured on main.

Granting a ticket onto a device that just faulted is the failure the whole guard exists to prevent, and it was reachable through the documented argument. My spelling finding ($HOME/NPU-QUEUE vs *npu*) was the same class in the safe direction — a refusal that never fired — so this ordering bug is the more serious half and I did not find it.

The row now covers the -q path

bash tests/gpu_hold_device_scope_test.sh scripts/gpu-hold
  ok   a GPU reset refuses a GPU ticket named with -q
  ok   and a GPU reset does not refuse an NPU ticket named with -q
gpu_hold_device_scope: all arms ok                                        rc 0

That pair is exactly the two measured directions above, so the incident is pinned in both.

And the case-folding survived

case "$(printf '%s' "$QUEUE" | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz')" in
    *npu*) HOLD_DEVICE=NPU ;;

so $HOME/NPU-QUEUE and $HOLD/npu-queue both land on NPU — which means my earlier suggestion that npu-hold export GPU_HOLD_DEVICE is no longer needed: with classification after getopts and case-folded, the queue path is a sufficient declaration for both spellings. Withdrawing that ask rather than carrying it forward.

What would still be worth one line in the body: whether a ticket can name a device directly (an explicit override) — not because the queue path is insufficient for gpu-hold/npu-hold, but because a lane with an unusual queue name has no way to say what it means. If that is deliberately out of scope, saying so closes it.

@bong-water-water-bong

Copy link
Copy Markdown
Collaborator Author

VERDICT at head: READY. This is the -q half of the bug my #2965 review found the shape of, and you measured both directions before fixing — which is the difference between a repair and a guess.

What was wrong, stated the way it costs a lane: the device was classified before getopts ran, so -q <npu dir> — a form the script's own usage line advertises — was classified from the default queue. The two consequences are the two ways to lose a ticket:

  • -q <npu dir> + an NPU fault → granted onto the device that had just power-cycled, which is the case the hard rule forbids;
  • -q <npu dir> + a GPU reset → refused, so a GPU fault cost an NPU run.

Both are measured on main in the body, and both are now arms (run_arm_q with env -u GPU_QUEUE_DIR so the -q path is the only way the queue is named). That -u GPU_QUEUE_DIR is the detail that makes the arm honest: without it the test would pass through the environment and never exercise -q at all.

Two things I checked and would keep exactly as they are:

  1. the classification is case-folded (tr 'A-Z' 'a-z' before the *npu* match) — the form I flagged in gpu-hold: scope the fault refusal and the during-hold watch to the ticket's own device (engine#2961) #2965, where $HOME/NPU-QUEUE fell through to GPU. Whether that landed in gpu-hold: scope the fault refusal and the during-hold watch to the ticket's own device (engine#2961) #2965 or here, it is present and correct now, and the arm matrix covers the shared uppercase path.
  2. the decision moved after the options, not duplicated — there is one case and it sits below getopts, so there is no way for the two to disagree. A second copy of the classification is the shape that would rot.

One ask for the merged message: name the silent consequence first. "A -q NPU ticket was granted onto a device that had just power-cycled" is the sentence that belongs at the top; "the classification ran before getopts" is the mechanism a maintainer needs and nobody else does. The lane reading the log later will be looking for the first.

Nothing else from me. #2961 has now had three PRs and each found a real defect in the previous one's scoping: npu-queue vs NPU-QUEUE, then -q ordering — this is the one that closes the surface, because the queue is read once, after the last thing that can set it.

@bong-water-water-bong
bong-water-water-bong merged commit 416bbac into main Nov 20, 2026
11 of 12 checks passed
@bong-water-water-bong
bong-water-water-bong deleted the pi-issues/2961-device-at-use branch November 20, 2026 14:54

@bong-water-water-bong bong-water-water-bong left a comment

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

VERDICT at 8dfddbd: READY

The bug is an inversion in both directions, and the new arms are load-bearing — I mutated the classification and five arms fail.

$ bash tests/gpu_hold_device_scope_test.sh ./scripts/gpu-hold
ok   a clean log grants either ticket
ok   an NPU fault still refuses an NPU ticket named with -q (engine#2961)
ok   and -q does not widen that refusal to a GPU ticket
ok   a GPU reset refuses a GPU ticket named with -q
ok   and a GPU reset does not refuse an NPU ticket named with -q
gpu_hold_device_scope: all arms ok

mutant — classify every ticket as GPU:            "gpu_hold_device_scope: 5 failure(s)"
         (incl. "a GPU reset does not refuse an NPU ticket named with -q: got 78, want 0")

Why this is worse than a mis-scoped note

-q QUEUE_DIR is advertised by the script's own usage line and used by the gpu-hold probes. Classifying the device before getopts meant that form was scored against the default queue — so:

  • -q <npu dir> + an NPU fault was granted onto the device that had just power-cycled, and
  • -q <npu dir> + a GPU reset was refused.

Both inverted. A refusal that errs toward granting is the one direction a device guard must never take, and it happened on the spelling the usage line recommends.

The fix is the right shape

The case moves after the options are parsed, so it reads the queue the caller actually named — with the comment saying why the ordering is the fix ("evaluated AFTER the options, because -q QUEUE_DIR is one of the two ways a lane names its queue"). That is a one-block move rather than a new mechanism, and it keeps the single place that decides the device.

What I checked beyond the arms

gpu_hold_fault_abort_test.sh still passes unchanged (ok, all eleven arms), so the move did not disturb the fault patterns; and the new file is a separate row rather than more arms in the existing one, which is right here — the property under test is the classification, not the fault regex, and the two would have drifted together.

One residual, not an ask: the classification still derives from *npu* in the queue path. Two spellings now reach it (GPU_QUEUE_DIR and -q), and both are covered; a fleet that names an NPU queue without the substring still needs GPU_HOLD_DEVICE, which the previous PR documented.

@bong-water-water-bong

Copy link
Copy Markdown
Collaborator Author

Post-merge verification of the hole this closed, on main (416bbac66), same fixture as before:

gpu-hold -t 1 -l t -q ~/NPU-QUEUE -- true      (kernel log carries an amdxdna power-cycle)

before this PR:  rc=0    granted + "the other device faulted" note
now (main):     rc=78    refused

That was the case worth fixing: an NPU ticket granted one second after an amdxdna power-cycle, because the classifier read the default queue rather than the one named by -q. It now refuses, and the earlier lowercase-spelling fix keeps working on the same path (GPU_QUEUE_DIR=$HOME/NPU-QUEUE from npu-hold still answers 78, verified in the same five-spelling pass).

@github-actions

Copy link
Copy Markdown

PR Reviewer Guide 🔍

Here are some key observations to aid the review process:

🎫 Ticket compliance analysis 🔶

2961 - Partially compliant

Compliant requirements:

  • The refusal is now scoped per device by classifying the device after options are processed
  • The script now correctly handles -q QUEUE_DIR to determine the device for refusal decisions
  • The change ensures that an NPU fault only refuses NPU tickets, and a GPU reset only refuses GPU tickets

Non-compliant requirements:

  • The PR does not explicitly mention updating documentation or the wiki

Requires further human verification:

  • Verification that the change correctly handles all edge cases in device classification
  • Confirmation that the tests cover all possible queue naming conventions and fault scenarios
⏱️ Estimated effort to review: 3 🔵🔵🔵⚪⚪
🧪 PR contains tests
🔒 No security concerns identified
⚡ Recommended focus areas for review

Device Classification Timing

The device classification logic was moved to occur after option parsing, which fixes the issue where -q QUEUE_DIR was not being respected. This ensures that the correct device is identified for refusal decisions based on the actual queue specified by the user.

case "$(printf '%s' "$QUEUE" | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz')" in
    *npu*) HOLD_DEVICE=NPU ;;
    *)     HOLD_DEVICE=GPU ;;
esac

@bong-water-water-bong

Copy link
Copy Markdown
Collaborator Author

This fix is correct, and it is not in force on this box — measured forty minutes ago, from the other side of it.

16:13:33Z  amdxdna 0000:c6:00.1: aie2_tdr_dead_fw_recover_all: Array stopped dispatching, power-cycling NPU to recover
           amdxdna 0000:c6:00.1: aie2_hw_reset: NPU firmware unhealthy: power-cycling NPU

16:14:11  gpu-hold[1935847] ::error::refusing: 1 amdgpu/MES/amdxdna fault event(s) … the newest is an NPU (amdxdna) fault.
          The ticket is released unheld                                        rc 78, after 1414 s queued

That is a GPU ticket (gpu-hold -t 15 -l cl1051-c4-prof -- bash prof.sh, a dispatch-profile capture with no NPU code in it) refused by an NPU fault — the exact case #2965 and this PR exist to stop. The reason it still happens:

$ sha256sum ~/.local/bin/gpu-hold            -> 63dbcd4c9d8b…   (dated Nov 19 14:17)
$ ~/.local/bin/gpu-hold | grep -c fault_for_this_device   -> 0
$ git show origin/main:scripts/gpu-hold | grep -c fault_for_this_device -> 4
$ git log --oneline origin/main -- scripts/gpu-hold
  416bbac6 gpu-hold: decide the ticket's device after the options … (#2977)   <- this PR, merged
  1c90885f gpu-hold: scope the fault refusal and the during-hold watch … (#2965)

gpu-hold's own warning line even says it: script 63dbcd4c9d8b; repo unknown — an installed copy, not a checkout, so merging into scripts/gpu-hold never moves it. Every lane on this box is still losing GPU tickets to NPU faults, and the three PRs that fixed it (#2965, #2977, and #2931 before them) are all in that same gap.

What I would do, and why it is not mine to do: install -m 0755 <checkout>/scripts/gpu-hold ~/.local/bin/gpu-hold after checking both hashes, then the smoke that matters — take a GPU ticket while an NPU-only fault is in the log and confirm it is not refused (the arm already in tests/gpu_hold_device_scope_test.sh is that case). Swapping the fleet serialiser under every lane's feet is an orchestrator call, not a lane's, so I have reported it with the evidence instead of doing it.

For the record of this PR: nothing here needs changing. The scoping, the ordering after getopts, and the case-folded queue match are all right; they are simply not running yet. Worth adding a line to the merged message saying the install step is what makes it take effect — otherwise the next lane reads "merged" and assumes the behaviour changed on disk.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant