The idea was mentioned in the parent task by @EBernhardson: parse the output of /opt/rocm/bin/rocm-smi to get GPU's info like temperature, usage, consumption, etc..
The generic output to stdout is very cumbersome to parse:
elukey@stat1005:~$ /opt/rocm/bin/rocm-smi ======================== ROCm System Management Interface ======================== ================================================================================================ GPU Temp AvgPwr SCLK MCLK PCLK Fan Perf PwrCap SCLK OD MCLK OD GPU% 1 23.0c 7.0W 852Mhz 167Mhz 8.0GT/s, x16 14.9% auto 170.0W 0% 0% 0% ================================================================================================ ======================== End of ROCm SMI Log ========================
But there is an option (--save) to store the above content in a (temporary) json file, but for some reason it doesn't log temperature (probably something to fix). I opened a gh issue with upstream to investigate if they would accept the idea of having something like --print-json to get the json content via stdout directly.