Renamed API amdsmi_dev_get_volt_metric to
amdsmi_get_gpu_volt_metric
grep -rli 'amdsmi_dev_get_volt_metric' * | xargs -i@ sed -i
's/amdsmi_dev_get_volt_metric/amdsmi_get_gpu_volt_metric/g' @
Change-Id: Icd34fa435d067815d83b61e84b70b1d78105f8b6
[ROCm/amdsmi commit: 1358f3cfd0]
This commit is contained in:
committed by
Naveen Krishna Chatradhi
szülő
da14f8b791
commit
f33edadf51
@@ -2020,7 +2020,7 @@ amdsmi_status_t amdsmi_get_temp_metric(amdsmi_processor_handle processor_handle
|
||||
*
|
||||
* @return ::amdsmi_status_t | ::AMDSMI_STATUS_SUCCESS on success, non-zero on fail
|
||||
*/
|
||||
amdsmi_status_t amdsmi_dev_get_volt_metric(amdsmi_processor_handle processor_handle,
|
||||
amdsmi_status_t amdsmi_get_gpu_volt_metric(amdsmi_processor_handle processor_handle,
|
||||
amdsmi_voltage_type_t sensor_type,
|
||||
amdsmi_voltage_metric_t metric, int64_t *voltage);
|
||||
|
||||
|
||||
@@ -1862,7 +1862,7 @@ try:
|
||||
except AmdSmiException as e:
|
||||
print(e)
|
||||
```
|
||||
## amdsmi_dev_get_volt_metric
|
||||
## amdsmi_get_gpu_volt_metric
|
||||
Description: Get the voltage metric value for the specified metric, from the
|
||||
specified voltage sensor on the specified device
|
||||
|
||||
@@ -1873,7 +1873,7 @@ Input parameters:
|
||||
|
||||
Output: Voltage as integer in millivolts
|
||||
|
||||
Exceptions that can be thrown by ` amdsmi_dev_get_volt_metric` function:
|
||||
Exceptions that can be thrown by ` amdsmi_get_gpu_volt_metric` function:
|
||||
* `AmdSmiLibraryException`
|
||||
* `AmdSmiRetryException`
|
||||
* `AmdSmiParameterException`
|
||||
@@ -1886,7 +1886,7 @@ try:
|
||||
print("No GPUs on machine")
|
||||
else:
|
||||
for device in devices:
|
||||
voltage = amdsmi_dev_get_volt_metric(device, AmdSmiVoltageType.VDDGFX,
|
||||
voltage = amdsmi_get_gpu_volt_metric(device, AmdSmiVoltageType.VDDGFX,
|
||||
AmdSmiVoltageMetric.AVERAGE)
|
||||
print(voltage)
|
||||
except AmdSmiException as e:
|
||||
|
||||
@@ -101,7 +101,7 @@ from .amdsmi_interface import amdsmi_get_gpu_fan_rpms
|
||||
from .amdsmi_interface import amdsmi_get_gpu_fan_speed
|
||||
from .amdsmi_interface import amdsmi_get_gpu_fan_speed_max
|
||||
from .amdsmi_interface import amdsmi_get_temp_metric
|
||||
from .amdsmi_interface import amdsmi_dev_get_volt_metric
|
||||
from .amdsmi_interface import amdsmi_get_gpu_volt_metric
|
||||
|
||||
# # Clock, Power and Performance Query
|
||||
from .amdsmi_interface import amdsmi_dev_get_busy_percent
|
||||
|
||||
@@ -2141,7 +2141,7 @@ def amdsmi_get_temp_metric(
|
||||
return temp_value.value
|
||||
|
||||
|
||||
def amdsmi_dev_get_volt_metric(
|
||||
def amdsmi_get_gpu_volt_metric(
|
||||
processor_handle: amdsmi_wrapper.amdsmi_processor_handle,
|
||||
sensor_type: AmdSmiVoltageType,
|
||||
metric: AmdSmiVoltageMetric,
|
||||
@@ -2157,7 +2157,7 @@ def amdsmi_dev_get_volt_metric(
|
||||
|
||||
voltage = ctypes.c_int64()
|
||||
_check_res(
|
||||
amdsmi_wrapper. amdsmi_dev_get_volt_metric(
|
||||
amdsmi_wrapper. amdsmi_get_gpu_volt_metric(
|
||||
processor_handle, sensor_type, metric, ctypes.byref(voltage)
|
||||
)
|
||||
)
|
||||
|
||||
@@ -1499,9 +1499,9 @@ amdsmi_get_gpu_fan_speed_max.argtypes = [amdsmi_processor_handle, uint32_t, ctyp
|
||||
amdsmi_get_temp_metric = _libraries['libamd_smi.so'].amdsmi_get_temp_metric
|
||||
amdsmi_get_temp_metric.restype = amdsmi_status_t
|
||||
amdsmi_get_temp_metric.argtypes = [amdsmi_processor_handle, amdsmi_temperature_type_t, amdsmi_temperature_metric_t, ctypes.POINTER(ctypes.c_int64)]
|
||||
amdsmi_dev_get_volt_metric = _libraries['libamd_smi.so'].amdsmi_dev_get_volt_metric
|
||||
amdsmi_dev_get_volt_metric.restype = amdsmi_status_t
|
||||
amdsmi_dev_get_volt_metric.argtypes = [amdsmi_processor_handle, amdsmi_voltage_type_t, amdsmi_voltage_metric_t, ctypes.POINTER(ctypes.c_int64)]
|
||||
amdsmi_get_gpu_volt_metric = _libraries['libamd_smi.so'].amdsmi_get_gpu_volt_metric
|
||||
amdsmi_get_gpu_volt_metric.restype = amdsmi_status_t
|
||||
amdsmi_get_gpu_volt_metric.argtypes = [amdsmi_processor_handle, amdsmi_voltage_type_t, amdsmi_voltage_metric_t, ctypes.POINTER(ctypes.c_int64)]
|
||||
amdsmi_dev_reset_fan = _libraries['libamd_smi.so'].amdsmi_dev_reset_fan
|
||||
amdsmi_dev_reset_fan.restype = amdsmi_status_t
|
||||
amdsmi_dev_reset_fan.argtypes = [amdsmi_processor_handle, uint32_t]
|
||||
@@ -1869,7 +1869,7 @@ __all__ = \
|
||||
'amdsmi_dev_get_power_profile_presets',
|
||||
'amdsmi_get_gpu_subsystem_id', 'amdsmi_get_gpu_subsystem_name',
|
||||
'amdsmi_get_temp_metric', 'amdsmi_get_gpu_vendor_name',
|
||||
'amdsmi_dev_get_volt_metric', 'amdsmi_get_gpu_vram_vendor',
|
||||
'amdsmi_get_gpu_volt_metric', 'amdsmi_get_gpu_vram_vendor',
|
||||
'amdsmi_dev_open_supported_func_iterator',
|
||||
'amdsmi_dev_open_supported_variant_iterator',
|
||||
'amdsmi_dev_perf_level_t', 'amdsmi_dev_perf_level_t__enumvalues',
|
||||
|
||||
@@ -308,7 +308,7 @@ class Formatter:
|
||||
| """ + self.style.text("19 Get device fan speed. Api: amdsmi_get_gpu_fan_speed <bdf><sensor_idx>") + """ |
|
||||
| """ + self.style.text("20 Get device fan speed max. Api: amdsmi_get_gpu_fan_speed_max <bdf><sensor_idx>") + """ |
|
||||
| """ + self.style.text("21 Get device temp metric. Api: amdsmi_get_temp_metric <bdf>") + """ |
|
||||
| """ + self.style.text("22 Get device volt metric. Api: amdsmi_dev_get_volt_metric <bdf>") + """ |
|
||||
| """ + self.style.text("22 Get device volt metric. Api: amdsmi_get_gpu_volt_metric <bdf>") + """ |
|
||||
| """ + self.style.text("23 Get device busy percent. Api: amdsmi_dev_get_busy_percent <bdf>") + """ |
|
||||
| """ + self.style.text("24 Get utilization count. Api: amdsmi_get_utilization_count <bdf>") + """ |
|
||||
| """ + self.style.text("25 Get device perf level. Api: amdsmi_dev_get_perf_level <bdf>") + """ |
|
||||
@@ -430,7 +430,7 @@ def amdsmi_tool_dev_volt_metric_get(dev):
|
||||
for voltage_type in smi_api.AmdSmiVoltageType:
|
||||
for voltage_metric in smi_api.AmdSmiVoltageMetric:
|
||||
try:
|
||||
value = smi_api. amdsmi_dev_get_volt_metric(dev, voltage_type, voltage_metric)
|
||||
value = smi_api. amdsmi_get_gpu_volt_metric(dev, voltage_type, voltage_metric)
|
||||
result.update({"AmdSmiVoltageType: " + voltage_type.name + ", AmdSmiVoltageMetric: " + voltage_metric.name: value})
|
||||
except smi_api.AmdSmiException as e:
|
||||
print("{},{}:\t{}".format(voltage_type.name, voltage_metric.name, e))
|
||||
|
||||
@@ -949,7 +949,7 @@ amdsmi_get_func_iter_value(amdsmi_func_id_iter_handle_t handle,
|
||||
{"rsmi_dev_temp_metric_get", " amdsmi_get_temp_metric"},
|
||||
{"rsmi_dev_fan_reset", "amdsmi_dev_reset_fan"},
|
||||
{"rsmi_dev_fan_speed_set", "amdsmi_dev_set_fan_speed"},
|
||||
{"rsmi_dev_volt_metric_get", " amdsmi_dev_get_volt_metric"}
|
||||
{"rsmi_dev_volt_metric_get", " amdsmi_get_gpu_volt_metric"}
|
||||
};
|
||||
|
||||
auto rocm_func_handle =
|
||||
@@ -1315,7 +1315,7 @@ amdsmi_status_t amdsmi_dev_get_od_volt_curve_regions(
|
||||
num_regions, reinterpret_cast<rsmi_freq_volt_region_t* >(buffer));
|
||||
}
|
||||
|
||||
amdsmi_status_t amdsmi_dev_get_volt_metric(amdsmi_processor_handle processor_handle,
|
||||
amdsmi_status_t amdsmi_get_gpu_volt_metric(amdsmi_processor_handle processor_handle,
|
||||
amdsmi_voltage_type_t sensor_type,
|
||||
amdsmi_voltage_metric_t metric, int64_t *voltage) {
|
||||
return rsmi_wrapper(rsmi_dev_volt_metric_get, processor_handle,
|
||||
@@ -1720,7 +1720,7 @@ amdsmi_get_power_measure(amdsmi_processor_handle processor_handle, amdsmi_power_
|
||||
|
||||
int64_t voltage_read = 0;
|
||||
|
||||
status = amdsmi_dev_get_volt_metric(processor_handle, AMDSMI_VOLT_TYPE_VDDGFX, AMDSMI_VOLT_CURRENT, &voltage_read);
|
||||
status = amdsmi_get_gpu_volt_metric(processor_handle, AMDSMI_VOLT_TYPE_VDDGFX, AMDSMI_VOLT_CURRENT, &voltage_read);
|
||||
if (status != AMDSMI_STATUS_SUCCESS) {
|
||||
return status;
|
||||
}
|
||||
|
||||
@@ -273,7 +273,7 @@ void TestMutualExclusion::Run(void) {
|
||||
amdsmi_set_gpu_pci_bandwidth
|
||||
amdsmi_get_gpu_pci_throughput
|
||||
amdsmi_get_temp_metric
|
||||
amdsmi_dev_get_volt_metric
|
||||
amdsmi_get_gpu_volt_metric
|
||||
amdsmi_get_gpu_fan_speed
|
||||
amdsmi_get_gpu_fan_rpms
|
||||
amdsmi_dev_reset_fan
|
||||
|
||||
@@ -104,7 +104,7 @@ void TestVoltRead::Run(void) {
|
||||
|
||||
auto print_volt_metric = [&](amdsmi_voltage_metric_t met,
|
||||
std::string label) {
|
||||
err = amdsmi_dev_get_volt_metric(processor_handles_[i], type, met, &val_i64);
|
||||
err = amdsmi_get_gpu_volt_metric(processor_handles_[i], type, met, &val_i64);
|
||||
|
||||
if (err != AMDSMI_STATUS_SUCCESS) {
|
||||
if (err == AMDSMI_STATUS_NOT_SUPPORTED) {
|
||||
@@ -113,7 +113,7 @@ void TestVoltRead::Run(void) {
|
||||
"Not supported on this machine" << std::endl;
|
||||
|
||||
// Verify api support checking functionality is working
|
||||
err = amdsmi_dev_get_volt_metric(processor_handles_[i], type, met, nullptr);
|
||||
err = amdsmi_get_gpu_volt_metric(processor_handles_[i], type, met, nullptr);
|
||||
ASSERT_EQ(err, AMDSMI_STATUS_NOT_SUPPORTED);
|
||||
return;
|
||||
}
|
||||
@@ -122,7 +122,7 @@ void TestVoltRead::Run(void) {
|
||||
}
|
||||
}
|
||||
// Verify api support checking functionality is working
|
||||
err = amdsmi_dev_get_volt_metric(processor_handles_[i], type, met, nullptr);
|
||||
err = amdsmi_get_gpu_volt_metric(processor_handles_[i], type, met, nullptr);
|
||||
ASSERT_EQ(err, AMDSMI_STATUS_INVAL);
|
||||
|
||||
IF_VERB(STANDARD) {
|
||||
|
||||
Reference in New Issue
Block a user