Merge commit 'def9a3c92d304b1debc20ba3ea0c40524a1b7420' into develop

This commit is contained in:
systems-assistant[bot]
2025-08-07 18:02:25 +00:00
4 changed files with 67 additions and 46 deletions
+1 -1
View File
@@ -44,7 +44,7 @@ pkg_check_modules(DRM REQUIRED libdrm)
## Setup the package version based on git tags.
set(PKG_VERSION_GIT_TAG_PREFIX "rsmi_pkg_ver")
get_package_version_number("7.6.0" ${PKG_VERSION_GIT_TAG_PREFIX} GIT)
get_package_version_number("7.8.0" ${PKG_VERSION_GIT_TAG_PREFIX} GIT)
message("Package version: ${PKG_VERSION_STR}")
set(${ROCM_SMI_LIBS_TARGET}_VERSION_MAJOR "${CPACK_PACKAGE_VERSION_MAJOR}")
set(${ROCM_SMI_LIBS_TARGET}_VERSION_MINOR "${CPACK_PACKAGE_VERSION_MINOR}")
@@ -2976,7 +2976,9 @@ rsmi_status_t rsmi_dev_gpu_reset(uint32_t dv_ind);
* If this parameter is nullptr, this function will return
* ::RSMI_STATUS_INVALID_ARGS if the function is supported with the provided,
* arguments and ::RSMI_STATUS_NOT_SUPPORTED if it is not supported with the
* provided arguments.
* provided arguments. In the event where there are some values are missing from
* or not available on the device, the respective values will be set to
* UINT64_MAX.
*
* @retval ::RSMI_STATUS_SUCCESS call was successful
* @retval ::RSMI_STATUS_NOT_SUPPORTED installed software or hardware does not
@@ -50,7 +50,7 @@ except ImportError:
# Minor version - Increment when adding a new feature, set to 0 when major is incremented
# Patch version - Increment when adding a fix, set to 0 when minor is incremented
# Hash version - Shortened commit hash. Print here and not with lib for consistency with amd-smi
SMI_MAJ = 3
SMI_MAJ = 4
SMI_MIN = 0
SMI_PAT = 0
# SMI_HASH is provided by rsmiBindings
@@ -2827,13 +2827,20 @@ def showRange(deviceList, rangeType):
return
printLogSpacer(' Show Valid %s Range ' % (rangeType))
odvf = rsmi_od_volt_freq_data_t()
uint64_max = UIntegerTypes.UINT64_T
for device in deviceList:
ret = rocmsmi.rsmi_dev_od_volt_info_get(device, byref(odvf))
if rsmi_ret_ok(ret, device, 'get_od_volt', silent=False):
if rangeType == 'sclk':
if odvf.curr_sclk_range.lower_bound == uint64_max or odvf.curr_sclk_range.upper_bound == uint64_max:
printLog(device, 'Unable to display %s range' % (rangeType), None)
continue
printLog(device, 'Valid sclk range: %sMhz - %sMhz' % (
int(odvf.curr_sclk_range.lower_bound / 1000000), int(odvf.curr_sclk_range.upper_bound / 1000000)), None)
if rangeType == 'mclk':
if odvf.curr_mclk_range.lower_bound == uint64_max or odvf.curr_mclk_range.upper_bound == uint64_max:
printLog(device, 'Unable to display %s range' % (rangeType), None)
continue
printLog(device, 'Valid mclk range: %sMhz - %sMhz' % (
int(odvf.curr_mclk_range.lower_bound / 1000000), int(odvf.curr_mclk_range.upper_bound / 1000000)), None)
if rangeType == 'voltage':
+55 -43
View File
@@ -1392,6 +1392,12 @@ static rsmi_status_t get_od_clk_volt_info(uint32_t dv_ind,
return RSMI_STATUS_INVALID_ARGS;
}
// fill out rsmi_od_volt_freq_data_t p with default max values to indicate no valid data
p->curr_sclk_range.lower_bound = UINT64_MAX;
p->curr_sclk_range.upper_bound = UINT64_MAX;
p->curr_mclk_range.lower_bound = UINT64_MAX;
p->curr_mclk_range.upper_bound = UINT64_MAX;
ret = GetDevValueVec(amd::smi::kDevPowerODVoltage, dv_ind, &val_vec);
if (ret != RSMI_STATUS_SUCCESS) {
return ret;
@@ -1419,13 +1425,6 @@ static rsmi_status_t get_od_clk_volt_info(uint32_t dv_ind,
.set_key_data_splitter(":", amd::smi::TagSplitterPositional_t::kBETWEEN)
.structure_content();
//
// Note: We must have minimum of 'GFXCLK:' && 'MCLK:' OR:
// 'OD_SCLK:' && 'OD_MCLK:' tags.
if (txt_power_dev_od_voltage.get_title_size() < kMIN_VALID_LINES) {
return rsmi_status_t::RSMI_STATUS_NO_DATA;
}
// Note: For debug builds/purposes only.
assert(txt_power_dev_od_voltage.contains_title_key(kTAG_GFXCLK) ||
txt_power_dev_od_voltage.contains_title_key(kTAG_OD_SCLK));
@@ -1446,47 +1445,60 @@ static rsmi_status_t get_od_clk_volt_info(uint32_t dv_ind,
return std::vector<std::string>{upper_bound_data};
};
// Validates 'OD_SCLK' is in the structure
if (txt_power_dev_od_voltage.contains_structured_key(kTAG_OD_SCLK,
// track the number of keys found, if this goes down to 0 then that means that there is no valid data
const uint8_t kNumStructuredKeysToCheck = 6;
uint8_t structured_key_counter = kNumStructuredKeysToCheck;
// Validates 'OD_SCLK' is in the structure
if (txt_power_dev_od_voltage.contains_structured_key(kTAG_OD_SCLK,
KTAG_FIRST_FREQ_IDX)) {
p->curr_sclk_range.lower_bound = freq_string_to_int(build_lower_bound(kTAG_OD_SCLK), nullptr, nullptr, 0);
p->curr_sclk_range.upper_bound = freq_string_to_int(build_upper_bound(kTAG_OD_SCLK), nullptr, nullptr, 0);
}
else
structured_key_counter--;
// Validates 'OD_MCLK' is in the structure
if (txt_power_dev_od_voltage.contains_structured_key(KTAG_OD_MCLK,
KTAG_FIRST_FREQ_IDX)) {
p->curr_mclk_range.lower_bound = freq_string_to_int(build_lower_bound(KTAG_OD_MCLK), nullptr, nullptr, 0);
p->curr_mclk_range.upper_bound = freq_string_to_int(build_upper_bound(KTAG_OD_MCLK), nullptr, nullptr, 0);
}
if (txt_power_dev_od_voltage.contains_structured_key(KTAG_OD_MCLK,
KTAG_FIRST_FREQ_IDX)) {
p->curr_mclk_range.lower_bound = freq_string_to_int(build_lower_bound(KTAG_OD_MCLK), nullptr, nullptr, 0);
p->curr_mclk_range.upper_bound = freq_string_to_int(build_upper_bound(KTAG_OD_MCLK), nullptr, nullptr, 0);
}
else
structured_key_counter--;
// Validates 'OD_RANGE' is in the structure
if (txt_power_dev_od_voltage.contains_structured_key(KTAG_OD_RANGE,
KTAG_SCLK)) {
od_value_pair_str_to_range(txt_power_dev_od_voltage
.get_structured_value_by_keys(KTAG_OD_RANGE, KTAG_SCLK),
&p->sclk_freq_limits);
}
if (txt_power_dev_od_voltage.contains_structured_key(KTAG_OD_RANGE,
KTAG_MCLK)) {
od_value_pair_str_to_range(txt_power_dev_od_voltage
.get_structured_value_by_keys(KTAG_OD_RANGE, KTAG_MCLK),
&p->mclk_freq_limits);
}
}
// Validates 'GFXCLK' is in the structure
else if (txt_power_dev_od_voltage.contains_structured_key(kTAG_GFXCLK,
KTAG_FIRST_FREQ_IDX)) {
p->curr_sclk_range.lower_bound = freq_string_to_int(build_lower_bound(kTAG_GFXCLK), nullptr, nullptr, 0);
p->curr_sclk_range.upper_bound = freq_string_to_int(build_upper_bound(kTAG_GFXCLK), nullptr, nullptr, 0);
// Validates 'MCLK' is in the structure
if (txt_power_dev_od_voltage.contains_structured_key(KTAG_MCLK,
KTAG_FIRST_FREQ_IDX)) {
p->curr_mclk_range.lower_bound = freq_string_to_int(build_lower_bound(KTAG_MCLK), nullptr, nullptr, 0);
p->curr_mclk_range.upper_bound = freq_string_to_int(build_upper_bound(KTAG_MCLK), nullptr, nullptr, 0);
}
}
else {
// Validates 'OD_RANGE' is in the structure
if (txt_power_dev_od_voltage.contains_structured_key(KTAG_OD_RANGE,
KTAG_SCLK)) {
od_value_pair_str_to_range(txt_power_dev_od_voltage
.get_structured_value_by_keys(KTAG_OD_RANGE, KTAG_SCLK),
&p->sclk_freq_limits);
}
else
structured_key_counter--;
if (txt_power_dev_od_voltage.contains_structured_key(KTAG_OD_RANGE,
KTAG_MCLK)) {
od_value_pair_str_to_range(txt_power_dev_od_voltage
.get_structured_value_by_keys(KTAG_OD_RANGE, KTAG_MCLK),
&p->mclk_freq_limits);
}
else
structured_key_counter--;
// Validates 'GFXCLK' is in the structure
if (txt_power_dev_od_voltage.contains_structured_key(kTAG_GFXCLK,
KTAG_FIRST_FREQ_IDX)) {
p->curr_sclk_range.lower_bound = freq_string_to_int(build_lower_bound(kTAG_GFXCLK), nullptr, nullptr, 0);
p->curr_sclk_range.upper_bound = freq_string_to_int(build_upper_bound(kTAG_GFXCLK), nullptr, nullptr, 0);
}
else
structured_key_counter--;
// Validates 'MCLK' is in the structure
if (txt_power_dev_od_voltage.contains_structured_key(KTAG_MCLK,
KTAG_FIRST_FREQ_IDX)) {
p->curr_mclk_range.lower_bound = freq_string_to_int(build_lower_bound(KTAG_MCLK), nullptr, nullptr, 0);
p->curr_mclk_range.upper_bound = freq_string_to_int(build_upper_bound(KTAG_MCLK), nullptr, nullptr, 0);
}
else
structured_key_counter--;
if (structured_key_counter == 0) {
return RSMI_STATUS_NOT_YET_IMPLEMENTED;
}