Implementation of AMD GPU Monitoring Support via ROCm/amdgpu-smi
Currently, prmon provides excellent support for NVIDIA GPU monitoring through the nvidiamon component, utilizing both the NVIDIA Management Library (NVML) and nvidia-smi as a fallback. However, as High Energy Physics (HEP) computing sites increasingly adopt AMD hardware (such as the AMD Instinct™ MI series accelerators), there is a growing need to monitor AMD GPU resource consumption alongside CPU and memory metrics.
I propose the addition of a new monitoring component (e.g., amdgpu-mon or extending the existing monitoring logic) to support AMD GPUs.
Proposed Implementation Details:
Primary Monitoring Path (ROCm SMI Library): Similar to how nvidiamon uses libnvidia-ml.so, the AMD implementation should preferentially use the ROCm SMI (System Management Interface) library (librocm_smi64.so).
This would allow for low-overhead, direct access to metrics like GPU utilization, VRAM usage (FB memory), and power consumption. Symbols should be loaded dynamically via dlopen at runtime to ensure prmon remains portable and doesn't require AMD drivers installed at build time. Fallback Monitoring Path (rocm-smi / amdgpu-smi): If the library is not available, prmon should fall back to parsing the output of the CLI tools provided by the AMD stack.
Metrics to Track (Parity with NVIDIA): To maintain consistency in the output files (prmon.txt and prmon.json), we should aim to collect:
gpufbmem: Current GPU VRAM usage. gpusmpct: GPU compute unit utilization percentage. gpumempct: GPU memory controller utilization percentage. gpupower: Current power draw (if supported by the hardware). Hardware Information: The get_hardware_info method should be updated to capture AMD-specific details like the device name (e.g., "AMD Instinct MI210") and the number of available cards.
Context: As many WLCG/HSF sites are transitioning towards heterogeneous computing environments, having a unified tool that can monitor both NVIDIA and AMD accelerators is critical for accurate cost and performance evaluation of HEP workflows.
Additional Considerations:
Should we consider renaming nvidiamon to a more generic gpumon and use a plugin architecture for different vendors? How should we handle multi-GPU environments where cards from different vendors might (theoretically) exist?
Hello @arch-yunus
My apologies for the long delay in replying - I haven't really had much bandwidth for this project in the last few months.
My question is, are you still interested in working on this? I would certainly be a useful addition to what prmon can cover.
Best regards
Graeme
@amete @graeme-a-stewart i am looking to work on this issue please assign me this issue
@coder-Yash886 - it's very hard to figure out any genuine motivation here from you to work on prmon.
@graeme-a-stewart Hi Sir, I appreciate your honest feedback, and I’d like to clarify my intentions. I’m genuinely interested in contributing to PRMon and understanding the project in depth. I’m also exploring opportunities for GSoC 2027, which is one of the reasons I’m actively looking to get involved in open-source projects.
However, I don’t want my involvement in PRMon to be seen as just a means to participate in GSoC. My goal is to learn the codebase, understand the project's real needs, and make useful contributions that genuinely benefit the project. I understand that trust is built through consistent work, and I’m willing to put in the effort to demonstrate my interest through my contributions.
I’d appreciate the opportunity to learn from the maintainers and contribute meaningfully to PRMon.
Well, we don't have any intention of having a prmon GSoC project in 2027. And asking to be assigned an issue such as https://github.com/HSF/prmon/issues/316 indicates not much reading or understanding of the project from your side.
5. Well, we don't have any intention of having a prmon GSoC project in 2027. And asking to be assigned an issue such as #316 indicates not much reading or understanding of the project from your side.
Hi @graeme-a-stewart,
Yes, absolutely. I am still interested and would be happy to take this forward.
As outlined in the proposal, my plan is to approach this by:
Dynamically loading librocm_smi64.so at runtime via dlopen (mirroring nvidiamon / NVML) to avoid build-time hard dependencies on the ROCm stack.
Mapping the core metrics (gpufbmem, gpusmpct, gpumempct, gpupower) to match the existing output structure (prmon.txt / prmon.json).
Adding a fallback path via CLI parsing if the library isn't directly loadable.
Before opening the PR, do you have any strong preference on whether we keep this as a standalone amdgmon (similar to nvidiamon) or start modularizing both under a unified gpumon interface? Keeping it standalone might be simpler and less disruptive to existing workflows for the first iteration.
Best,
Yunus