Spaces:
Running
Running
| # /// 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() |