From 9db67b84d7897033fd12cb0a95365dbd0ea6cbc7 Mon Sep 17 00:00:00 2001 From: Quentin BUISSON-DEBON Date: Thu, 15 Oct 2026 01:22:26 +0200 Subject: [PATCH] Vulkan only on unlocked cards; unlock prompt defaults to Y The 5-min VRAM stress is skipped unless verify.sh reports unlocked-ok (--vulkan always still forces it) - no point testing the locked stock chip. The unlock install prompt now defaults to Y (Enter confirms) since each run exists to unlock; --unlock stays for non-interactive runs. README updated to match. --- README.md | 10 +++++----- check_cards.py | 13 ++++++++++--- 2 files changed, 15 insertions(+), 8 deletions(-) diff --git a/README.md b/README.md index e94a061..34842fc 100755 --- a/README.md +++ b/README.md @@ -90,9 +90,9 @@ Flow of a normal run: 5. Link retrain test + full bus rescan test (device must survive both) 6. Kernel log scrape (`dmesg`/`journalctl`) for this BDF: Xid / AER / NVRM lines 7. `nvidia-smi` snapshot + `harness/cmpunlocker/verify.sh` (read-only) -8. **Opt-in unlock**: `cmpunlocker unlock (install)` — skipped with a note when memory is already unlocked, otherwise asks `Run cmpunlocker install.sh now? (y/N)` (default **n**; `--unlock` runs it without asking). On yes: `git pull --ff-only` on the harness clone, then `install.sh` runs from `harness/cmpunlocker/` with **live terminal output** (full log → `cards//install_unlocker.log`; the kernel-module build takes 5–15 min) +8. **Opt-in unlock**: `cmpunlocker unlock (install)` — skipped with a note when memory is already unlocked, otherwise asks `Run cmpunlocker install.sh now? (Y/n)` (default **Y**; `--unlock` runs it without asking, e.g. non-interactive). On yes: `git pull --ff-only` on the harness clone, then `install.sh` runs from `harness/cmpunlocker/` with **live terminal output** (full log → `cards//install_unlocker.log`; the kernel-module build takes 5–15 min) 9. **After a successful install**: the VRAM stress is skipped — **cold reboot the host** (`sudo shutdown -h now`, then power it back on) and **re-run the same command** for the final PCIe check, which must report **Gen2 x16** -10. **Last step, optional**: `Run 5-min Vulkan VRAM stress test now? (y/N)` — refused by default, `--vulkan always|never` to override +10. **Last step, optional**: `Run 5-min Vulkan VRAM stress test now? (y/N)` — offered only when `verify.sh` reports `unlocked-ok` (skipped on stock memory, no point testing the locked chip; `--vulkan always` forces it anyway, `--vulkan never` disables it) 11. Result printed + `report.json` written into the card's folder Remove the card, plug the next one, repeat — no queue, no indices, folders just pile up in `cards/`. @@ -133,8 +133,8 @@ cards/ | `--demo` | run the whole pipeline against fake hardware (self-test) | | `--nvflash PATH` | explicit nvflash binary | | `--serial XYZ` | override physical serial recorded in `serial.txt` (folder stays UUID-named) | -| `--vulkan ask\|always\|never` | VRAM test policy (default: ask, last step) | -| `--unlock` | run the cmpunlocker `install.sh` step without prompting (default: ask y/N) | +| `--vulkan ask\|always\|never` | VRAM test policy (default: ask, last step, unlocked cards only; `always` forces even on stock memory) | +| `--unlock` | run the cmpunlocker `install.sh` step without prompting (default: ask Y/n) | | `--skip-bios` | skip VBIOS backup | | `--bios-unload` | unload NVIDIA driver to retry `nvflash --save` without prompting (console may freeze briefly, driver is reloaded after) | | `--no-install` | never install packages (skips the sudo precondition) | @@ -144,6 +144,6 @@ cards/ This tool **reads** card state by default. Two steps can change host state, both **opt-in**: -- **Unlock install (opt-in, explicit confirmation)** — runs only if you answer `y` to `Run cmpunlocker install.sh now? (y/N)` (default `n`) or pass `--unlock`. It executes `install.sh` **from the harness clone** (`harness/cmpunlocker/`, refreshed first with `git pull --ff-only`, no extra installer flags), needs root (sudo credentials are cached first), streams its output live, and saves the full log to `cards//install_unlocker.log`. It is skipped entirely when memory is already unlocked, when the harness is not cloned, and in `--demo` mode. A successful install replaces kernel modules — the step then skips VRAM stress and asks you to cold reboot and re-run. +- **Unlock install (opt-in, explicit confirmation)** — runs when you answer `y` to `Run cmpunlocker install.sh now? (Y/n)` (default `Y`, so Enter confirms) or pass `--unlock`. It executes `install.sh` **from the harness clone** (`harness/cmpunlocker/`, refreshed first with `git pull --ff-only`, no extra installer flags), needs root (sudo credentials are cached first), streams its output live, and saves the full log to `cards//install_unlocker.log`. It is skipped entirely when memory is already unlocked, when the harness is not cloned, and in `--demo` mode. A successful install replaces kernel modules — the step then skips VRAM stress and asks you to cold reboot and re-run. - **VBIOS unload-retry (opt-in, explicit confirmation)** — offered only after both backup methods fail with the driver loaded: unloads the NVIDIA modules, retries `nvflash --save`, then reloads the modules (local console may freeze briefly). Triggered by `y` or `--bios-unload`; skipped in `--demo` mode. - **Everything else remains read-only**: `verify.sh` runs without installing anything, no modules are patched and no firmware is flashed (nvflash is only ever used with `--save`). The only other writes are local files (reports, logs), PCI link retrain/rescan sysfs triggers, and package installation during `--preflight` (explicitly gated behind the sudo precondition). diff --git a/check_cards.py b/check_cards.py index 741af23..694788d 100755 --- a/check_cards.py +++ b/check_cards.py @@ -7,7 +7,7 @@ Per run: wait for card -> auto UUID (folder) + serial probe -> VBIOS backup -> cmpunlocker verify.sh (read-only) -> opt-in cmpunlocker unlock (install.sh, y/N or --unlock; a successful install skips VRAM stress and asks for a cold reboot, then you re-run this script for the final Gen2 x16 PCIe check) --> optional 5-min Vulkan VRAM stress (last step, ask yes/no) +-> optional 5-min Vulkan VRAM stress (last step, unlocked cards only) -> cards//report.json (+ serial.txt with the physical serial or N/A). Scoring: FAIL on no-device/link-down/lost-after-rescan, and on a final @@ -194,7 +194,7 @@ def process_card(args): rep["unlock"] = {"attempted": False, "ok": False, "note": "harness/cmpunlocker not cloned - run --preflight"} warn("harness/cmpunlocker not cloned - run --preflight (unlock install skipped)") - elif args.unlock or ask("Run cmpunlocker install.sh now? (y/N)", "n").lower().startswith("y"): + elif args.unlock or ask("Run cmpunlocker install.sh now? (Y/n)", "y").lower().startswith("y"): X.update_cmpunlocker() rep["unlock"] = X.run_installer(folder / "install_unlocker.log") unlock_installed = bool(rep["unlock"].get("attempted") and rep["unlock"].get("ok")) @@ -210,8 +210,15 @@ def process_card(args): info("unlock install skipped") step("optional Vulkan VRAM test (last step)") + ver_status = rep["cmpunlocker_verify"].get("status") if unlock_installed: info("vulkan test skipped - unlock installed, cold reboot first") + elif ver_status != "unlocked-ok" and args.vulkan != "always": + # No point stressing stock memory - the test is meaningful only on + # the full unlocked capacity. --vulkan always forces it anyway. + rep["vulkan_test"] = {"requested": False, "ran": False, + "note": f"skipped - memory not unlocked (verify: {ver_status})"} + info(f"vulkan test skipped - card not unlocked (verify: {ver_status})") elif args.vulkan == "never": rep["vulkan_test"] = {"requested": False, "ran": False, "note": "disabled via --vulkan never"} elif args.vulkan == "always": @@ -310,7 +317,7 @@ def main(): ap.add_argument("--vulkan", choices=("ask", "always", "never"), default="ask", help="5-min Vulkan VRAM test policy (default ask, runs as last step)") ap.add_argument("--unlock", action="store_true", - help="run cmpunlocker install.sh without prompting (default: ask y/N)") + help="run cmpunlocker install.sh without prompting (default: ask Y/n)") ap.add_argument("--no-install", action="store_true", help="do not auto-install packages (skips the sudo precondition)") ap.add_argument("--no-clone", action="store_true", help="do not clone harness repos")