Spaces:
Running
Running
File size: 577 Bytes
bad4ddc |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 |
# /// 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() |