mirror of
https://github.com/QuixiAI/nvdriver.git
synced 2026-12-06 06:28:39 +00:00
Fixes two GV100 multi-GPU bugs observed on 8x Tesla V100-SXM2-32GB:
1. PCE8 (NV_PFAULT_MMU_ENG_ID_CE8 = 0x17) UNBOUND_INST_BLOCK on CE3 VRAM scrub:
pmu_bringup.rs previously programmed the PCIe-only PCE2LCE map (Table[0],
leaving PCE8 = 0xf) before PFIFO/CE bringup, and set_nvlink_ready_and_train()
later reprogrammed PCE2LCE to Table[4] (bonding PCE8 onto LCE3) while
SCRUB_CHID=0xffe was already bound on SCRUB_RUNLIST=7 (LCE3). That left PCE8
without a bound instance block so the first NV01_MEMORY_LOCAL_USER (0x40)
scrub_ce_memset_zero() faulted on SCRUB_SEM_VA (0x1_0000_2000) with
UNBOUND_INST_BLOCK and timed out TSG_PREEMPT (NOTE_SCRUB_CE 0xdead_0002).
- Program Table[4] upfront in pmu_bringup.rs on NVLink-capable SXM2 GPUs
(keeping Table[0] when NVLink is fused off).
- Track the programmed hardware PCE2LCE map as a packed u64 key per
LiveEngine (ce_pce2lce_key) so set_nvlink_ready_and_train() skips
redundant rewrites when the topology matches, and cleanly stops/resets/
re-initializes scrub_ce if a topology change is required.
2. Clean module unload after a non-replayable CE MMU fault:
deactivate() did not reset wedged CE engines or call clear_pfifo_pbdma_intrs()
when a non-replayable HUB MMU fault (0x100e60) or stuck TSG preempt (0x2634)
was latched, causing PMU unbind (_nv052303rm) to time out, ACR WPR unlock to
fail (0xdead_0007), and BAR0 to be leaked (-EBUSY on next insmod).
- Reset CE0..CE8 via NV_PMC_ENABLE (0x200) when 0x100e60 VALID or 0x2634
PENDING is set, and call clear_pfifo_pbdma_intrs() during deactivate().
Verified on 8x Tesla V100-SXM2-32GB: check_kernel_module.py passes (0 GOT
relocations, largest_stack 1000), hot-reload unloads/reloads cleanly without
reboot, and all 8 GPUs pass cuDevicePrimaryCtxRetain (73-155 ms) and PyTorch
2.17+cu135 FP32/FP16/BF16 GEMM, cuDNN, Triton, CUDA Graphs, SDPA, and P2P.