--- a/common/constants.yaml 2026-11-27 16:07:08.138776338 +0300 +++ b/common/constants.yaml 2026-11-27 16:07:08.140157869 +0300 @@ -142,3 +142,7 @@ ecc-reporting: patch: ecc-reporting.patch registers: {} + + fb-geometry-80g: + patch: fb-geometry-80g.patch + registers: {} --- a/driver/build.sh 2026-11-27 16:07:08.139501893 +0300 +++ b/driver/build.sh 2026-11-27 16:07:08.149135388 +0300 @@ -60,6 +60,7 @@ ecc-enable.patch ecc-fbpa-static.patch ecc-reporting.patch + fb-geometry-80g.patch ) PATCH_FILES=() for name in "${PATCH_ORDER[@]}"; do @@ -117,6 +118,14 @@ patch -p1 < "${PATCH_FILES[$i]}" done ok "All patches applied" + # local (G292-Z20, two cards behind each PCIe switch): the CMP BAR1 unlock in the driver must not touch the card at all. + # If the driver resizes BAR1 itself, the switch bridge window fits only one 64G BAR1 and the second card of the pair is lost. + # If only the register writes are kept without the resize, the card believes BAR1 is 64G while the kernel has 64M mapped, + # and the first UVM channel hangs. We size BAR1 ourselves before the driver loads (cmp-bar1-boot). + grep -q 'if (pci_dev->device != 0x20C2 && pci_dev->device != 0x2082)' kernel-open/nvidia/nv-pci.c || die "local BAR1 tweak: marker not found" + sed -i 's/if (pci_dev->device != 0x20C2 \&\& pci_dev->device != 0x2082)/if (1) \/* local: CMP BAR1 unlock off *\//' kernel-open/nvidia/nv-pci.c + grep -q 'local: CMP BAR1 unlock off' kernel-open/nvidia/nv-pci.c || die "local BAR1 tweak: not applied" + ok "local: BAR1 unlock disabled" GSP_C="${SRC_DIR}/src/nvidia/src/kernel/gpu/gsp/kernel_gsp.c" [[ -f "${GSP_C}" ]] || die "Missing ${GSP_C} after patching" @@ -197,7 +206,13 @@ CC_CMD="ccache gcc" info "ccache detected — compiler output will be cached for faster rebuilds" fi -make -j"${JOBS}" modules SYSSRC="${KSRC}" CC="${CC_CMD}" +# local fix (Debian): headers are split into -common (source) and -amd64 (build) +if [[ -d "/lib/modules/${KVER}/source" ]]; then + SYS_ARGS=(SYSSRC="/lib/modules/${KVER}/source" SYSOUT="${KSRC}") +else + SYS_ARGS=(SYSSRC="${KSRC}") +fi +make -j"${JOBS}" modules "${SYS_ARGS[@]}" CC="${CC_CMD}" ok "Modules built" if command -v ccache &>/dev/null; then ccache -s 2>/dev/null | sed 's/^/ /' || true