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>
Este commit está contenido en:
@@ -1947,7 +1947,7 @@ class AMDSMICommands():
|
||||
power_info[key] = self.helpers.unit_format(self.logger,
|
||||
value,
|
||||
voltage_unit)
|
||||
elif key == "socket_power":
|
||||
elif 'power' in key:
|
||||
power_info[key] = self.helpers.unit_format(self.logger,
|
||||
value,
|
||||
power_unit)
|
||||
@@ -7492,7 +7492,13 @@ class AMDSMICommands():
|
||||
current_power = gpu_metrics['current_socket_power']
|
||||
else:
|
||||
current_power = gpu_metrics['average_socket_power']
|
||||
temperature = gpu_metrics['temperature_hotspot']
|
||||
# If the hotspot temperature is not available use the edge temp (applicable to APUs)
|
||||
if gpu_metrics['temperature_hotspot'] != "N/A":
|
||||
temperature = gpu_metrics['temperature_hotspot']
|
||||
elif gpu_metrics['temperature_edge'] != "N/A":
|
||||
temperature = gpu_metrics['temperature_edge']
|
||||
else:
|
||||
temperature = "N/A"
|
||||
else:
|
||||
mem_util = "N/A"
|
||||
gfx_util = "N/A"
|
||||
|
||||
@@ -1080,7 +1080,12 @@ class AMDSMILogger():
|
||||
|
||||
power_usage = gpu_info['power_usage']
|
||||
if power_usage != "N/A":
|
||||
power_usage = f"{gpu_info['power_usage']['current_power']}/{gpu_info['power_usage']['power_limit']} W"
|
||||
power_limit = gpu_info['power_usage']['power_limit']
|
||||
if power_limit != 0:
|
||||
power_limit = f"/{power_limit}"
|
||||
else:
|
||||
power_limit = ""
|
||||
power_usage = f"{gpu_info['power_usage']['current_power']}{power_limit} W"
|
||||
power_usage = str(power_usage).rjust(13)
|
||||
|
||||
gpu_id = str(gpu_info['gpu_id']).rjust(3)
|
||||
|
||||
Referencia en una nueva incidencia
Block a user