compare-moe-uvnote / cells /nvidia_dump.py
drbh's picture
drbh HF Staff
Upload folder using huggingface_hub
bad4ddc verified
raw
history blame contribute delete
577 Bytes
# /// script
# dependencies = [
# "torch",
# ]
# ///
"""Utility to dump NVIDIA GPU information."""
import subprocess
def nvidia_dump():
"""Dump NVIDIA GPU information."""
try:
result = subprocess.run(['nvidia-smi'], capture_output=True, text=True, check=True)
print("NVIDIA GPU Information:")
print(result.stdout)
except FileNotFoundError:
print("nvidia-smi not found. Are you running on a machine with NVIDIA GPUs?")
except subprocess.CalledProcessError as e:
print(f"Error running nvidia-smi: {e}")
nvidia_dump()