Name card folders by GPU UUID, record serial in serial.txt

Folder identity switches from the physical serial (which neither
nvflash nor nvidia-smi exposes on the 170HX) to the auto-read GPU
UUID from nvidia-smi. The physical serial probe result (or N/A) is
saved to <folder>/serial.txt and report.json. No manual serial
prompt anymore; --serial only overrides the recorded serial.
Unidentified runs fall back to unidentified/<bdf>/. AGENTS.md
invariant and README updated to match.
This commit is contained in:
2026-10-15 00:17:13 +02:00
parent 70a6ff9b1a
commit ac53b83f70
4 changed files with 50 additions and 27 deletions
+16 -6
View File
@@ -14,6 +14,7 @@ from pathlib import Path
SCRIPT_DIR = Path(__file__).resolve().parent
HARNESS_DIR = SCRIPT_DIR / "harness"
CARDS_DIR = SCRIPT_DIR / "cards"
UNIDENTIFIED_DIR = SCRIPT_DIR / "unidentified"
REPOS = {
"170th-Street": "https://github.com/amoghmunikote/170th-Street.git",
@@ -633,12 +634,7 @@ def get_serial(nf, args):
warn("nvflash present but exposes no serial/UUID for this card")
else:
warn("nvflash unavailable - cannot auto-read serial")
serial = ""
while not serial:
serial = ask("Enter serial number from the card label (folder name)")
if not serial:
warn("serial is required for the folder name")
return serial, "manual-label"
return "N/A", "unavailable"
def save_bios(nf, out_path, args):
@@ -692,6 +688,20 @@ def nvidia_smi_info():
return {"available": True, "gpus": rows}
def get_gpu_uuid():
"""First GPU UUID from nvidia-smi (e.g. GPU-xxxx...), or None."""
if not which("nvidia-smi"):
return None
q = run(["nvidia-smi", "--query-gpu=uuid", "--format=csv,noheader"], timeout=30)
if q["rc"] != 0:
return None
for line in q["out"].splitlines():
line = line.strip()
if line.startswith("GPU-"):
return line
return None
def run_verify_unlocker():
if not VERIFY_SH.exists():
return {"ran": False, "note": "harness/cmpunlocker not cloned"}