Skip to content

Commit 3cdaf4d

Browse files
josnarloJeniferC99
authored andcommitted
[SWDEV-555807] TestCudaMallocAsync test power draw failing (#755)
* Clarified comments regarding power limit retrieval and its support on virtualized systems. * Change unsupported comment to UINT32_MAX --------- Signed-off-by: josnarlo <[email protected]> Signed-off-by: Arif, Maisam <[email protected]>
1 parent abd2ea4 commit 3cdaf4d

File tree

2 files changed

+9
-3
lines changed

2 files changed

+9
-3
lines changed

include/amd_smi/amdsmi.h

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1085,6 +1085,8 @@ typedef struct {
10851085
/**
10861086
* @brief Power Information
10871087
*
1088+
* Unsupported struct members are set to UINT32_MAX
1089+
*
10881090
* @cond @tag{gpu_bm_linux} @endcond
10891091
*/
10901092
typedef struct {
@@ -6259,9 +6261,10 @@ amdsmi_get_gpu_activity(amdsmi_processor_handle processor_handle, amdsmi_engine_
62596261
*
62606262
* @ingroup tagGPUMonitor
62616263
*
6262-
* @platform{gpu_bm_linux} @platform{host} @platform{guest_windows}
6264+
* @platform{gpu_bm_linux} @platform{host} @platform{guest_windows} @platform{guest_1vf}
62636265
*
62646266
* @note amdsmi_power_info_t::socket_power metric can rarely spike above the socket power limit in some cases
6267+
* @note unsupported struct members are set to UINT32_MAX
62656268
*
62666269
* @param[in] processor_handle PF of a processor for which to query
62676270
*

src/amd_smi/amd_smi.cc

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4470,11 +4470,14 @@ amdsmi_get_power_info(amdsmi_processor_handle processor_handle, amdsmi_power_inf
44704470
}
44714471

44724472
int power_limit = 0;
4473-
status = smi_amdgpu_get_power_cap(gpu_device, &power_limit);
4474-
if (status == AMDSMI_STATUS_SUCCESS) {
4473+
amdsmi_status_t status2 = smi_amdgpu_get_power_cap(gpu_device, &power_limit);
4474+
if (status2 == AMDSMI_STATUS_SUCCESS) {
44754475
info->power_limit = power_limit;
44764476
}
44774477

4478+
// Returning status from amdsmi_get_gpu_metrics_info() which should return SUCCESS
4479+
// Getting power cap values may not be supported on all virtualized systems and should
4480+
// not return a failure when the metrics values are ascertainable.
44784481
return status;
44794482
}
44804483

0 commit comments

Comments
 (0)