Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: display current_gfxclk if available #250

Merged
merged 3 commits into from
Jan 26, 2024

Conversation

Umio-Yasuno
Copy link
Contributor

Some AMD APUs/GPUs has the Average Clock and the Current Clock, the AMDGPU driver reports the Average Clock in AMDGPU_INFO_SENSOR_GFX_SCLK and hwmon.
This PR gets the Current clock from gpu_metrics and displays it.

ref: https://gitlab.freedesktop.org/drm/amd/-/issues/2747

Screenshot_20240122_014943

@Umio-Yasuno Umio-Yasuno marked this pull request as draft January 21, 2024 17:36
@ilya-zlobintsev
Copy link
Owner

This seems similar to the previous change with the average/current power input readings. However, reading the drm repo thread, I don't think I entirely understand the behaviour: it looks like after the readings were changed to report the average clockspeed, the values became unstable, but shouldn't it be the other way around? It would make sense for the current reading to jump around, while the average should remain more or less the same. They also suggest to use pp_dpm_sclk to get the "current" readings, yet from what i understand that interface reports the target clockspeeds of power states, not the actual clockspeed.

Similar question regarding your screenshot: the current reading reports 800mhz, while the average is only 21mhz, that seems a bit weird. I would guess that the "current" value is the target clockspeed of the current power state, with the average being the actual (even if average) clockspeed.

Please tell me if i am misunderstanding how it works

@Umio-Yasuno
Copy link
Contributor Author

Umio-Yasuno commented Jan 21, 2024

They also suggest to use pp_dpm_sclk to get the "current" readings, yet from what i understand that interface reports the target clockspeeds of power states, not the actual clockspeed.

pp_dpm_sclk 1: displays the actual clockspeed (Current clock).

https://gitlab.freedesktop.org/agd5f/linux/-/blob/amd-staging-drm-next/drivers/gpu/drm/amd/pm/swsmu/smu11/sienna_cichlid_ppt.c#L1321-1343

Similar question regarding your screenshot: the current reading reports 800mhz, while the average is only 21mhz, that seems a bit weird. I would guess that the "current" value is the target clockspeed of the current power state, with the average being the actual (even if average) clockspeed.

There is less documentation for gpu_metrics, but I think the same way.

@Umio-Yasuno
Copy link
Contributor Author

Umio-Yasuno commented Jan 23, 2024

I think displaying the current target GFX clock can be helpful in in the OC setup.

ref: https://gitlab.freedesktop.org/drm/amd/-/issues/3057

@Umio-Yasuno Umio-Yasuno marked this pull request as ready for review January 23, 2024 12:50
@@ -40,6 +40,11 @@ template $GpuStatsSection: $PageSection {
value: bind template.core-clock;
}

$InfoRow {
name: "GPU Core Clock (Current):";
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it would be better to name the values:
"GPU Core Clock" -> "GPU Core Clock (Average)"
"GPU Core Clock (Current)" -> "GPU Core Clock (Target)"
This way it's more clear on what the values mean

Copy link
Contributor Author

@Umio-Yasuno Umio-Yasuno Jan 25, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok, but the Average Clock and the Current Clock are clearly separated from Navi10.
I think those values will be the same for pre-Navi10 APU/GPUs. (e.g. Renoir)

@ilya-zlobintsev ilya-zlobintsev merged commit 28c9f75 into ilya-zlobintsev:master Jan 26, 2024
@Umio-Yasuno Umio-Yasuno deleted the current_gfxclk branch January 26, 2024 08:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants