Renamed API amdsmi_dev_get_id to amdsmi_get_gpu_id
grep -rli 'amdsmi_dev_get_id' * | xargs -i@ sed -i
's/amdsmi_dev_get_id/amdsmi_get_gpu_id/g' @
Change-Id: I78faeff9a94250454bcecfaa50b5c7cc7e04cb98
[ROCm/amdsmi commit: 20222f771e]
This commit is contained in:
committed by
Naveen Krishna Chatradhi
parent
cb1d3ef3ce
commit
365abf6b0e
@@ -1317,7 +1317,7 @@ amdsmi_status_t amdsmi_get_processor_handle_from_bdf(amdsmi_bdf_t bdf, amdsmi_pr
|
|||||||
*
|
*
|
||||||
* @return ::amdsmi_status_t | ::AMDSMI_STATUS_SUCCESS on success, non-zero on fail
|
* @return ::amdsmi_status_t | ::AMDSMI_STATUS_SUCCESS on success, non-zero on fail
|
||||||
*/
|
*/
|
||||||
amdsmi_status_t amdsmi_dev_get_id(amdsmi_processor_handle processor_handle, uint16_t *id);
|
amdsmi_status_t amdsmi_get_gpu_id(amdsmi_processor_handle processor_handle, uint16_t *id);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief Get the name string for a give vendor ID
|
* @brief Get the name string for a give vendor ID
|
||||||
|
|||||||
@@ -2902,7 +2902,7 @@ except AmdSmiException as e:
|
|||||||
print(e)
|
print(e)
|
||||||
```
|
```
|
||||||
|
|
||||||
## amdsmi_dev_get_id
|
## amdsmi_get_gpu_id
|
||||||
Description: Get the device id associated with the device with provided device handler
|
Description: Get the device id associated with the device with provided device handler
|
||||||
|
|
||||||
Input parameters:
|
Input parameters:
|
||||||
@@ -2911,7 +2911,7 @@ Input parameters:
|
|||||||
|
|
||||||
Output: device id
|
Output: device id
|
||||||
|
|
||||||
Exceptions that can be thrown by `amdsmi_dev_get_id` function:
|
Exceptions that can be thrown by `amdsmi_get_gpu_id` function:
|
||||||
* `AmdSmiLibraryException`
|
* `AmdSmiLibraryException`
|
||||||
* `AmdSmiRetryException`
|
* `AmdSmiRetryException`
|
||||||
* `AmdSmiParameterException`
|
* `AmdSmiParameterException`
|
||||||
@@ -2924,7 +2924,7 @@ try:
|
|||||||
print("No GPUs on machine")
|
print("No GPUs on machine")
|
||||||
else:
|
else:
|
||||||
for device in devices:
|
for device in devices:
|
||||||
dev_id = amdsmi_dev_get_id(device)
|
dev_id = amdsmi_get_gpu_id(device)
|
||||||
print(dev_id)
|
print(dev_id)
|
||||||
except AmdSmiException as e:
|
except AmdSmiException as e:
|
||||||
print(e)
|
print(e)
|
||||||
|
|||||||
@@ -158,7 +158,7 @@ from .amdsmi_interface import AmdSmiEventReader
|
|||||||
|
|
||||||
# # Device Identification information
|
# # Device Identification information
|
||||||
from .amdsmi_interface import amdsmi_dev_get_vendor_name
|
from .amdsmi_interface import amdsmi_dev_get_vendor_name
|
||||||
from .amdsmi_interface import amdsmi_dev_get_id
|
from .amdsmi_interface import amdsmi_get_gpu_id
|
||||||
from .amdsmi_interface import amdsmi_dev_get_vram_vendor
|
from .amdsmi_interface import amdsmi_dev_get_vram_vendor
|
||||||
from .amdsmi_interface import amdsmi_dev_get_drm_render_minor
|
from .amdsmi_interface import amdsmi_dev_get_drm_render_minor
|
||||||
from .amdsmi_interface import amdsmi_dev_get_subsystem_id
|
from .amdsmi_interface import amdsmi_dev_get_subsystem_id
|
||||||
|
|||||||
@@ -1089,14 +1089,14 @@ def amdsmi_dev_get_vendor_name(
|
|||||||
return vendor_name.value.decode("utf-8")
|
return vendor_name.value.decode("utf-8")
|
||||||
|
|
||||||
|
|
||||||
def amdsmi_dev_get_id(processor_handle: amdsmi_wrapper.amdsmi_processor_handle):
|
def amdsmi_get_gpu_id(processor_handle: amdsmi_wrapper.amdsmi_processor_handle):
|
||||||
if not isinstance(processor_handle, amdsmi_wrapper.amdsmi_processor_handle):
|
if not isinstance(processor_handle, amdsmi_wrapper.amdsmi_processor_handle):
|
||||||
raise AmdSmiParameterException(
|
raise AmdSmiParameterException(
|
||||||
processor_handle, amdsmi_wrapper.amdsmi_processor_handle
|
processor_handle, amdsmi_wrapper.amdsmi_processor_handle
|
||||||
)
|
)
|
||||||
id = ctypes.c_uint16()
|
id = ctypes.c_uint16()
|
||||||
|
|
||||||
_check_res(amdsmi_wrapper.amdsmi_dev_get_id(
|
_check_res(amdsmi_wrapper.amdsmi_get_gpu_id(
|
||||||
processor_handle, ctypes.byref(id)))
|
processor_handle, ctypes.byref(id)))
|
||||||
|
|
||||||
return id.value
|
return id.value
|
||||||
|
|||||||
@@ -1420,9 +1420,9 @@ amdsmi_get_processor_type.argtypes = [amdsmi_processor_handle, ctypes.POINTER(c_
|
|||||||
amdsmi_get_processor_handle_from_bdf = _libraries['libamd_smi.so'].amdsmi_get_processor_handle_from_bdf
|
amdsmi_get_processor_handle_from_bdf = _libraries['libamd_smi.so'].amdsmi_get_processor_handle_from_bdf
|
||||||
amdsmi_get_processor_handle_from_bdf.restype = amdsmi_status_t
|
amdsmi_get_processor_handle_from_bdf.restype = amdsmi_status_t
|
||||||
amdsmi_get_processor_handle_from_bdf.argtypes = [amdsmi_bdf_t, ctypes.POINTER(ctypes.POINTER(None))]
|
amdsmi_get_processor_handle_from_bdf.argtypes = [amdsmi_bdf_t, ctypes.POINTER(ctypes.POINTER(None))]
|
||||||
amdsmi_dev_get_id = _libraries['libamd_smi.so'].amdsmi_dev_get_id
|
amdsmi_get_gpu_id = _libraries['libamd_smi.so'].amdsmi_get_gpu_id
|
||||||
amdsmi_dev_get_id.restype = amdsmi_status_t
|
amdsmi_get_gpu_id.restype = amdsmi_status_t
|
||||||
amdsmi_dev_get_id.argtypes = [amdsmi_processor_handle, ctypes.POINTER(ctypes.c_uint16)]
|
amdsmi_get_gpu_id.argtypes = [amdsmi_processor_handle, ctypes.POINTER(ctypes.c_uint16)]
|
||||||
amdsmi_dev_get_vendor_name = _libraries['libamd_smi.so'].amdsmi_dev_get_vendor_name
|
amdsmi_dev_get_vendor_name = _libraries['libamd_smi.so'].amdsmi_dev_get_vendor_name
|
||||||
amdsmi_dev_get_vendor_name.restype = amdsmi_status_t
|
amdsmi_dev_get_vendor_name.restype = amdsmi_status_t
|
||||||
amdsmi_dev_get_vendor_name.argtypes = [amdsmi_processor_handle, ctypes.POINTER(ctypes.c_char), size_t]
|
amdsmi_dev_get_vendor_name.argtypes = [amdsmi_processor_handle, ctypes.POINTER(ctypes.c_char), size_t]
|
||||||
@@ -1857,7 +1857,7 @@ __all__ = \
|
|||||||
'amdsmi_dev_get_energy_count', 'amdsmi_dev_get_fan_rpms',
|
'amdsmi_dev_get_energy_count', 'amdsmi_dev_get_fan_rpms',
|
||||||
'amdsmi_dev_get_fan_speed', 'amdsmi_dev_get_fan_speed_max',
|
'amdsmi_dev_get_fan_speed', 'amdsmi_dev_get_fan_speed_max',
|
||||||
'amdsmi_dev_get_gpu_clk_freq', 'amdsmi_dev_get_gpu_metrics_info',
|
'amdsmi_dev_get_gpu_clk_freq', 'amdsmi_dev_get_gpu_metrics_info',
|
||||||
'amdsmi_dev_get_id', 'amdsmi_dev_get_memory_busy_percent',
|
'amdsmi_get_gpu_id', 'amdsmi_dev_get_memory_busy_percent',
|
||||||
'amdsmi_dev_get_memory_reserved_pages',
|
'amdsmi_dev_get_memory_reserved_pages',
|
||||||
'amdsmi_dev_get_memory_total', 'amdsmi_dev_get_memory_usage',
|
'amdsmi_dev_get_memory_total', 'amdsmi_dev_get_memory_usage',
|
||||||
'amdsmi_dev_get_od_volt_curve_regions',
|
'amdsmi_dev_get_od_volt_curve_regions',
|
||||||
|
|||||||
@@ -288,7 +288,7 @@ class Formatter:
|
|||||||
| """ + self.style.header("COMMANDS:") + """ |
|
| """ + self.style.header("COMMANDS:") + """ |
|
||||||
| |
|
| |
|
||||||
| """ + self.style.text(" 1 Get device vendor name. Api: amdsmi_dev_get_vendor_name <bdf>") + """ |
|
| """ + self.style.text(" 1 Get device vendor name. Api: amdsmi_dev_get_vendor_name <bdf>") + """ |
|
||||||
| """ + self.style.text(" 2 Get device id. Api: amdsmi_dev_get_id <bdf>") + """ |
|
| """ + self.style.text(" 2 Get device id. Api: amdsmi_get_gpu_id <bdf>") + """ |
|
||||||
| """ + self.style.text(" 3 Get device vram vendor. Api: amdsmi_dev_get_vram_vendor <bdf>") + """ |
|
| """ + self.style.text(" 3 Get device vram vendor. Api: amdsmi_dev_get_vram_vendor <bdf>") + """ |
|
||||||
| """ + self.style.text(" 4 Get device drm render minor. Api: amdsmi_dev_get_drm_render_minor <bdf>") + """ |
|
| """ + self.style.text(" 4 Get device drm render minor. Api: amdsmi_dev_get_drm_render_minor <bdf>") + """ |
|
||||||
| """ + self.style.text(" 5 Get device subsystem id. Api: amdsmi_dev_get_subsystem_id <bdf>") + """ |
|
| """ + self.style.text(" 5 Get device subsystem id. Api: amdsmi_dev_get_subsystem_id <bdf>") + """ |
|
||||||
@@ -725,7 +725,7 @@ commands = {
|
|||||||
1: [smi_api.amdsmi_dev_get_vendor_name, {
|
1: [smi_api.amdsmi_dev_get_vendor_name, {
|
||||||
"device_identifier1": [None, True]
|
"device_identifier1": [None, True]
|
||||||
}],
|
}],
|
||||||
2: [smi_api.amdsmi_dev_get_id, {
|
2: [smi_api.amdsmi_get_gpu_id, {
|
||||||
"device_identifier1": [None, True]
|
"device_identifier1": [None, True]
|
||||||
}],
|
}],
|
||||||
3: [smi_api.amdsmi_dev_get_vram_vendor, {
|
3: [smi_api.amdsmi_dev_get_vram_vendor, {
|
||||||
|
|||||||
@@ -507,7 +507,7 @@ amdsmi_status_t amdsmi_dev_set_fan_speed(amdsmi_processor_handle processor_handl
|
|||||||
sensor_ind, speed);
|
sensor_ind, speed);
|
||||||
}
|
}
|
||||||
|
|
||||||
amdsmi_status_t amdsmi_dev_get_id(amdsmi_processor_handle processor_handle,
|
amdsmi_status_t amdsmi_get_gpu_id(amdsmi_processor_handle processor_handle,
|
||||||
uint16_t *id) {
|
uint16_t *id) {
|
||||||
return rsmi_wrapper(rsmi_dev_id_get, processor_handle, id);
|
return rsmi_wrapper(rsmi_dev_id_get, processor_handle, id);
|
||||||
}
|
}
|
||||||
@@ -889,7 +889,7 @@ amdsmi_get_func_iter_value(amdsmi_func_id_iter_handle_t handle,
|
|||||||
|
|
||||||
static const std::map<std::string, const char*> rsmi_2_amdsmi = {
|
static const std::map<std::string, const char*> rsmi_2_amdsmi = {
|
||||||
{"rsmi_dev_vram_vendor_get", "amdsmi_dev_get_vram_vendor"},
|
{"rsmi_dev_vram_vendor_get", "amdsmi_dev_get_vram_vendor"},
|
||||||
{"rsmi_dev_id_get", "amdsmi_dev_get_id"},
|
{"rsmi_dev_id_get", "amdsmi_get_gpu_id"},
|
||||||
{"rsmi_dev_vendor_id_get", "amdsmi_get_asic_info"},
|
{"rsmi_dev_vendor_id_get", "amdsmi_get_asic_info"},
|
||||||
{"rsmi_dev_name_get", "amdsmi_get_board_info"},
|
{"rsmi_dev_name_get", "amdsmi_get_board_info"},
|
||||||
{"rsmi_dev_sku_get", "amdsmi_get_board_info"},
|
{"rsmi_dev_sku_get", "amdsmi_get_board_info"},
|
||||||
|
|||||||
@@ -105,11 +105,11 @@ void TestIdInfoRead::Run(void) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Get the device ID, name, vendor ID and vendor name for the device
|
// Get the device ID, name, vendor ID and vendor name for the device
|
||||||
err = amdsmi_dev_get_id(processor_handles_[i], &id);
|
err = amdsmi_get_gpu_id(processor_handles_[i], &id);
|
||||||
if (err == AMDSMI_STATUS_NOT_SUPPORTED) {
|
if (err == AMDSMI_STATUS_NOT_SUPPORTED) {
|
||||||
amdsmi_status_t ret;
|
amdsmi_status_t ret;
|
||||||
// Verify api support checking functionality is working
|
// Verify api support checking functionality is working
|
||||||
ret = amdsmi_dev_get_id(processor_handles_[i], nullptr);
|
ret = amdsmi_get_gpu_id(processor_handles_[i], nullptr);
|
||||||
ASSERT_EQ(ret, AMDSMI_STATUS_NOT_SUPPORTED);
|
ASSERT_EQ(ret, AMDSMI_STATUS_NOT_SUPPORTED);
|
||||||
} else {
|
} else {
|
||||||
CHK_ERR_ASRT(err)
|
CHK_ERR_ASRT(err)
|
||||||
@@ -118,7 +118,7 @@ void TestIdInfoRead::Run(void) {
|
|||||||
std::cout << "\t**Device ID: 0x" << std::hex << id << std::endl;
|
std::cout << "\t**Device ID: 0x" << std::hex << id << std::endl;
|
||||||
}
|
}
|
||||||
// Verify api support checking functionality is working
|
// Verify api support checking functionality is working
|
||||||
err = amdsmi_dev_get_id(processor_handles_[i], nullptr);
|
err = amdsmi_get_gpu_id(processor_handles_[i], nullptr);
|
||||||
ASSERT_EQ(err, AMDSMI_STATUS_INVAL);
|
ASSERT_EQ(err, AMDSMI_STATUS_INVAL);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -197,7 +197,7 @@ void TestMutualExclusion::Run(void) {
|
|||||||
std::cout << "at " << __FILE__ << ":" << __LINE__ << std::endl; \
|
std::cout << "at " << __FILE__ << ":" << __LINE__ << std::endl; \
|
||||||
} \
|
} \
|
||||||
}
|
}
|
||||||
ret = amdsmi_dev_get_id(processor_handles_[0], &dmy_ui16);
|
ret = amdsmi_get_gpu_id(processor_handles_[0], &dmy_ui16);
|
||||||
|
|
||||||
// vendor_id, unique_id
|
// vendor_id, unique_id
|
||||||
amdsmi_asic_info_t asci_info;
|
amdsmi_asic_info_t asci_info;
|
||||||
|
|||||||
@@ -167,7 +167,7 @@ void TestBase::PrintDeviceHeader(amdsmi_processor_handle dv_ind) {
|
|||||||
IF_VERB(STANDARD) {
|
IF_VERB(STANDARD) {
|
||||||
std::cout << "\t**Device handle: " << dv_ind << std::endl;
|
std::cout << "\t**Device handle: " << dv_ind << std::endl;
|
||||||
}
|
}
|
||||||
err = amdsmi_dev_get_id(dv_ind, &val_ui16);
|
err = amdsmi_get_gpu_id(dv_ind, &val_ui16);
|
||||||
CHK_ERR_ASRT(err)
|
CHK_ERR_ASRT(err)
|
||||||
IF_VERB(STANDARD) {
|
IF_VERB(STANDARD) {
|
||||||
std::cout << "\t**Device ID: 0x" << std::hex << val_ui16 << std::endl;
|
std::cout << "\t**Device ID: 0x" << std::hex << val_ui16 << std::endl;
|
||||||
|
|||||||
Reference in New Issue
Block a user