diff --git a/driver/build.sh b/driver/build.sh index dee5623..4a59cdc 100755 --- a/driver/build.sh +++ b/driver/build.sh @@ -117,11 +117,25 @@ case "${PROFILE}" in esac info "Applying memory profile ${PROFILE} (${UNLOCK_LABEL} geometry)..." -# Patches ship the 8gb/64GB constants; rewrite in-tree for 10gb/40GB. +# Newer patches select CFG1/LMR/fb by PCI device ID at runtime (0x20C2→64GB, +# 0x2082→40GB). Older single-constant patches still need a rewrite for 10gb. python3 - "${GSP_C}" "${CFG1}" "${LMR}" "${FB_BYTES}" "${UNLOCK_LABEL}" <<'PY' import pathlib, re, sys path, cfg1, lmr, fb, label = sys.argv[1:6] text = pathlib.Path(path).read_text() + +# Dual-device path: both geometries are already baked into the patch. +if ( + "SEC2_POSTBL_TIMING_CMP_170HX_8GB_PCI_DEVICE_ID" in text + and "SEC2_POSTBL_TIMING_CMP_170HX_10GB_PCI_DEVICE_ID" in text + and "0x02779000U" in text + and "0x02669000U" in text + and "0x0000001000000000ULL" in text + and "0x0000000A00000000ULL" in text +): + print(f"runtime device-id geometry (profile metadata={label})") + raise SystemExit(0) + text2, n1 = re.subn( r"(NvU32 cfg1Value = )0x[0-9A-Fa-f]+(U;)", rf"\g<1>{cfg1}\g<2>", diff --git a/driver/patches/0001-sec2-postbl-plm-ss-cfg.patch b/driver/patches/0001-sec2-postbl-plm-ss-cfg.patch index 09e3989..05d578a 100644 --- a/driver/patches/0001-sec2-postbl-plm-ss-cfg.patch +++ b/driver/patches/0001-sec2-postbl-plm-ss-cfg.patch @@ -13,7 +13,7 @@ diff -Naur a/src/nvidia/generated/g_kernel_gsp_nvoc.h b/src/nvidia/generated/g_k diff -Naur a/src/nvidia/src/kernel/gpu/gsp/kernel_gsp.c b/src/nvidia/src/kernel/gpu/gsp/kernel_gsp.c --- a/src/nvidia/src/kernel/gpu/gsp/kernel_gsp.c 2026-07-18 11:26:26.827164897 -0700 +++ b/src/nvidia/src/kernel/gpu/gsp/kernel_gsp.c 2026-07-18 11:26:26.828254361 -0700 -@@ -102,6 +102,21 @@ +@@ -102,6 +102,23 @@ #include "crashcat/crashcat_report.h" @@ -64,7 +64,7 @@ diff -Naur a/src/nvidia/src/kernel/gpu/gsp/kernel_gsp.c b/src/nvidia/src/kernel/ { // If the new FB layout requires a scrubber ucode to scrub additional space, prepare it now NV_CHECK_OK_OR_RETURN(LEVEL_ERROR, _kgspPrepareScrubberImageIfNeeded(pGpu, pKernelGsp)); -@@ -4821,6 +4844,104 @@ +@@ -4821,6 +4844,117 @@ // Setup arguments for bootstrapping GSP NV_CHECK_OK_OR_RETURN(LEVEL_ERROR, kgspPrepareForBootstrap_HAL(pGpu, pKernelGsp, KGSP_BOOT_MODE_NORMAL)); @@ -182,7 +182,7 @@ diff -Naur a/src/nvidia/src/kernel/gpu/gsp/kernel_gsp.c b/src/nvidia/src/kernel/ // Release the API lock if relaxed locking for parallel init is enabled NvBool bRelaxedLocking = _kgspShouldRelaxGspInitLocking(pGpu); if (bRelaxedLocking) -@@ -5164,6 +5285,50 @@ +@@ -5164,6 +5285,53 @@ goto done; } diff --git a/driver/patches/0003-late-pma.patch b/driver/patches/0003-late-pma.patch index 62fd5ad..9118fee 100644 --- a/driver/patches/0003-late-pma.patch +++ b/driver/patches/0003-late-pma.patch @@ -250,7 +250,7 @@ diff -Naur a/src/nvidia/src/kernel/gpu/mem_mgr/mem_mgr.c b/src/nvidia/src/kernel /*! * @brief Retrieve the size of the client FB address space -@@ -4138,7 +4342,8 @@ +@@ -4138,7 +4342,9 @@ if (!bFifoLite && !RMCFG_FEATURE_PLATFORM_GSP && bVirtualMode && IS_SILICON(pGpu) && !pMemorySystemConfig->bDisableCompbitBacking && diff --git a/driver/patches/0005-ce-scrub-workarounds.patch b/driver/patches/0005-ce-scrub-workarounds.patch index 00f7aba..4103a83 100644 --- a/driver/patches/0005-ce-scrub-workarounds.patch +++ b/driver/patches/0005-ce-scrub-workarounds.patch @@ -1,7 +1,7 @@ diff -Naur a/src/nvidia/src/kernel/gpu/mem_mgr/arch/turing/mem_mgr_tu102.c b/src/nvidia/src/kernel/gpu/mem_mgr/arch/turing/mem_mgr_tu102.c --- a/src/nvidia/src/kernel/gpu/mem_mgr/arch/turing/mem_mgr_tu102.c 2026-07-18 11:26:26.913308290 -0700 +++ b/src/nvidia/src/kernel/gpu/mem_mgr/arch/turing/mem_mgr_tu102.c 2026-07-18 11:26:26.914385381 -0700 -@@ -570,9 +570,19 @@ +@@ -570,9 +570,20 @@ NvU32 *pteKind ) { @@ -25,7 +25,7 @@ diff -Naur a/src/nvidia/src/kernel/gpu/mem_mgr/arch/turing/mem_mgr_tu102.c b/src diff -Naur a/src/nvidia/src/kernel/gpu/mem_mgr/mem_scrub.c b/src/nvidia/src/kernel/gpu/mem_mgr/mem_scrub.c --- a/src/nvidia/src/kernel/gpu/mem_mgr/mem_scrub.c 2026-07-18 11:26:26.905387408 -0700 +++ b/src/nvidia/src/kernel/gpu/mem_mgr/mem_scrub.c 2026-07-18 11:26:26.906485666 -0700 -@@ -149,7 +149,8 @@ +@@ -149,7 +149,9 @@ NV_PRINTF(LEVEL_INFO, "Starting to init CeUtils for scrubber.\n"); NV0050_ALLOCATION_PARAMETERS ceUtilsAllocParams = {0}; diff --git a/driver/patches/0006-persistent-sw-state.patch b/driver/patches/0006-persistent-sw-state.patch index 7f6ad4f..bb6a85d 100644 --- a/driver/patches/0006-persistent-sw-state.patch +++ b/driver/patches/0006-persistent-sw-state.patch @@ -1,7 +1,7 @@ diff -Naur a/kernel-open/nvidia/nv.c b/kernel-open/nvidia/nv.c --- a/kernel-open/nvidia/nv.c 2026-07-18 11:26:26.928006389 -0700 +++ b/kernel-open/nvidia/nv.c 2026-07-18 11:26:26.930357872 -0700 -@@ -1521,6 +1521,11 @@ +@@ -1521,6 +1521,15 @@ goto failed_release_irq; } diff --git a/install.sh b/install.sh index 5de29c1..b7e4b22 100755 --- a/install.sh +++ b/install.sh @@ -112,8 +112,8 @@ PCI="$(echo "${PCI_LINE}" | awk '{print $1}')" PCI_FULL="0000:${PCI}" DEVID="$(echo "${PCI_LINE}" | grep -oE '10de:[0-9a-fA-F]{4}' | head -1 | cut -d: -f2 | tr '[:upper:]' '[:lower:]')" ok "GPU detected: ${PCI_FULL} (10de:${DEVID})" -if [[ "${DEVID}" != "20c2" ]]; then - warn "In-driver unlock path is gated on PCI ID 0x20C2." +if [[ "${DEVID}" != "20c2" && "${DEVID}" != "2082" ]]; then + warn "In-driver unlock path is gated on PCI ID 0x20C2 / 0x2082." warn "This card reports 0x${DEVID}; install will continue, but unlock may not activate." fi