Renamed API amdsmi_dev_get_busy_percent to
amdsmi_get_busy_percent grep -rli 'amdsmi_dev_get_busy_percent' * | xargs -i@ sed -i 's/amdsmi_dev_get_busy_percent/amdsmi_get_busy_percent/g' @ Change-Id: I02ff8f86d2e7a6c38e7f56d40a07b27e90835152
Этот коммит содержится в:
коммит произвёл
Naveen Krishna Chatradhi
родитель
8d7b6ee5d1
Коммит
575856eeee
@@ -1892,7 +1892,7 @@ try:
|
||||
except AmdSmiException as e:
|
||||
print(e)
|
||||
```
|
||||
## amdsmi_dev_get_busy_percent
|
||||
## amdsmi_get_busy_percent
|
||||
Description: Get percentage of time device is busy doing any processing
|
||||
|
||||
Input parameters:
|
||||
@@ -1900,7 +1900,7 @@ Input parameters:
|
||||
|
||||
Output: How busy the device is (as percentage of time)
|
||||
|
||||
Exceptions that can be thrown by `amdsmi_dev_get_busy_percent` function:
|
||||
Exceptions that can be thrown by `amdsmi_get_busy_percent` function:
|
||||
* `AmdSmiLibraryException`
|
||||
* `AmdSmiRetryException`
|
||||
* `AmdSmiParameterException`
|
||||
@@ -1913,7 +1913,7 @@ try:
|
||||
print("No GPUs on machine")
|
||||
else:
|
||||
for device in devices:
|
||||
busy = amdsmi_dev_get_busy_percent(dev)
|
||||
busy = amdsmi_get_busy_percent(dev)
|
||||
print(busy)
|
||||
except AmdSmiException as e:
|
||||
print(e)
|
||||
|
||||
@@ -104,7 +104,7 @@ from .amdsmi_interface import amdsmi_get_temp_metric
|
||||
from .amdsmi_interface import amdsmi_get_gpu_volt_metric
|
||||
|
||||
# # Clock, Power and Performance Query
|
||||
from .amdsmi_interface import amdsmi_dev_get_busy_percent
|
||||
from .amdsmi_interface import amdsmi_get_busy_percent
|
||||
from .amdsmi_interface import amdsmi_get_utilization_count
|
||||
from .amdsmi_interface import amdsmi_dev_get_perf_level
|
||||
from .amdsmi_interface import amdsmi_set_perf_determinism_mode
|
||||
|
||||
@@ -2165,7 +2165,7 @@ def amdsmi_get_gpu_volt_metric(
|
||||
return voltage.value
|
||||
|
||||
|
||||
def amdsmi_dev_get_busy_percent(
|
||||
def amdsmi_get_busy_percent(
|
||||
processor_handle: amdsmi_wrapper.amdsmi_processor_handle,
|
||||
) -> int:
|
||||
if not isinstance(processor_handle, amdsmi_wrapper.amdsmi_processor_handle):
|
||||
@@ -2175,7 +2175,7 @@ def amdsmi_dev_get_busy_percent(
|
||||
|
||||
busy_percent = ctypes.c_uint32()
|
||||
_check_res(
|
||||
amdsmi_wrapper.amdsmi_dev_get_busy_percent(
|
||||
amdsmi_wrapper.amdsmi_get_busy_percent(
|
||||
processor_handle, ctypes.byref(busy_percent)
|
||||
)
|
||||
)
|
||||
|
||||
@@ -1508,9 +1508,9 @@ amdsmi_reset_gpu_fan.argtypes = [amdsmi_processor_handle, uint32_t]
|
||||
amdsmi_set_gpu_fan_speed = _libraries['libamd_smi.so'].amdsmi_set_gpu_fan_speed
|
||||
amdsmi_set_gpu_fan_speed.restype = amdsmi_status_t
|
||||
amdsmi_set_gpu_fan_speed.argtypes = [amdsmi_processor_handle, uint32_t, uint64_t]
|
||||
amdsmi_dev_get_busy_percent = _libraries['libamd_smi.so'].amdsmi_dev_get_busy_percent
|
||||
amdsmi_dev_get_busy_percent.restype = amdsmi_status_t
|
||||
amdsmi_dev_get_busy_percent.argtypes = [amdsmi_processor_handle, ctypes.POINTER(ctypes.c_uint32)]
|
||||
amdsmi_get_busy_percent = _libraries['libamd_smi.so'].amdsmi_get_busy_percent
|
||||
amdsmi_get_busy_percent.restype = amdsmi_status_t
|
||||
amdsmi_get_busy_percent.argtypes = [amdsmi_processor_handle, ctypes.POINTER(ctypes.c_uint32)]
|
||||
amdsmi_get_utilization_count = _libraries['libamd_smi.so'].amdsmi_get_utilization_count
|
||||
amdsmi_get_utilization_count.restype = amdsmi_status_t
|
||||
amdsmi_get_utilization_count.argtypes = [amdsmi_processor_handle, struct_c__SA_amdsmi_utilization_counter_t * 0, uint32_t, ctypes.POINTER(ctypes.c_uint64)]
|
||||
@@ -1851,7 +1851,7 @@ __all__ = \
|
||||
'amdsmi_counter_get_available_counters', 'amdsmi_counter_value_t',
|
||||
'amdsmi_dev_close_supported_func_iterator',
|
||||
'amdsmi_dev_counter_group_supported', 'amdsmi_dev_create_counter',
|
||||
'amdsmi_dev_destroy_counter', 'amdsmi_dev_get_busy_percent',
|
||||
'amdsmi_dev_destroy_counter', 'amdsmi_get_busy_percent',
|
||||
'amdsmi_get_gpu_drm_render_minor', 'amdsmi_dev_get_ecc_count',
|
||||
'amdsmi_dev_get_ecc_enabled', 'amdsmi_dev_get_ecc_status',
|
||||
'amdsmi_get_energy_count', 'amdsmi_get_gpu_fan_rpms',
|
||||
|
||||
@@ -309,7 +309,7 @@ class Formatter:
|
||||
| """ + 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_get_gpu_volt_metric <bdf>") + """ |
|
||||
| """ + self.style.text("23 Get device busy percent. Api: amdsmi_dev_get_busy_percent <bdf>") + """ |
|
||||
| """ + self.style.text("23 Get device busy percent. Api: amdsmi_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>") + """ |
|
||||
| """ + self.style.text("26 Set perf determinism mode. Api: amdsmi_set_perf_determinism_mode <bdf><clock_value>") + """ |
|
||||
@@ -792,7 +792,7 @@ commands = {
|
||||
22: [amdsmi_tool_dev_volt_metric_get, {
|
||||
"device_identifier1": [None, True],
|
||||
}],
|
||||
23: [smi_api.amdsmi_dev_get_busy_percent, {
|
||||
23: [smi_api.amdsmi_get_busy_percent, {
|
||||
"device_identifier1": [None, True]
|
||||
}],
|
||||
24: [amdsmi_tool_utilization_count_get, {
|
||||
|
||||
Ссылка в новой задаче
Block a user