57 lines
1.7 KiB
Python
57 lines
1.7 KiB
Python
#!/usr/bin/env python3
|
|
"""Standard-library-only host report; safe to run before installing the project."""
|
|
|
|
import argparse
|
|
import importlib.util
|
|
import json
|
|
import platform
|
|
import shutil
|
|
import subprocess
|
|
import sys
|
|
from pathlib import Path
|
|
|
|
|
|
def main():
|
|
parser = argparse.ArgumentParser(description=__doc__)
|
|
parser.add_argument("--output", type=Path)
|
|
args = parser.parse_args()
|
|
nvidia = shutil.which("nvidia-smi")
|
|
gpu = (
|
|
subprocess.run(
|
|
[nvidia, "--query-gpu=name,driver_version,memory.total", "--format=csv,noheader"],
|
|
capture_output=True,
|
|
text=True,
|
|
timeout=15,
|
|
)
|
|
if nvidia
|
|
else None
|
|
)
|
|
origins = {}
|
|
for name in ("universal_humanoid", "mjlab", "rsl_rl", "torch"):
|
|
spec = importlib.util.find_spec(name)
|
|
origins[name] = spec.origin if spec else None
|
|
report = {
|
|
"python": sys.executable,
|
|
"version": platform.python_version(),
|
|
"platform": platform.platform(),
|
|
"machine": platform.machine(),
|
|
"uv": shutil.which("uv"),
|
|
"nvidia_smi": nvidia,
|
|
"gpu_query": gpu.stdout.strip() if gpu else None,
|
|
"gpu_query_error": gpu.stderr.strip() if gpu and gpu.returncode else None,
|
|
"import_origins": origins,
|
|
"note": (
|
|
"Discovery only, not a dependency/CUDA/simulation pass. "
|
|
"Run setup-env check.py after installation."
|
|
),
|
|
}
|
|
if args.output:
|
|
args.output.parent.mkdir(parents=True, exist_ok=True)
|
|
with args.output.open("x") as stream:
|
|
json.dump(report, stream, indent=2)
|
|
print(json.dumps(report, indent=2))
|
|
|
|
|
|
if __name__ == "__main__":
|
|
main()
|