Renamed API amdsmi_dev_get_pci_bandwidth to

amdsmi_get_gpu_pci_bandwidth

grep -rli 'amdsmi_dev_get_pci_bandwidth' * | xargs -i@ sed -i
's/amdsmi_dev_get_pci_bandwidth/amdsmi_get_gpu_pci_bandwidth/g' @

Change-Id: I43e5fc475f933b33770b6c2244232fca811c2036


[ROCm/amdsmi commit: 9b76d64944]
This commit is contained in:
Deepak Mewar
2023-02-25 07:24:40 -05:00
committed by Naveen Krishna Chatradhi
parent 0bd6f365bc
commit e53fdb26ca
10 changed files with 23 additions and 23 deletions
+1 -1
View File
@@ -1474,7 +1474,7 @@ amdsmi_get_gpu_drm_render_minor(amdsmi_processor_handle processor_handle, uint32
* @return ::amdsmi_status_t | ::AMDSMI_STATUS_SUCCESS on success, non-zero on fail
*/
amdsmi_status_t
amdsmi_dev_get_pci_bandwidth(amdsmi_processor_handle processor_handle, amdsmi_pcie_bandwidth_t *bandwidth);
amdsmi_get_gpu_pci_bandwidth(amdsmi_processor_handle processor_handle, amdsmi_pcie_bandwidth_t *bandwidth);
/**
* @brief Get the unique PCI device identifier associated for a device
+3 -3
View File
@@ -1355,7 +1355,7 @@ except AmdSmiException as e:
```
## amdsmi_dev_get_pci_bandwidth
## amdsmi_get_gpu_pci_bandwidth
Description: Get the list of possible PCIe bandwidths that are available.
Input parameters:
@@ -1378,7 +1378,7 @@ Field | Content
`current` | current
`frequency` | list of frequency
Exceptions that can be thrown by `amdsmi_dev_get_pci_bandwidth` function:
Exceptions that can be thrown by `amdsmi_get_gpu_pci_bandwidth` function:
* `AmdSmiLibraryException`
* `AmdSmiRetryException`
* `AmdSmiParameterException`
@@ -1391,7 +1391,7 @@ try:
print("No GPUs on machine")
else:
for device in devices:
bandwidth = amdsmi_dev_get_pci_bandwidth(device)
bandwidth = amdsmi_get_gpu_pci_bandwidth(device)
print(bandwidth)
except AmdSmiException as e:
print(e)
+1 -1
View File
@@ -138,7 +138,7 @@ from .amdsmi_interface import amdsmi_dev_reset_xgmi_error
# # PCIE information
from .amdsmi_interface import amdsmi_dev_get_pci_id
from .amdsmi_interface import amdsmi_dev_get_pci_bandwidth
from .amdsmi_interface import amdsmi_get_gpu_pci_bandwidth
from .amdsmi_interface import amdsmi_dev_get_pci_throughput
from .amdsmi_interface import amdsmi_dev_get_pci_replay_counter
from .amdsmi_interface import amdsmi_topo_get_numa_affinity
@@ -1742,7 +1742,7 @@ def _format_transfer_rate(transfer_rate):
}
def amdsmi_dev_get_pci_bandwidth(processor_handle: amdsmi_wrapper.amdsmi_processor_handle):
def amdsmi_get_gpu_pci_bandwidth(processor_handle: amdsmi_wrapper.amdsmi_processor_handle):
if not isinstance(processor_handle, amdsmi_wrapper.amdsmi_processor_handle):
raise AmdSmiParameterException(
processor_handle, amdsmi_wrapper.amdsmi_processor_handle
@@ -1751,7 +1751,7 @@ def amdsmi_dev_get_pci_bandwidth(processor_handle: amdsmi_wrapper.amdsmi_process
bandwidth = amdsmi_wrapper.amdsmi_pcie_bandwidth_t()
_check_res(
amdsmi_wrapper.amdsmi_dev_get_pci_bandwidth(
amdsmi_wrapper.amdsmi_get_gpu_pci_bandwidth(
processor_handle, ctypes.byref(bandwidth))
)
@@ -1439,9 +1439,9 @@ amdsmi_get_gpu_subsystem_name.argtypes = [amdsmi_processor_handle, ctypes.POINTE
amdsmi_get_gpu_drm_render_minor = _libraries['libamd_smi.so'].amdsmi_get_gpu_drm_render_minor
amdsmi_get_gpu_drm_render_minor.restype = amdsmi_status_t
amdsmi_get_gpu_drm_render_minor.argtypes = [amdsmi_processor_handle, ctypes.POINTER(ctypes.c_uint32)]
amdsmi_dev_get_pci_bandwidth = _libraries['libamd_smi.so'].amdsmi_dev_get_pci_bandwidth
amdsmi_dev_get_pci_bandwidth.restype = amdsmi_status_t
amdsmi_dev_get_pci_bandwidth.argtypes = [amdsmi_processor_handle, ctypes.POINTER(struct_c__SA_amdsmi_pcie_bandwidth_t)]
amdsmi_get_gpu_pci_bandwidth = _libraries['libamd_smi.so'].amdsmi_get_gpu_pci_bandwidth
amdsmi_get_gpu_pci_bandwidth.restype = amdsmi_status_t
amdsmi_get_gpu_pci_bandwidth.argtypes = [amdsmi_processor_handle, ctypes.POINTER(struct_c__SA_amdsmi_pcie_bandwidth_t)]
amdsmi_dev_get_pci_id = _libraries['libamd_smi.so'].amdsmi_dev_get_pci_id
amdsmi_dev_get_pci_id.restype = amdsmi_status_t
amdsmi_dev_get_pci_id.argtypes = [amdsmi_processor_handle, ctypes.POINTER(ctypes.c_uint64)]
@@ -1862,7 +1862,7 @@ __all__ = \
'amdsmi_dev_get_memory_total', 'amdsmi_dev_get_memory_usage',
'amdsmi_dev_get_od_volt_curve_regions',
'amdsmi_dev_get_od_volt_info', 'amdsmi_dev_get_overdrive_level',
'amdsmi_dev_get_pci_bandwidth', 'amdsmi_dev_get_pci_id',
'amdsmi_get_gpu_pci_bandwidth', 'amdsmi_dev_get_pci_id',
'amdsmi_dev_get_pci_replay_counter',
'amdsmi_dev_get_pci_throughput', 'amdsmi_dev_get_perf_level',
'amdsmi_dev_get_power_ave',
@@ -294,7 +294,7 @@ class Formatter:
| """ + self.style.text(" 5 Get device subsystem id. Api: amdsmi_get_gpu_subsystem_id <bdf>") + """ |
| """ + self.style.text(" 6 Get device subsystem name. Api: amdsmi_get_gpu_subsystem_name <bdf>") + """ |
| """ + self.style.text(" 7 Get device pci id. Api: amdsmi_dev_get_pci_id <bdf>") + """ |
| """ + self.style.text(" 8 Get device pci bandwidth. Api: amdsmi_dev_get_pci_bandwidth <bdf>") + """ |
| """ + self.style.text(" 8 Get device pci bandwidth. Api: amdsmi_get_gpu_pci_bandwidth <bdf>") + """ |
| """ + self.style.text(" 9 Get device pci throughput. Api: amdsmi_dev_get_pci_throughput <bdf>") + """ |
| """ + self.style.text("10 Get device pci replay counter. Api: amdsmi_dev_get_pci_replay_counter <bdf>") + """ |
| """ + self.style.text("11 Get topo numa affinity. Api: amdsmi_topo_get_numa_affinity <bdf>") + """ |
@@ -743,7 +743,7 @@ commands = {
7: [smi_api.amdsmi_dev_get_pci_id, {
"device_identifier1": [None, True]
}],
8: [smi_api.amdsmi_dev_get_pci_bandwidth, {
8: [smi_api.amdsmi_get_gpu_pci_bandwidth, {
"device_identifier1": [None, True]
}],
9: [smi_api.amdsmi_dev_get_pci_throughput, {
+2 -2
View File
@@ -901,7 +901,7 @@ amdsmi_get_func_iter_value(amdsmi_func_id_iter_handle_t handle,
{"rsmi_dev_drm_render_minor_get", "amdsmi_get_gpu_drm_render_minor"},
{"rsmi_dev_subsystem_vendor_id_get", "amdsmi_get_gpu_asic_info"},
{"rsmi_dev_unique_id_get", "amdsmi_get_board_info"},
{"rsmi_dev_pci_bandwidth_get", "amdsmi_dev_get_pci_bandwidth"},
{"rsmi_dev_pci_bandwidth_get", "amdsmi_get_gpu_pci_bandwidth"},
{"rsmi_dev_pci_id_get", "amdsmi_dev_get_pci_id"},
{"rsmi_dev_pci_throughput_get", "amdsmi_dev_get_pci_throughput"},
{"rsmi_dev_pci_replay_counter_get", " amdsmi_dev_get_pci_replay_counter"},
@@ -1195,7 +1195,7 @@ amdsmi_status_t amdsmi_dev_set_pci_bandwidth(amdsmi_processor_handle processor_
bw_bitmask);
}
amdsmi_status_t amdsmi_dev_get_pci_bandwidth(amdsmi_processor_handle processor_handle,
amdsmi_status_t amdsmi_get_gpu_pci_bandwidth(amdsmi_processor_handle processor_handle,
amdsmi_pcie_bandwidth_t *bandwidth) {
return rsmi_wrapper(rsmi_dev_pci_bandwidth_get, processor_handle,
reinterpret_cast<rsmi_pcie_bandwidth_t*>(bandwidth));
@@ -147,12 +147,12 @@ void TestFrequenciesRead::Run(void) {
freq_output(CLK_TYPE_DCEF, "Display Controller Engine Clock");
freq_output(CLK_TYPE_SOC, "SOC Clock");
err = amdsmi_dev_get_pci_bandwidth(processor_handles_[i], &b);
err = amdsmi_get_gpu_pci_bandwidth(processor_handles_[i], &b);
if (err == AMDSMI_STATUS_NOT_SUPPORTED) {
std::cout << "\t**Get PCIE Bandwidth: Not supported on this machine"
<< std::endl;
// Verify api support checking functionality is working
err = amdsmi_dev_get_pci_bandwidth(processor_handles_[i], nullptr);
err = amdsmi_get_gpu_pci_bandwidth(processor_handles_[i], nullptr);
ASSERT_EQ(err, AMDSMI_STATUS_NOT_SUPPORTED);
} else if (err == AMDSMI_STATUS_NOT_YET_IMPLEMENTED) {
std::cout << "\t**Get PCIE Bandwidth "
@@ -164,7 +164,7 @@ void TestFrequenciesRead::Run(void) {
std::cout << b.transfer_rate.num_supported << std::endl;
print_frequencies(&b.transfer_rate, b.lanes);
// Verify api support checking functionality is working
err = amdsmi_dev_get_pci_bandwidth(processor_handles_[i], nullptr);
err = amdsmi_get_gpu_pci_bandwidth(processor_handles_[i], nullptr);
ASSERT_EQ(err, AMDSMI_STATUS_INVAL);
}
}
@@ -269,7 +269,7 @@ void TestMutualExclusion::Run(void) {
amdsmi_get_gpu_subsystem_name
amdsmi_get_gpu_drm_render_minor
amdsmi_get_gpu_vendor_name
amdsmi_dev_get_pci_bandwidth
amdsmi_get_gpu_pci_bandwidth
amdsmi_dev_set_pci_bandwidth
amdsmi_dev_get_pci_throughput
amdsmi_dev_get_temp_metric
@@ -141,14 +141,14 @@ void TestPciReadWrite::Run(void) {
std::cout << std::endl;
}
ret = amdsmi_dev_get_pci_bandwidth(processor_handles_[dv_ind], &bw);
ret = amdsmi_get_gpu_pci_bandwidth(processor_handles_[dv_ind], &bw);
if (ret == AMDSMI_STATUS_NOT_SUPPORTED) {
std::cout << "TEST FAILURE: Current PCIe bandwidth is not detected. "
"This is likely because it is not indicated in the pp_dpm_pcie sysfs "
"file. Aborting test." << std::endl;
// Verify api support checking functionality is working
ret = amdsmi_dev_get_pci_bandwidth(processor_handles_[dv_ind], nullptr);
ret = amdsmi_get_gpu_pci_bandwidth(processor_handles_[dv_ind], nullptr);
ASSERT_EQ(ret, AMDSMI_STATUS_NOT_SUPPORTED);
return;
@@ -163,7 +163,7 @@ void TestPciReadWrite::Run(void) {
std::endl;
}
// Verify api support checking functionality is working
ret = amdsmi_dev_get_pci_bandwidth(processor_handles_[dv_ind], nullptr);
ret = amdsmi_get_gpu_pci_bandwidth(processor_handles_[dv_ind], nullptr);
ASSERT_EQ(ret, AMDSMI_STATUS_INVAL);
// First set the bitmask to all supported bandwidths
@@ -185,7 +185,7 @@ void TestPciReadWrite::Run(void) {
ret = amdsmi_dev_set_pci_bandwidth(processor_handles_[dv_ind], freq_bitmask);
CHK_ERR_ASRT(ret)
ret = amdsmi_dev_get_pci_bandwidth(processor_handles_[dv_ind], &bw);
ret = amdsmi_get_gpu_pci_bandwidth(processor_handles_[dv_ind], &bw);
CHK_ERR_ASRT(ret)
IF_VERB(STANDARD) {