Apu prerequisites (#1946)

* Don't require powercap support

APUs don't necessarily support setting a power cap from sysfs.
Ignore failures of the file missing.

Signed-off-by: Mario Limonciello (AMD) <superm1@kernel.org>

* Show edge temperature in default output if hotspot is missing

APUs don't have a hotspot temperature, they have an edge though.
Use that.

Signed-off-by: Mario Limonciello (AMD) <superm1@kernel.org>

* Format all "power" keys as watts

There will be more power keys when APU support is added, so format
them properly.

Signed-off-by: Mario Limonciello (AMD) <superm1@kernel.org>

* Don't show power limit in output if it's invalid

APUs can't set power limit using power_cap1 interface.  The limit
will be 0 and thus the UX looks weird in default output.
Only add the `/power_limit` if it's valid.

Signed-off-by: Mario Limonciello (AMD) <superm1@kernel.org>

* Unify sizes of `amdsmi_power_info_t`

Sizes are used inconsistently.  This causes tools to not show
N/A when they should.  Make them unified.

Signed-off-by: Mario Limonciello (AMD) <superm1@kernel.org>

---------

Signed-off-by: Mario Limonciello (AMD) <superm1@kernel.org>
This commit is contained in:
Mario Limonciello
2025-12-08 21:36:45 -06:00
committed by GitHub
parent 24ff76a880
commit a08170bc75
6 changed files with 41 additions and 23 deletions
@@ -1128,7 +1128,7 @@ int main() {
printf(" Output of amdsmi_get_power_info:\n");
if (ret != AMDSMI_STATUS_NOT_SUPPORTED) {
CHK_AMDSMI_RET(ret)
printf("\tCurrent GFX Voltage: %ld\n", power_measure.gfx_voltage);
printf("\tCurrent GFX Voltage: %" PRIu64 "\n", power_measure.gfx_voltage);
printf("\tAverage socket power: %d\n", power_measure.average_socket_power);
printf("\tGPU Power limit: %d\n\n", power_measure.power_limit);
} else {