mirror of
https://github.com/QuixiAI/nvdriver.git
synced 2026-12-06 06:28:39 +00:00
* gv100/hbm: survey only the FBPAs the FBIO floorsweep fuse leaves enabled
survey_gv100_hbm() demanded all 16 FBPA PLLs readable, locked and equal.
A CMP 100-210 (10de:1df4, 12 GB, three HBM2 stacks) has FBPA 0..=3 fused
off: their PLL cfg/coeff registers answer 0xbadf2010 (PRI bus error)
while FBPA 4..=15 read cfg 0x29, coeff 0x14102 (877.5 MHz). The survey
refused the card (CfgUnreadable at FBPA 0), so the HBM2 session never got
a baseline and v100_hbm_ndiv was a no-op. program_coeff() made the same
assumption twice more: its post-write probe read FBPA 0, and its lock
wait polled all 16.
1. Survey mask. 580.178.04 does not probe for bus errors; it computes the
enabled-FBPA mask from the fuse. _nv030402rm (GV100 GPU HAL slot
+0x3a0) [D]:
n = RD32(0x2243c) NV_PTOP_SCAL_NUM_FBPAS
fuse = OBJFUSE+0x118(0xff000033) _nv029006rm
-> OBJFUSE+0x110 _nv028950rm: fuse word 0xc14, shift 0,
mask 0xffff, i.e. BAR0 0x21c14
mask = zext64(~fuse); if n <= 64: mask &= ~0 >> (64 - n); n == 0: 0
A stock mmiotrace of a Tesla V100 shows that pair once, 0x2243c = 0x10
then 0x21c14 = 0 [O] (reports/original-mmiotrace-b3-first/b3-bar0.txt),
which gives 0xffff. On the #399 card the reporter read 0x2243c = 0x10
and 0x21c14 = 0xf [O], which gives 0xfff0 and matches the partitions
that answer.
2. Post-write probe on the first enabled FBPA instead of FBPA 0.
3. Lock wait polls only the enabled FBPAs.
Stock never retunes the HBM2 PLL, so 2 and 3 have no stock evidence;
they follow from 1. On silicon [O]: the reporter ran 23db150 with the
equivalent change (presence taken from the bus-error word rather than
the fuse) on the #399 card and got a verified 877.5 -> 1107 MHz unlock
(NDIV 65 -> 82) on FBPA 4..=15, D2D 618 -> 781 GB/s, then adaptive
backoff on real ECC DBE/SBE and a clean return to NDIV 65
(https://github.com/QuixiAI/nvdriver/issues/399#issuecomment-7386631509).
This exact commit has not run on silicon.
fbio_enabled_mask() is the stock arithmetic and gv100_enabled_fbpa_mask()
the two reads, in stock order. An enabled partition must still be
readable, locked and in agreement (the reference coefficient is the first
enabled partition's), so a card whose fuse says 16 but whose FBPA 0 does
not answer is refused as before. The mask is resolved before the
multicast write; if 0x2243c is unreadable, 0 or above 16, or the fuse is
unreadable or enables nothing, the survey reports the new fault kinds
FbpaCountUnusable (6) / FbioFuseUnusable (7) and nothing is written. A
mask lost between the survey and the write is a refusal before the target
write, like the PMC_BOOT_0 canary: logged as SurveyFailed, not RolledBack.
gpu_owner.c logs kinds 6 and 7, and the CoeffMismatch text now says "the
first enabled FBPA" instead of "FBPA 0". A 16-partition card does two
more BAR0 reads per survey and per program_coeff and otherwise behaves as
before. The ECC poll and the backoff logic are unchanged.
Tests: fbio_enabled_mask_matches_nv030402rm_arithmetic,
gv100_hbm_survey_and_unlock_skip_fused_off_fbpas (mock with FBPA 0..=3
reading 0xbadf2010, fuse 0xf: survey, unlock 65 -> 82, backoff step,
restore; refusals with zero writes for unusable mask inputs), and
gv100_hbm_mask_lost_before_the_target_write_is_not_a_rollback. Without
the change the first survey assertion fails; reverting only the probe or
only the lock wait makes the unlock fail.
Refs #399
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
* gv100/hbm: fall back to cached floorsweep mask on rollback/restore and log teardown failure
Addresses CodeRabbit review finding on PR #583:
- Cache the static silicon enabled-FBPA mask resolved during baseline survey
(HbmSession::enabled_fbpa_mask and inside unlock/set rollback paths).
- If re-reading PTOP_SCAL_NUM_FBPAS (0x2243c) or FUSE_OPT_FBIO (0x21c14)
glitches during a rollback or teardown restore, fall back to the cached
mask so the baseline HBM2 coefficient write is not blocked while PMC_BOOT_0
canary remains strictly enforced.
- Log failed HBM2 teardown restores in pmu_bringup.rs via log_hbm_outcome
instead of discarding the result.
- Add unit test covering fuse-glitch teardown restore and canary refusal.
* gv100/hbm: use cached floorsweep mask for downward safety steps (ECC backoff / baseline return)
Addresses follow-up CodeRabbit finding on PR #583:
- In HbmSession::step_to, downward safety steps (target <= current clock:
live ECC backoff via on_instability and sysfs return to baseline) fall
back to the cached static silicon enabled-FBPA mask on a transient read
failure of 0x2243c/0x21c14 so an elevated clock is never stranded while
the GPU remains in service.
- Upward overclock steps continue to require a fresh fuse read and refuse
before writing when unreadable.
- Extend unit test to cover on_instability and on_user_write(0) under a
fuse-read glitch.
* gv100/hbm: skip rollback write on pre-write mask refusal
Addresses CodeRabbit trivial finding on PR #583:
- When program_coeff refuses before the target write due to an unreadable
FBPA count (FbpaCountUnusable) or FBIO fuse (FbioFuseUnusable), skip the
unnecessary rollback multicast write so the PLL stays completely untouched
(writes == 0) and a clean refusal can never degrade into FailedUnverified.
- Preserve existing pre-write canary refusal behavior unchanged.
---------
Co-authored-by: Scottcjn <121303252+Scottcjn@users.noreply.github.com>
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
Co-authored-by: morebrackets <19673572+morebrackets@users.noreply.github.com>