Renamed API amdsmi_dev_get_pci_id to
amdsmi_get_gpu_pci_id
grep -rli 'amdsmi_dev_get_pci_id' * | xargs -i@ sed -i
's/amdsmi_dev_get_pci_id/amdsmi_get_gpu_pci_id/g' @
Change-Id: If5454038cf582bdf3c657f466d0f6eb1dd3c14e0
[ROCm/amdsmi commit: 55ddbdc67e]
This commit is contained in:
committed by
Naveen Krishna Chatradhi
parent
3c3dc03704
commit
6bd013ba58
@@ -1303,7 +1303,7 @@ amdsmi_status_t amdsmi_get_processor_handle_from_bdf(amdsmi_bdf_t bdf, amdsmi_pr
|
||||
* @p id. This ID is an identification of the type of device, so calling this
|
||||
* function for different devices will give the same value if they are kind
|
||||
* of device. Consequently, this function should not be used to distinguish
|
||||
* one device from another. amdsmi_dev_get_pci_id() should be used to get a
|
||||
* one device from another. amdsmi_get_gpu_pci_id() should be used to get a
|
||||
* unique identifier.
|
||||
*
|
||||
* @param[in] processor_handle a device handle
|
||||
@@ -1508,7 +1508,7 @@ amdsmi_get_gpu_pci_bandwidth(amdsmi_processor_handle processor_handle, amdsmi_pc
|
||||
*
|
||||
* @return ::amdsmi_status_t | ::AMDSMI_STATUS_SUCCESS on success, non-zero on fail
|
||||
*/
|
||||
amdsmi_status_t amdsmi_dev_get_pci_id(amdsmi_processor_handle processor_handle, uint64_t *bdfid);
|
||||
amdsmi_status_t amdsmi_get_gpu_pci_id(amdsmi_processor_handle processor_handle, uint64_t *bdfid);
|
||||
|
||||
/**
|
||||
* @brief Get the NUMA node associated with a device
|
||||
|
||||
@@ -1313,7 +1313,7 @@ except AmdSmiException as e:
|
||||
```
|
||||
|
||||
|
||||
## amdsmi_dev_get_pci_id
|
||||
## amdsmi_get_gpu_pci_id
|
||||
Description: Get the unique PCI device identifier associated for a device
|
||||
|
||||
Input parameters:
|
||||
@@ -1335,7 +1335,7 @@ BDFID = ((DOMAIN & 0xffffffff) << 32) | ((BUS & 0xff) << 8) |
|
||||
| Function | [ 2: 0] |
|
||||
|
||||
|
||||
Exceptions that can be thrown by `amdsmi_dev_get_pci_id` function:
|
||||
Exceptions that can be thrown by `amdsmi_get_gpu_pci_id` function:
|
||||
* `AmdSmiLibraryException`
|
||||
* `AmdSmiRetryException`
|
||||
* `AmdSmiParameterException`
|
||||
@@ -1348,7 +1348,7 @@ try:
|
||||
print("No GPUs on machine")
|
||||
else:
|
||||
for device in devices:
|
||||
bdfid = amdsmi_dev_get_pci_id(device)
|
||||
bdfid = amdsmi_get_gpu_pci_id(device)
|
||||
print(bdfid)
|
||||
except AmdSmiException as e:
|
||||
print(e)
|
||||
|
||||
@@ -137,7 +137,7 @@ from .amdsmi_interface import amdsmi_dev_xgmi_error_status
|
||||
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_get_gpu_pci_id
|
||||
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
|
||||
|
||||
@@ -1626,7 +1626,7 @@ def amdsmi_dev_open_supported_func_iterator(
|
||||
return obj_handle
|
||||
|
||||
|
||||
def amdsmi_dev_get_pci_id(processor_handle: amdsmi_wrapper.amdsmi_processor_handle):
|
||||
def amdsmi_get_gpu_pci_id(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
|
||||
@@ -1634,7 +1634,7 @@ def amdsmi_dev_get_pci_id(processor_handle: amdsmi_wrapper.amdsmi_processor_hand
|
||||
|
||||
bdfid = ctypes.c_uint64()
|
||||
_check_res(
|
||||
amdsmi_wrapper.amdsmi_dev_get_pci_id(
|
||||
amdsmi_wrapper.amdsmi_get_gpu_pci_id(
|
||||
processor_handle, ctypes.byref(bdfid))
|
||||
)
|
||||
|
||||
|
||||
@@ -1442,9 +1442,9 @@ amdsmi_get_gpu_drm_render_minor.argtypes = [amdsmi_processor_handle, ctypes.POIN
|
||||
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)]
|
||||
amdsmi_get_gpu_pci_id = _libraries['libamd_smi.so'].amdsmi_get_gpu_pci_id
|
||||
amdsmi_get_gpu_pci_id.restype = amdsmi_status_t
|
||||
amdsmi_get_gpu_pci_id.argtypes = [amdsmi_processor_handle, ctypes.POINTER(ctypes.c_uint64)]
|
||||
amdsmi_topo_get_numa_affinity = _libraries['libamd_smi.so'].amdsmi_topo_get_numa_affinity
|
||||
amdsmi_topo_get_numa_affinity.restype = amdsmi_status_t
|
||||
amdsmi_topo_get_numa_affinity.argtypes = [amdsmi_processor_handle, ctypes.POINTER(ctypes.c_uint32)]
|
||||
@@ -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_get_gpu_pci_bandwidth', 'amdsmi_dev_get_pci_id',
|
||||
'amdsmi_get_gpu_pci_bandwidth', 'amdsmi_get_gpu_pci_id',
|
||||
'amdsmi_dev_get_pci_replay_counter',
|
||||
'amdsmi_dev_get_pci_throughput', 'amdsmi_dev_get_perf_level',
|
||||
'amdsmi_dev_get_power_ave',
|
||||
|
||||
@@ -293,7 +293,7 @@ class Formatter:
|
||||
| """ + self.style.text(" 4 Get device drm render minor. Api: amdsmi_get_gpu_drm_render_minor <bdf>") + """ |
|
||||
| """ + 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(" 7 Get device pci id. Api: amdsmi_get_gpu_pci_id <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>") + """ |
|
||||
@@ -740,7 +740,7 @@ commands = {
|
||||
6: [smi_api.amdsmi_get_gpu_subsystem_name, {
|
||||
"device_identifier1": [None, True]
|
||||
}],
|
||||
7: [smi_api.amdsmi_dev_get_pci_id, {
|
||||
7: [smi_api.amdsmi_get_gpu_pci_id, {
|
||||
"device_identifier1": [None, True]
|
||||
}],
|
||||
8: [smi_api.amdsmi_get_gpu_pci_bandwidth, {
|
||||
|
||||
@@ -902,7 +902,7 @@ amdsmi_get_func_iter_value(amdsmi_func_id_iter_handle_t handle,
|
||||
{"rsmi_dev_subsystem_vendor_id_get", "amdsmi_get_gpu_asic_info"},
|
||||
{"rsmi_dev_unique_id_get", "amdsmi_get_gpu_board_info"},
|
||||
{"rsmi_dev_pci_bandwidth_get", "amdsmi_get_gpu_pci_bandwidth"},
|
||||
{"rsmi_dev_pci_id_get", "amdsmi_dev_get_pci_id"},
|
||||
{"rsmi_dev_pci_id_get", "amdsmi_get_gpu_pci_id"},
|
||||
{"rsmi_dev_pci_throughput_get", "amdsmi_dev_get_pci_throughput"},
|
||||
{"rsmi_dev_pci_replay_counter_get", " amdsmi_dev_get_pci_replay_counter"},
|
||||
{"rsmi_dev_pci_bandwidth_set", " amdsmi_dev_set_pci_bandwidth"},
|
||||
@@ -1385,7 +1385,7 @@ amdsmi_status_t amdsmi_get_gpu_drm_render_minor(
|
||||
minor);
|
||||
}
|
||||
|
||||
amdsmi_status_t amdsmi_dev_get_pci_id(
|
||||
amdsmi_status_t amdsmi_get_gpu_pci_id(
|
||||
amdsmi_processor_handle processor_handle, uint64_t *bdfid) {
|
||||
return rsmi_wrapper(rsmi_dev_pci_id_get, processor_handle,
|
||||
bdfid);
|
||||
|
||||
@@ -231,7 +231,7 @@ void TestIdInfoRead::Run(void) {
|
||||
ASSERT_EQ(err, AMDSMI_STATUS_INVAL);
|
||||
}
|
||||
|
||||
err = amdsmi_dev_get_pci_id(processor_handles_[i], &val_ui64);
|
||||
err = amdsmi_get_gpu_pci_id(processor_handles_[i], &val_ui64);
|
||||
// Don't check for AMDSMI_STATUS_NOT_SUPPORTED since this should always be
|
||||
// supported. It is not based on a sysfs file.
|
||||
CHK_ERR_ASRT(err)
|
||||
@@ -240,7 +240,7 @@ void TestIdInfoRead::Run(void) {
|
||||
std::cout << " (" << std::dec << val_ui64 << ")" << std::endl;
|
||||
}
|
||||
// Verify api support checking functionality is working
|
||||
err = amdsmi_dev_get_pci_id(processor_handles_[i], nullptr);
|
||||
err = amdsmi_get_gpu_pci_id(processor_handles_[i], nullptr);
|
||||
ASSERT_EQ(err, AMDSMI_STATUS_INVAL);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -215,7 +215,7 @@ void TestMutualExclusion::Run(void) {
|
||||
CHECK_RET(ret, AMDSMI_STATUS_BUSY);
|
||||
ret = amdsmi_get_gpu_subsystem_id(processor_handles_[0], &dmy_ui16);
|
||||
CHECK_RET(ret, AMDSMI_STATUS_BUSY);
|
||||
ret = amdsmi_dev_get_pci_id(processor_handles_[0], &dmy_ui64);
|
||||
ret = amdsmi_get_gpu_pci_id(processor_handles_[0], &dmy_ui64);
|
||||
CHECK_RET(ret, AMDSMI_STATUS_BUSY);
|
||||
ret = amdsmi_dev_get_pci_throughput(processor_handles_[0], &dmy_ui64, &dmy_ui64, &dmy_ui64);
|
||||
CHECK_RET(ret, AMDSMI_STATUS_BUSY);
|
||||
|
||||
@@ -128,14 +128,14 @@ void TestSysInfoRead::Run(void) {
|
||||
}
|
||||
}
|
||||
|
||||
err = amdsmi_dev_get_pci_id(processor_handles_[i], &val_ui64);
|
||||
err = amdsmi_get_gpu_pci_id(processor_handles_[i], &val_ui64);
|
||||
CHK_ERR_ASRT(err)
|
||||
IF_VERB(STANDARD) {
|
||||
std::cout << "\t**PCI ID (BDFID): 0x" << std::hex << val_ui64;
|
||||
std::cout << " (" << std::dec << val_ui64 << ")" << std::endl;
|
||||
}
|
||||
// Verify api support checking functionality is working
|
||||
err = amdsmi_dev_get_pci_id(processor_handles_[i], nullptr);
|
||||
err = amdsmi_get_gpu_pci_id(processor_handles_[i], nullptr);
|
||||
ASSERT_EQ(err, AMDSMI_STATUS_INVAL);
|
||||
|
||||
err = amdsmi_topo_get_numa_affinity(processor_handles_[i], &val_ui32);
|
||||
|
||||
Reference in New Issue
Block a user