rocm-smi: Check AMD GPUs in CI
rocm-smi reports AMD GPU status (temperature, utilization, memory, clocks) on ROCm systems, the way nvidia-smi does for NVIDIA.
On AMD runners, rocm-smi is your first check. It confirms the amdgpu driver and ROCm stack see the cards before any HIP or PyTorch-ROCm workload runs.
What it does
rocm-smi queries the AMD ROCm/amdgpu stack and prints per-GPU temperature, power, utilization, VRAM use, and clocks. Subcommands narrow the output; rocminfo gives the deeper capability dump.
Common usage
rocm-smi
# just utilization and memory
rocm-smi --showuse --showmemuse
# detailed device/agent info
rocminfoOptions
| Flag | What it does |
|---|---|
| (no args) | Summary table of all GPUs |
| --showuse | Show GPU utilization |
| --showmemuse | Show VRAM usage |
| --showtemp | Show temperatures |
| -d <id> | Restrict to a specific GPU |
| rocminfo | Full agent/capability listing |
In CI
Run rocm-smi first on AMD runners. For PyTorch-ROCm, torch.cuda.is_available() still returns True when the ROCm build works, since PyTorch maps HIP under the cuda namespace. Set HIP_VISIBLE_DEVICES (or ROCR_VISIBLE_DEVICES) to pin GPUs.
Common errors in CI
"rocm-smi: command not found" means ROCm is not installed. "ERROR: GPU[all]: No GPUs detected" or an empty table means the amdgpu kernel driver is not loaded or the container lacks device access; a container needs --device=/dev/kfd --device=/dev/dri and the right group. A kernel/ROCm version mismatch shows up as the driver not initializing.