mirror of
https://github.com/QuixiAI/nvdriver.git
synced 2026-12-06 14:38:47 +00:00
- Updated tools/post_reboot.sh to check kernel oops taint bit and stuck driver tasks instead of <86400s uptime - Level 7 hardware regression passed on 0000:b3:00.0 (module 37e6fa430835eee2b426019db3ad70eeb7a9e9070c09c84bd9b973cf56cbe529, 107 inventory words, 0 static mismatches, CUDA baseline verified before and after) - Updated .gitignore to exclude build archives (*.a, *.rlib), __pycache__, and raw trace dumps
50 lines
1.9 KiB
Python
50 lines
1.9 KiB
Python
#!/usr/bin/env python3
|
|
"""Resolve matching580 conftest build roles; never inspect host virtualization."""
|
|
import argparse
|
|
import json
|
|
import os
|
|
from pathlib import Path
|
|
|
|
ROLES = (
|
|
("VGX_BUILD", "NV_DOM0_KERNEL_PRESENT", "nv_rs_vgx_dom0"),
|
|
("VGX_KVM_BUILD", "NV_VGPU_KVM_BUILD", "nv_rs_vgx_kvm"),
|
|
("VGX_DEVICE_VM_BUILD", "NV_DEVICE_VM_BUILD", "nv_rs_vgx_device_vm"),
|
|
)
|
|
|
|
|
|
def resolve(environment):
|
|
# conftest.sh uses [ -n "$NAME" ]; '0' and whitespace therefore enable it.
|
|
return {define: bool(environment.get(name, "")) for name, define, _ in ROLES}
|
|
|
|
|
|
def main():
|
|
parser = argparse.ArgumentParser(description=__doc__)
|
|
parser.add_argument("--receipt", type=Path)
|
|
parser.add_argument("--json", action="store_true")
|
|
args = parser.parse_args()
|
|
roles = resolve(os.environ)
|
|
receipt = {"schema": 1, "source": "matching580 nonempty build-product environment",
|
|
"roles": roles, "is_vgx_hyper": any(roles.values())}
|
|
content = json.dumps(receipt, indent=2, sort_keys=True) + "\n"
|
|
if args.receipt:
|
|
args.receipt.parent.mkdir(parents=True, exist_ok=True)
|
|
if not args.receipt.exists() or args.receipt.read_text() != content:
|
|
# A same-filesystem atomic replacement; parallel equal-config Make
|
|
# invocations cannot leave a partially written dependency receipt.
|
|
import tempfile
|
|
with tempfile.NamedTemporaryFile(mode="w", dir=args.receipt.parent,
|
|
delete=False) as temporary:
|
|
temporary.write(content)
|
|
temporary_path = Path(temporary.name)
|
|
temporary_path.replace(args.receipt)
|
|
if args.json:
|
|
print(content, end="")
|
|
else:
|
|
flags = ["--cfg=nv_rs_build_product_resolved"]
|
|
flags += ["--cfg=" + cfg for _, define, cfg in ROLES if roles[define]]
|
|
print(" ".join(flags))
|
|
|
|
|
|
if __name__ == "__main__":
|
|
main()
|