Python class
GPUDiagContext
GPUDiagContext
class max.diagnostics.gpu.GPUDiagContext
Context manager providing unified access to GPU diagnostic information across NVIDIA and AMD hardware.
This class automatically detects and initializes supported GPU vendor libraries (NVML for NVIDIA, ROCm SMI for AMD) and provides a unified interface for collecting diagnostic statistics from all available GPUs in the system.
from max.diagnostics.gpu import GPUDiagContext
with GPUDiagContext() as ctx:
stats = ctx.get_stats()
for gpu_id, gpu_stats in stats.items():
print(f"GPU {gpu_id}: {gpu_stats.memory.used_bytes} bytes used")
get_stats()
get_stats()
Retrieve current GPU statistics for all detected GPUs in the system.
Was this page helpful?
Thank you! We'll create more content like this.
Thank you for helping us improve!