Repository navigation
fix: fall back to hwmon junction temperature on SMU13.0.6 - #513
Merged
Merged
Conversation
jason34105533
force-pushed
the
SMU13.0.6-family
branch
from
September 19, 2026 05:55
3768be5 to
300bc30
Compare
SMU13.0.6 only implements AMDGPU_PP_SENSOR_HOTSPOT_TEMP and AMDGPU_PP_SENSOR_MEM_TEMP temperature queries. It doesn't provide AMDGPU_PP_SENSOR_GPU_TEMP or AMDGPU_PP_SENSOR_EDGE_TEMP ioctl. So, originally nvtop would return N/A on GPU temp. rocm-smi reports the hwmon junction temperature, so use it as the fallback when the existing GPU_TEMP ioctl is unavailable. When the GPU_TEMP ioctl fails, look for hwmon edge first, then junction. This selects temp2_input on MI300A while preserving the usual edge reading elsewhere. Retain temp1_input as a fallback for older hwmon devices without sensor labels.
jason34105533
force-pushed
the
SMU13.0.6-family
branch
from
September 19, 2026 06:02
300bc30 to
337578b
Compare
# Conflicts: # src/extract_gpuinfo_amdgpu.c
Read the hwmon GPU temperature from an open FILE* that is rewound and re-read on every refresh instead of calling nvtop_device_get_sysattr_value(). sd_device_get_sysattr_value() caches sysattr values inside the sd_device object for its lifetime (this is why the Intel driver builds throwaway "noncached" devices for its dynamic readings), so going through the long-lived hwmonDevice returned the first sample on every subsequent refresh and the reported GPU temperature froze after the first poll. An open fd is not affected by that cache. The sensor is still resolved once during init (prefer "edge", then "junction", then the unlabeled temp1_input), so the per-refresh label scan is removed as well. This matches how the fan speed and power cap files are already handled.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
MI300A(SMU13.0.6) only implements AMDGPU_PP_SENSOR_HOTSPOT_TEMP and AMDGPU_PP_SENSOR_MEM_TEMP temperature queries. It doesn't provide AMDGPU_PP_SENSOR_GPU_TEMP orAMDGPU_PP_SENSOR_EDGE_TEMP ioctl. So, originally nvtop would return N/A on GPU temp.
Change
When the existing GPU_TEMP ioctl is unavailable, this change reads hwmon sensors in this order: edge, then junction, then the legacy unlabeled temp1_input fallback. On MI300A this uses temp2_input (junction), consistent with rocm-smi.
Not really confirmed that whether this issue is only on APU or also occurs on other SMU13.0.6 device, I think the later is more likely.
Validation