From 3f9e4d95d45e50fe99b6566d9f3ffe0ef15f92c1 Mon Sep 17 00:00:00 2001 From: Suma Hegde Date: Sat, 25 Feb 2023 05:28:40 -0500 Subject: [PATCH] Change device_handle to processor_handle grep -rli 'device_handle' * | xargs -i@ sed -i 's/device_handle/processor_handle/g' @ Change-Id: Ifc8b7fa3b5488ce1fa8d8cf9eb3981a09450de11 --- README.md | 16 +- example/amd_smi_drm_example.cc | 68 +- example/amd_smi_nodrm_example.cc | 38 +- include/amd_smi/amdsmi.h | 560 ++++++------- include/amd_smi/impl/amd_smi_system.h | 4 +- py-interface/README.md | 380 ++++----- py-interface/__init__.py | 4 +- py-interface/amdsmi_interface.py | 750 +++++++++--------- py-interface/amdsmi_wrapper.py | 16 +- py-interface/rocm_smi_tool.py | 58 +- src/amd_smi/amd_smi.cc | 436 +++++----- src/amd_smi/amd_smi_system.cc | 12 +- .../functional/api_support_read.cc | 4 +- tests/amd_smi_test/functional/err_cnt_read.cc | 18 +- .../functional/evt_notif_read_write.cc | 10 +- tests/amd_smi_test/functional/fan_read.cc | 14 +- .../amd_smi_test/functional/fan_read_write.cc | 14 +- .../functional/frequencies_read.cc | 14 +- .../functional/frequencies_read_write.cc | 12 +- .../amd_smi_test/functional/gpu_busy_read.cc | 4 +- .../functional/gpu_metrics_read.cc | 6 +- .../functional/hw_topology_read.cc | 14 +- tests/amd_smi_test/functional/id_info_read.cc | 48 +- .../functional/mem_page_info_read.cc | 10 +- .../amd_smi_test/functional/mem_util_read.cc | 6 +- .../functional/metrics_counter_read.cc | 10 +- .../functional/mutual_exclusion.cc | 52 +- .../amd_smi_test/functional/overdrive_read.cc | 6 +- .../functional/overdrive_read_write.cc | 12 +- .../amd_smi_test/functional/pci_read_write.cc | 24 +- .../functional/perf_cntr_read_write.cc | 2 +- .../functional/perf_determinism.cc | 12 +- .../functional/perf_level_read.cc | 6 +- .../functional/perf_level_read_write.cc | 12 +- .../functional/power_cap_read_write.cc | 14 +- tests/amd_smi_test/functional/power_read.cc | 8 +- .../functional/power_read_write.cc | 18 +- .../amd_smi_test/functional/sys_info_read.cc | 26 +- tests/amd_smi_test/functional/temp_read.cc | 8 +- .../functional/volt_freq_curv_read.cc | 10 +- tests/amd_smi_test/functional/volt_read.cc | 8 +- .../functional/xgmi_read_write.cc | 2 +- tests/amd_smi_test/test_base.cc | 10 +- tests/amd_smi_test/test_base.h | 2 +- 44 files changed, 1381 insertions(+), 1377 deletions(-) diff --git a/README.md b/README.md index 8e7dad3d24..64bbab66aa 100755 --- a/README.md +++ b/README.md @@ -76,7 +76,7 @@ Many of the functions in the library take a "socket handle" or "device handle". GPU device and CPU device on the same socket. Moreover, for MI200, it may have multiple GCDs. To discover the sockets in the system, `amdsmi_get_socket_handles()` is called to get list of sockets -handles, which in turn can be used to query the devices in that socket using `amdsmi_get_device_handles()`. The device handler is used to distinguish the detected devices from one another. It is important to note that a device may end up with a different device handles after restart application, so a device handle should not be relied upon to be constant over process. +handles, which in turn can be used to query the devices in that socket using `amdsmi_get_processor_handles()`. The device handler is used to distinguish the detected devices from one another. It is important to note that a device may end up with a different device handles after restart application, so a device handle should not be relied upon to be constant over process. ## Hello AMD SMI @@ -116,20 +116,20 @@ int main() { // Get the device count for the socket. uint32_t device_count = 0; - ret = amdsmi_get_device_handles(sockets[i], &device_count, nullptr); + ret = amdsmi_get_processor_handles(sockets[i], &device_count, nullptr); // Allocate the memory for the device handlers on the socket - std::vector device_handles(device_count); + std::vector processor_handles(device_count); // Get all devices of the socket - ret = amdsmi_get_device_handles(sockets[i], - &device_count, &device_handles[0]); + ret = amdsmi_get_processor_handles(sockets[i], + &device_count, &processor_handles[0]); // For each device of the socket, get name and temperature. for (uint32_t j=0; j < device_count; j++) { // Get device type. Since the amdsmi is initialized with // AMD_SMI_INIT_AMD_GPUS, the device_type must be AMD_GPU. device_type_t device_type; - ret = amdsmi_get_device_type(device_handles[j], &device_type); + ret = amdsmi_get_device_type(processor_handles[j], &device_type); if (device_type != AMD_GPU) { std::cout << "Expect AMD_GPU device type!\n"; return 1; @@ -137,13 +137,13 @@ int main() { // Get device name amdsmi_board_info_t board_info; - ret = amdsmi_get_board_info(device_handles[j], &board_info); + ret = amdsmi_get_board_info(processor_handles[j], &board_info); std::cout << "\tdevice " << j <<"\n\t\tName:" << board_info.product_name << std::endl; // Get temperature int64_t val_i64 = 0; - ret = amdsmi_dev_get_temp_metric(device_handles[j], TEMPERATURE_TYPE_EDGE, + ret = amdsmi_dev_get_temp_metric(processor_handles[j], TEMPERATURE_TYPE_EDGE, AMDSMI_TEMP_CURRENT, &val_i64); std::cout << "\t\tTemperature: " << val_i64 << "C" << std::endl; } diff --git a/example/amd_smi_drm_example.cc b/example/amd_smi_drm_example.cc index 69d8945d8e..b70e16cf75 100644 --- a/example/amd_smi_drm_example.cc +++ b/example/amd_smi_drm_example.cc @@ -244,14 +244,14 @@ int main() { // Get the device count available for the socket. uint32_t device_count = 0; - ret = amdsmi_get_device_handles(sockets[i], &device_count, nullptr); + ret = amdsmi_get_processor_handles(sockets[i], &device_count, nullptr); CHK_AMDSMI_RET(ret) // Allocate the memory for the device handlers on the socket - std::vector device_handles(device_count); + std::vector processor_handles(device_count); // Get all devices of the socket - ret = amdsmi_get_device_handles(sockets[i], - &device_count, &device_handles[0]); + ret = amdsmi_get_processor_handles(sockets[i], + &device_count, &processor_handles[0]); CHK_AMDSMI_RET(ret) // For each device of the socket, get name and temperature. @@ -259,7 +259,7 @@ int main() { // Get device type. Since the amdsmi is initialized with // AMD_SMI_INIT_AMD_GPUS, the device_type must be AMD_GPU. device_type_t device_type = {}; - ret = amdsmi_get_device_type(device_handles[j], &device_type); + ret = amdsmi_get_device_type(processor_handles[j], &device_type); CHK_AMDSMI_RET(ret) if (device_type != AMD_GPU) { std::cout << "Expect AMD_GPU device type!\n"; @@ -268,7 +268,7 @@ int main() { // Get BDF info amdsmi_bdf_t bdf = {}; - ret = amdsmi_get_device_bdf(device_handles[j], &bdf); + ret = amdsmi_get_device_bdf(processor_handles[j], &bdf); CHK_AMDSMI_RET(ret) printf(" Output of amdsmi_get_device_bdf:\n"); printf("\tDevice[%d] BDF %04lx:%02x:%02x.%d\n\n", i, @@ -277,12 +277,12 @@ int main() { // Get handle from BDF amdsmi_processor_handle dev_handle; - ret = amdsmi_get_device_handle_from_bdf(bdf, &dev_handle); + ret = amdsmi_get_processor_handle_from_bdf(bdf, &dev_handle); CHK_AMDSMI_RET(ret) // Get ASIC info amdsmi_asic_info_t asic_info = {}; - ret = amdsmi_get_asic_info(device_handles[j], &asic_info); + ret = amdsmi_get_asic_info(processor_handles[j], &asic_info); CHK_AMDSMI_RET(ret) printf(" Output of amdsmi_get_asic_info:\n"); printf("\tMarket Name: %s\n", asic_info.market_name); @@ -294,7 +294,7 @@ int main() { // Get VBIOS info amdsmi_vbios_info_t vbios_info = {}; - ret = amdsmi_get_vbios_info(device_handles[j], &vbios_info); + ret = amdsmi_get_vbios_info(processor_handles[j], &vbios_info); CHK_AMDSMI_RET(ret) printf(" Output of amdsmi_get_vbios_info:\n"); printf("\tVBios Name: %s\n", vbios_info.name); @@ -306,7 +306,7 @@ int main() { // Get power measure amdsmi_power_measure_t power_measure = {}; - ret = amdsmi_get_power_measure(device_handles[j], &power_measure); + ret = amdsmi_get_power_measure(processor_handles[j], &power_measure); CHK_AMDSMI_RET(ret) printf(" Output of amdsmi_get_power_measure:\n"); printf("\tCurrent GFX Voltage: %d\n", @@ -320,7 +320,7 @@ int main() { // Get driver version char version[AMDSMI_MAX_DRIVER_VERSION_LENGTH]; int version_length = AMDSMI_MAX_DRIVER_VERSION_LENGTH; - ret = amdsmi_get_driver_version(device_handles[j], &version_length, version); + ret = amdsmi_get_driver_version(processor_handles[j], &version_length, version); CHK_AMDSMI_RET(ret) printf(" Output of amdsmi_get_driver_version:\n"); printf("\tDriver version: %s\n\n", version); @@ -328,14 +328,14 @@ int main() { // Get device uuid unsigned int uuid_length = AMDSMI_GPU_UUID_SIZE; char uuid[AMDSMI_GPU_UUID_SIZE]; - ret = amdsmi_get_device_uuid(device_handles[j], &uuid_length, uuid); + ret = amdsmi_get_device_uuid(processor_handles[j], &uuid_length, uuid); CHK_AMDSMI_RET(ret) printf(" Output of amdsmi_get_device_uuid:\n"); printf("\tDevice uuid: %s\n\n", uuid); // Get engine usage info amdsmi_engine_usage_t engine_usage = {}; - ret = amdsmi_get_gpu_activity(device_handles[j], &engine_usage); + ret = amdsmi_get_gpu_activity(processor_handles[j], &engine_usage); CHK_AMDSMI_RET(ret) printf(" Output of amdsmi_get_gpu_activity:\n"); printf("\tAverage GFX Activity: %d\n", @@ -348,7 +348,7 @@ int main() { // Get firmware info amdsmi_fw_info_t fw_information = {}; char ucode_name[AMDSMI_MAX_STRING_LENGTH]; - ret = amdsmi_get_fw_info(device_handles[j], &fw_information); + ret = amdsmi_get_fw_info(processor_handles[j], &fw_information); CHK_AMDSMI_RET(ret) printf(" Output of amdsmi_get_fw_info:\n"); printf("Number of Microcodes: %d\n", fw_information.num_fw_info); @@ -359,7 +359,7 @@ int main() { // Get GFX clock measurements amdsmi_clk_measure_t gfx_clk_values = {}; - ret = amdsmi_get_clock_measure(device_handles[j], CLK_TYPE_GFX, + ret = amdsmi_get_clock_measure(processor_handles[j], CLK_TYPE_GFX, &gfx_clk_values); CHK_AMDSMI_RET(ret) printf(" Output of amdsmi_get_clock_measure:\n"); @@ -369,7 +369,7 @@ int main() { // Get MEM clock measurements amdsmi_clk_measure_t mem_clk_values = {}; - ret = amdsmi_get_clock_measure(device_handles[j], CLK_TYPE_MEM, + ret = amdsmi_get_clock_measure(processor_handles[j], CLK_TYPE_MEM, &mem_clk_values); CHK_AMDSMI_RET(ret) printf("\tGPU MEM Max Clock: %d\n", mem_clk_values.max_clk); @@ -378,7 +378,7 @@ int main() { // Get PCIe status amdsmi_pcie_info_t pcie_info = {}; - ret = amdsmi_get_pcie_link_status(device_handles[j], &pcie_info); + ret = amdsmi_get_pcie_link_status(processor_handles[j], &pcie_info); CHK_AMDSMI_RET(ret) printf(" Output of amdsmi_get_pcie_link_status:\n"); printf("\tPCIe lanes: %d\n", pcie_info.pcie_lanes); @@ -386,7 +386,7 @@ int main() { // Get PCIe caps amdsmi_pcie_info_t pcie_caps_info = {}; - ret = amdsmi_get_pcie_link_caps(device_handles[j], &pcie_caps_info); + ret = amdsmi_get_pcie_link_caps(processor_handles[j], &pcie_caps_info); CHK_AMDSMI_RET(ret) printf(" Output of amdsmi_get_pcie_link_caps:\n"); printf("\tPCIe max lanes: %d\n", pcie_caps_info.pcie_lanes); @@ -395,7 +395,7 @@ int main() { // Get VRAM temperature limit int64_t temperature = 0; ret = amdsmi_dev_get_temp_metric( - device_handles[j], TEMPERATURE_TYPE_VRAM, + processor_handles[j], TEMPERATURE_TYPE_VRAM, AMDSMI_TEMP_CRITICAL, &temperature); CHK_AMDSMI_RET(ret) printf(" Output of amdsmi_dev_get_temp_metric:\n"); @@ -403,7 +403,7 @@ int main() { // Get GFX temperature limit ret = amdsmi_dev_get_temp_metric( - device_handles[j], TEMPERATURE_TYPE_EDGE, + processor_handles[j], TEMPERATURE_TYPE_EDGE, AMDSMI_TEMP_CRITICAL, &temperature); CHK_AMDSMI_RET(ret) printf("\tGPU GFX temp limit: %ld\n\n", temperature); @@ -417,7 +417,7 @@ int main() { TEMPERATURE_TYPE_VRAM, TEMPERATURE_TYPE_PLX}; for (const auto &temp_type : temp_types) { ret = amdsmi_dev_get_temp_metric( - device_handles[j], temp_type, + processor_handles[j], temp_type, AMDSMI_TEMP_CURRENT, &temp_measurements[(int)(temp_type)]); CHK_AMDSMI_RET(ret) @@ -446,7 +446,7 @@ int main() { for (auto block = AMDSMI_GPU_BLOCK_FIRST; block <= AMDSMI_GPU_BLOCK_LAST; block = (amdsmi_gpu_block_t)(block * 2)) { - ret = amdsmi_get_ras_block_features_enabled(device_handles[j], block, + ret = amdsmi_get_ras_block_features_enabled(processor_handles[j], block, &state); CHK_AMDSMI_RET(ret) printf("\tBlock: %s\n", block_names[index]); @@ -459,7 +459,7 @@ int main() { char bad_page_status_names[3][15] = {"RESERVED", "PENDING", "UNRESERVABLE"}; uint32_t num_pages = 0; - ret = amdsmi_get_bad_page_info(device_handles[j], &num_pages, + ret = amdsmi_get_bad_page_info(processor_handles[j], &num_pages, nullptr); CHK_AMDSMI_RET(ret) printf(" Output of amdsmi_get_bad_page_info:\n"); @@ -467,7 +467,7 @@ int main() { printf("\tNo bad pages found.\n"); } else { std::vector bad_page_info(num_pages); - ret = amdsmi_get_bad_page_info(device_handles[j], &num_pages, + ret = amdsmi_get_bad_page_info(processor_handles[j], &num_pages, bad_page_info.data()); CHK_AMDSMI_RET(ret) for (uint32_t page_it = 0; page_it < num_pages; page_it += 1) { @@ -484,7 +484,7 @@ int main() { // Get ECC error counts amdsmi_error_count_t err_cnt_info = {}; - ret = amdsmi_get_ecc_error_count(device_handles[j], &err_cnt_info); + ret = amdsmi_get_ecc_error_count(processor_handles[j], &err_cnt_info); CHK_AMDSMI_RET(ret) printf(" Output of amdsmi_get_ecc_error_count:\n"); printf("\tCorrectable errors: %lu\n", err_cnt_info.correctable_count); @@ -501,7 +501,7 @@ int main() { // Get frequency ranges amdsmi_frequency_range_t freq_ranges = {}; ret = amdsmi_get_target_frequency_range( - device_handles[j], CLK_TYPE_GFX, &freq_ranges); + processor_handles[j], CLK_TYPE_GFX, &freq_ranges); CHK_AMDSMI_RET(ret) printf(" Output of amdsmi_get_target_frequency_range:\n"); printf("\tSupported min freq: %lu\n", @@ -514,7 +514,7 @@ int main() { freq_ranges.current_freq_range.upper_bound); uint32_t num_process = 0; - ret = amdsmi_get_process_list(device_handles[j], nullptr, + ret = amdsmi_get_process_list(processor_handles[j], nullptr, &num_process); CHK_AMDSMI_RET(ret) if (!num_process) { @@ -529,14 +529,14 @@ int main() { sprintf(bdf_str, "%04lx:%02x:%02x.%d", bdf.domain_number, bdf.bus_number, bdf.device_number, bdf.function_number); int num = 0; - ret = amdsmi_get_process_list(device_handles[j], process_list, + ret = amdsmi_get_process_list(processor_handles[j], process_list, &num_process); CHK_AMDSMI_RET(ret) for (uint32_t it = 0; it < num_process; it += 1) { if (getpid() == process_list[it]) { continue; } - ret = amdsmi_get_process_info(device_handles[j], + ret = amdsmi_get_process_info(processor_handles[j], process_list[it], &process); if (ret != AMDSMI_STATUS_SUCCESS) { printf("amdsmi_get_process_info() failed for " @@ -623,7 +623,7 @@ int main() { // Get device name amdsmi_board_info_t board_info = {}; - ret = amdsmi_get_board_info(device_handles[j], &board_info); + ret = amdsmi_get_board_info(processor_handles[j], &board_info); CHK_AMDSMI_RET(ret) printf(" Output of amdsmi_get_board_info:\n"); std::cout << "\tdevice [" << j @@ -636,7 +636,7 @@ int main() { // Get temperature int64_t val_i64 = 0; - ret = amdsmi_dev_get_temp_metric(device_handles[j], TEMPERATURE_TYPE_EDGE, + ret = amdsmi_dev_get_temp_metric(processor_handles[j], TEMPERATURE_TYPE_EDGE, AMDSMI_TEMP_CURRENT, &val_i64); CHK_AMDSMI_RET(ret) printf(" Output of amdsmi_dev_get_temp_metric:\n"); @@ -645,7 +645,7 @@ int main() { // Get frame buffer amdsmi_vram_info_t vram_usage = {}; - ret = amdsmi_get_vram_usage(device_handles[j], &vram_usage); + ret = amdsmi_get_vram_usage(processor_handles[j], &vram_usage); CHK_AMDSMI_RET(ret) printf(" Output of amdsmi_get_vram_usage:\n"); std::cout << "\t\tFrame buffer usage (MB): " << vram_usage.vram_used @@ -653,7 +653,7 @@ int main() { // Get Cap info amdsmi_gpu_caps_t caps_info = {}; - ret = amdsmi_get_caps_info(device_handles[j], &caps_info); + ret = amdsmi_get_caps_info(processor_handles[j], &caps_info); CHK_AMDSMI_RET(ret) printf(" Output of amdsmi_get_caps_info:\n"); std::cout << "\t\tGFX IP Major: " << caps_info.gfx.gfxip_major @@ -668,7 +668,7 @@ int main() { << "\n\n"; amdsmi_power_cap_info_t cap_info = {}; - ret = amdsmi_get_power_cap_info(device_handles[j], 0, &cap_info); + ret = amdsmi_get_power_cap_info(processor_handles[j], 0, &cap_info); CHK_AMDSMI_RET(ret) printf(" Output of amdsmi_get_power_cap_info:\n"); std::cout << "\t\t Power Cap: " << cap_info.power_cap diff --git a/example/amd_smi_nodrm_example.cc b/example/amd_smi_nodrm_example.cc index 950ff16e65..9a89699d51 100644 --- a/example/amd_smi_nodrm_example.cc +++ b/example/amd_smi_nodrm_example.cc @@ -96,14 +96,14 @@ int main() { // Get the device count available for the socket. uint32_t device_count = 0; - ret = amdsmi_get_device_handles(sockets[i], &device_count, nullptr); + ret = amdsmi_get_processor_handles(sockets[i], &device_count, nullptr); CHK_AMDSMI_RET(ret) // Allocate the memory for the device handlers on the socket - std::vector device_handles(device_count); + std::vector processor_handles(device_count); // Get all devices of the socket - ret = amdsmi_get_device_handles(sockets[i], - &device_count, &device_handles[0]); + ret = amdsmi_get_processor_handles(sockets[i], + &device_count, &processor_handles[0]); CHK_AMDSMI_RET(ret) // For each device of the socket, get name and temperature. @@ -111,7 +111,7 @@ int main() { // Get device type. Since the amdsmi is initialized with // AMD_SMI_INIT_AMD_GPUS, the device_type must be AMD_GPU. device_type_t device_type = {}; - ret = amdsmi_get_device_type(device_handles[j], &device_type); + ret = amdsmi_get_device_type(processor_handles[j], &device_type); CHK_AMDSMI_RET(ret) if (device_type != AMD_GPU) { std::cout << "Expect AMD_GPU device type!\n"; @@ -119,7 +119,7 @@ int main() { } amdsmi_bdf_t bdf = {}; - ret = amdsmi_get_device_bdf(device_handles[j], &bdf); + ret = amdsmi_get_device_bdf(processor_handles[j], &bdf); CHK_AMDSMI_RET(ret) printf(" Output of amdsmi_get_device_bdf:\n"); printf("\tDevice[%d] BDF %04lx:%02x:%02x.%d\n\n", i, @@ -127,7 +127,7 @@ int main() { bdf.function_number); amdsmi_asic_info_t asic_info = {}; - ret = amdsmi_get_asic_info(device_handles[j], &asic_info); + ret = amdsmi_get_asic_info(processor_handles[j], &asic_info); CHK_AMDSMI_RET(ret) printf(" Output of amdsmi_get_asic_info:\n"); printf("\tMarket Name: %s\n", asic_info.market_name); @@ -139,7 +139,7 @@ int main() { // Get VBIOS info amdsmi_vbios_info_t vbios_info = {}; - ret = amdsmi_get_vbios_info(device_handles[j], &vbios_info); + ret = amdsmi_get_vbios_info(processor_handles[j], &vbios_info); CHK_AMDSMI_RET(ret) printf(" Output of amdsmi_get_vbios_info:\n"); printf("\tVBios Name: %s\n", vbios_info.name); @@ -151,7 +151,7 @@ int main() { // Get engine usage info amdsmi_engine_usage_t engine_usage = {}; - ret = amdsmi_get_gpu_activity(device_handles[j], &engine_usage); + ret = amdsmi_get_gpu_activity(processor_handles[j], &engine_usage); CHK_AMDSMI_RET(ret) printf(" Output of amdsmi_get_gpu_activity:\n"); printf("\tAverage GFX Activity: %d\n", @@ -163,7 +163,7 @@ int main() { // Get firmware info amdsmi_fw_info_t fw_information = {}; - ret = amdsmi_get_fw_info(device_handles[j], &fw_information); + ret = amdsmi_get_fw_info(processor_handles[j], &fw_information); CHK_AMDSMI_RET(ret) printf(" Output of amdsmi_get_fw_info:\n"); printf("\tFirmware version: %d\n", fw_information.num_fw_info); @@ -227,7 +227,7 @@ int main() { TEMPERATURE_TYPE_VRAM, TEMPERATURE_TYPE_PLX}; for (const auto &temp_type : temp_types) { ret = amdsmi_dev_get_temp_metric( - device_handles[j], temp_type, + processor_handles[j], temp_type, AMDSMI_TEMP_CURRENT, &temp_measurements[(int)(temp_type)]); CHK_AMDSMI_RET(ret) @@ -246,7 +246,7 @@ int main() { char bad_page_status_names[3][15] = {"RESERVED", "PENDING", "UNRESERVABLE"}; uint32_t num_pages = 0; - ret = amdsmi_get_bad_page_info(device_handles[j], &num_pages, + ret = amdsmi_get_bad_page_info(processor_handles[j], &num_pages, nullptr); CHK_AMDSMI_RET(ret) printf(" Output of amdsmi_get_bad_page_info:\n"); @@ -254,7 +254,7 @@ int main() { printf("\tNo bad pages found.\n"); } else { std::vector bad_page_info(num_pages); - ret = amdsmi_get_bad_page_info(device_handles[j], &num_pages, + ret = amdsmi_get_bad_page_info(processor_handles[j], &num_pages, bad_page_info.data()); CHK_AMDSMI_RET(ret) for (uint32_t page_it = 0; page_it < num_pages; page_it += 1) { @@ -271,7 +271,7 @@ int main() { // Get ECC error counts amdsmi_error_count_t err_cnt_info = {}; - ret = amdsmi_get_ecc_error_count(device_handles[j], &err_cnt_info); + ret = amdsmi_get_ecc_error_count(processor_handles[j], &err_cnt_info); CHK_AMDSMI_RET(ret) printf(" Output of amdsmi_get_ecc_error_count:\n"); printf("\tCorrectable errors: %lu\n", err_cnt_info.correctable_count); @@ -287,7 +287,7 @@ int main() { // Get device name amdsmi_board_info_t board_info = {}; - ret = amdsmi_get_board_info(device_handles[j], &board_info); + ret = amdsmi_get_board_info(processor_handles[j], &board_info); CHK_AMDSMI_RET(ret) printf(" Output of amdsmi_get_board_info:\n"); std::cout << "\tdevice [" << j @@ -300,7 +300,7 @@ int main() { // Get temperature int64_t val_i64 = 0; - ret = amdsmi_dev_get_temp_metric(device_handles[j], TEMPERATURE_TYPE_EDGE, + ret = amdsmi_dev_get_temp_metric(processor_handles[j], TEMPERATURE_TYPE_EDGE, AMDSMI_TEMP_CURRENT, &val_i64); CHK_AMDSMI_RET(ret) printf(" Output of amdsmi_dev_get_temp_metric:\n"); @@ -309,7 +309,7 @@ int main() { // Get frame buffer amdsmi_vram_info_t vram_usage = {}; - ret = amdsmi_get_vram_usage(device_handles[j], &vram_usage); + ret = amdsmi_get_vram_usage(processor_handles[j], &vram_usage); CHK_AMDSMI_RET(ret) printf(" Output of amdsmi_get_vram_usage:\n"); std::cout << "\t\tFrame buffer usage (MB): " << vram_usage.vram_used @@ -317,7 +317,7 @@ int main() { // Get Cap info amdsmi_gpu_caps_t caps_info = {}; - ret = amdsmi_get_caps_info(device_handles[j], &caps_info); + ret = amdsmi_get_caps_info(processor_handles[j], &caps_info); CHK_AMDSMI_RET(ret) printf(" Output of amdsmi_get_caps_info:\n"); std::cout << "\t\tGFX IP Major: " << caps_info.gfx.gfxip_major @@ -332,7 +332,7 @@ int main() { << "\n\n"; amdsmi_power_cap_info_t cap_info = {}; - ret = amdsmi_get_power_cap_info(device_handles[j], 0, &cap_info); + ret = amdsmi_get_power_cap_info(processor_handles[j], 0, &cap_info); CHK_AMDSMI_RET(ret) printf(" Output of amdsmi_get_power_cap_info:\n"); std::cout << "\t\t Power Cap: " << cap_info.power_cap / 1000000 diff --git a/include/amd_smi/amdsmi.h b/include/amd_smi/amdsmi.h index 0e87262ec9..4bc3216d00 100644 --- a/include/amd_smi/amdsmi.h +++ b/include/amd_smi/amdsmi.h @@ -609,7 +609,7 @@ typedef enum { * Event notification data returned from event notification API */ typedef struct { - amdsmi_processor_handle device_handle; //!< Handler of device that corresponds to the event + amdsmi_processor_handle processor_handle; //!< Handler of device that corresponds to the event amdsmi_evt_notification_type_t event; //!< Event type char message[MAX_EVENT_NOTIFICATION_MSG_SIZE]; //!< Event message } amdsmi_evt_notification_data_t; @@ -1229,39 +1229,39 @@ amdsmi_status_t amdsmi_get_socket_info( * Currently, only AMD GPUs are supported. * * The number of device count is returned through @p device_count - * if @p device_handles is NULL. Then the number of @p device_count can be pass - * as input to retrieval all devices on the socket to @p device_handles. + * if @p processor_handles is NULL. Then the number of @p device_count can be pass + * as input to retrieval all devices on the socket to @p processor_handles. * * @param[in] socket_handle The socket to query * * @param[in,out] device_count As input, the value passed * through this parameter is the number of ::amdsmi_processor_handle's that - * may be safely written to the memory pointed to by @p device_handles. This is the - * limit on how many device handles will be written to @p device_handles. On return, @p - * device_count will contain the number of device handles written to @p device_handles, + * may be safely written to the memory pointed to by @p processor_handles. This is the + * limit on how many device handles will be written to @p processor_handles. On return, @p + * device_count will contain the number of device handles written to @p processor_handles, * or the number of device handles that could have been written if enough memory had been * provided. - * If @p device_handles is NULL, as output, @p device_count will contain + * If @p processor_handles is NULL, as output, @p device_count will contain * how many devices are available to read for the socket. * - * @param[in,out] device_handles A pointer to a block of memory to which the + * @param[in,out] processor_handles A pointer to a block of memory to which the * ::amdsmi_processor_handle values will be written. This value may be NULL. * In this case, this function can be used to query how many devices are * available to read. * * @return ::amdsmi_status_t | ::AMDSMI_STATUS_SUCCESS on success, non-zero on fail */ -amdsmi_status_t amdsmi_get_device_handles(amdsmi_socket_handle socket_handle, +amdsmi_status_t amdsmi_get_processor_handles(amdsmi_socket_handle socket_handle, uint32_t *device_count, - amdsmi_processor_handle* device_handles); + amdsmi_processor_handle* processor_handles); /** - * @brief Get the device type of the device_handle + * @brief Get the device type of the processor_handle * - * @details This function retrieves the device type. A device_handle must be provided + * @details This function retrieves the device type. A processor_handle must be provided * for that device. * - * @param[in] device_handle a device handle + * @param[in] processor_handle a device handle * * @param[out] device_type a pointer to device_type_t to which the device type * will be written. If this parameter is nullptr, this function will return @@ -1269,7 +1269,7 @@ amdsmi_status_t amdsmi_get_device_handles(amdsmi_socket_handle socket_handle, * * @return ::amdsmi_status_t | ::AMDSMI_STATUS_SUCCESS on success, non-zero on fail */ -amdsmi_status_t amdsmi_get_device_type(amdsmi_processor_handle device_handle, +amdsmi_status_t amdsmi_get_device_type(amdsmi_processor_handle processor_handle, device_type_t* device_type); /** @@ -1280,11 +1280,11 @@ amdsmi_status_t amdsmi_get_device_type(amdsmi_processor_handle device_handle, * * @param[in] bdf The bdf to match with corresponding device handle. * - * @param[out] device_handle device handle with the matching bdf. + * @param[out] processor_handle device handle with the matching bdf. * * @return ::amdsmi_status_t | ::AMDSMI_STATUS_SUCCESS on success, non-zero on fail */ -amdsmi_status_t amdsmi_get_device_handle_from_bdf(amdsmi_bdf_t bdf, amdsmi_processor_handle* device_handle); +amdsmi_status_t amdsmi_get_processor_handle_from_bdf(amdsmi_bdf_t bdf, amdsmi_processor_handle* processor_handle); /** @} End DiscQueries */ @@ -1298,7 +1298,7 @@ amdsmi_status_t amdsmi_get_device_handle_from_bdf(amdsmi_bdf_t bdf, amdsmi_proce * @brief Get the device id associated with the device with provided device * handler. * - * @details Given a device handle @p device_handle and a pointer to a uint32_t @p id, + * @details Given a device handle @p processor_handle and a pointer to a uint32_t @p id, * this function will write the device id value to the uint64_t pointed to by * @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 @@ -1306,7 +1306,7 @@ amdsmi_status_t amdsmi_get_device_handle_from_bdf(amdsmi_bdf_t bdf, amdsmi_proce * one device from another. amdsmi_dev_get_pci_id() should be used to get a * unique identifier. * - * @param[in] device_handle a device handle + * @param[in] processor_handle a device handle * * @param[in,out] id a pointer to uint64_t to which the device id will be * written @@ -1317,12 +1317,12 @@ amdsmi_status_t amdsmi_get_device_handle_from_bdf(amdsmi_bdf_t bdf, amdsmi_proce * * @return ::amdsmi_status_t | ::AMDSMI_STATUS_SUCCESS on success, non-zero on fail */ -amdsmi_status_t amdsmi_dev_get_id(amdsmi_processor_handle device_handle, uint16_t *id); +amdsmi_status_t amdsmi_dev_get_id(amdsmi_processor_handle processor_handle, uint16_t *id); /** * @brief Get the name string for a give vendor ID * - * @details Given a device handle @p device_handle, a pointer to a caller provided + * @details Given a device handle @p processor_handle, a pointer to a caller provided * char buffer @p name, and a length of this buffer @p len, this function will * write the name of the vendor (up to @p len characters) buffer @p name. The * @p id may be a device vendor or subsystem vendor ID. @@ -1333,7 +1333,7 @@ amdsmi_status_t amdsmi_dev_get_id(amdsmi_processor_handle device_handle, uint16_ * as a string. Updating the system name files can be accompplished with * "sudo update-pciids". * - * @param[in] device_handle a device handle + * @param[in] processor_handle a device handle * * @param[in,out] name a pointer to a caller provided char buffer to which the * name will be written @@ -1350,14 +1350,14 @@ amdsmi_status_t amdsmi_dev_get_id(amdsmi_processor_handle device_handle, uint16_ * * @return ::amdsmi_status_t | ::AMDSMI_STATUS_SUCCESS on success, non-zero on fail */ -amdsmi_status_t amdsmi_dev_get_vendor_name(amdsmi_processor_handle device_handle, char *name, +amdsmi_status_t amdsmi_dev_get_vendor_name(amdsmi_processor_handle processor_handle, char *name, size_t len); /** * @brief Get the vram vendor string of a device. * * @details This function retrieves the vram vendor name given a device handle - * @p device_handle, a pointer to a caller provided + * @p processor_handle, a pointer to a caller provided * char buffer @p brand, and a length of this buffer @p len, this function * will write the vram vendor of the device (up to @p len characters) to the * buffer @p brand. @@ -1366,7 +1366,7 @@ amdsmi_status_t amdsmi_dev_get_vendor_name(amdsmi_processor_handle device_handle * contained within amdsmi_dev_get_vram_vendor, then this function will return * the string 'unknown' instead of the vram vendor. * - * @param[in] device_handle a device handle + * @param[in] processor_handle a device handle * * @param[in,out] brand a pointer to a caller provided char buffer to which the * vram vendor will be written @@ -1375,18 +1375,18 @@ amdsmi_status_t amdsmi_dev_get_vendor_name(amdsmi_processor_handle device_handle * * @return ::amdsmi_status_t | ::AMDSMI_STATUS_SUCCESS on success, non-zero on fail */ -amdsmi_status_t amdsmi_dev_get_vram_vendor(amdsmi_processor_handle device_handle, char *brand, +amdsmi_status_t amdsmi_dev_get_vram_vendor(amdsmi_processor_handle processor_handle, char *brand, uint32_t len); /** * @brief Get the subsystem device id associated with the device with * provided device handle. * - * @details Given a device handle @p device_handle and a pointer to a uint32_t @p id, + * @details Given a device handle @p processor_handle and a pointer to a uint32_t @p id, * this function will write the subsystem device id value to the uint64_t * pointed to by @p id. * - * @param[in] device_handle a device handle + * @param[in] processor_handle a device handle * * @param[in,out] id a pointer to uint64_t to which the subsystem device id * will be written @@ -1397,12 +1397,12 @@ amdsmi_status_t amdsmi_dev_get_vram_vendor(amdsmi_processor_handle device_handle * * @return ::amdsmi_status_t | ::AMDSMI_STATUS_SUCCESS on success, non-zero on fail */ -amdsmi_status_t amdsmi_dev_get_subsystem_id(amdsmi_processor_handle device_handle, uint16_t *id); +amdsmi_status_t amdsmi_dev_get_subsystem_id(amdsmi_processor_handle processor_handle, uint16_t *id); /** * @brief Get the name string for the device subsytem * - * @details Given a device handle @p device_handle, a pointer to a caller provided + * @details Given a device handle @p processor_handle, a pointer to a caller provided * char buffer @p name, and a length of this buffer @p len, this function * will write the name of the device subsystem (up to @p len characters) * to the buffer @p name. @@ -1413,7 +1413,7 @@ amdsmi_status_t amdsmi_dev_get_subsystem_id(amdsmi_processor_handle device_handl * ID as a string. Updating the system name files can be accompplished with * "sudo update-pciids". * - * @param[in] device_handle a device handle + * @param[in] processor_handle a device handle * * @param[in,out] name a pointer to a caller provided char buffer to which the * name will be written @@ -1431,15 +1431,15 @@ amdsmi_status_t amdsmi_dev_get_subsystem_id(amdsmi_processor_handle device_handl * @return ::amdsmi_status_t | ::AMDSMI_STATUS_SUCCESS on success, non-zero on fail */ amdsmi_status_t -amdsmi_dev_get_subsystem_name(amdsmi_processor_handle device_handle, char *name, size_t len); +amdsmi_dev_get_subsystem_name(amdsmi_processor_handle processor_handle, char *name, size_t len); /** * @brief Get the drm minor number associated with this device * - * @details Given a device handle @p device_handle, find its render device file + * @details Given a device handle @p processor_handle, find its render device file * /dev/dri/renderDN where N corresponds to its minor number. * - * @param[in] device_handle a device handle + * @param[in] processor_handle a device handle * * @param[in,out] minor a pointer to a uint32_t into which minor number will * be copied @@ -1447,7 +1447,7 @@ amdsmi_dev_get_subsystem_name(amdsmi_processor_handle device_handle, char *name, * @return ::amdsmi_status_t | ::AMDSMI_STATUS_SUCCESS on success, non-zero on fail */ amdsmi_status_t -amdsmi_dev_get_drm_render_minor(amdsmi_processor_handle device_handle, uint32_t *minor); +amdsmi_dev_get_drm_render_minor(amdsmi_processor_handle processor_handle, uint32_t *minor); /** @} End IDQuer */ @@ -1460,12 +1460,12 @@ amdsmi_dev_get_drm_render_minor(amdsmi_processor_handle device_handle, uint32_t /** * @brief Get the list of possible PCIe bandwidths that are available. * - * @details Given a device handle @p device_handle and a pointer to a to an + * @details Given a device handle @p processor_handle and a pointer to a to an * ::amdsmi_pcie_bandwidth_t structure @p bandwidth, this function will fill in * @p bandwidth with the possible T/s values and associated number of lanes, * and indication of the current selection. * - * @param[in] device_handle a device handle + * @param[in] processor_handle a device handle * * @param[in,out] bandwidth a pointer to a caller provided * ::amdsmi_pcie_bandwidth_t structure to which the frequency information will be @@ -1474,14 +1474,14 @@ amdsmi_dev_get_drm_render_minor(amdsmi_processor_handle device_handle, uint32_t * @return ::amdsmi_status_t | ::AMDSMI_STATUS_SUCCESS on success, non-zero on fail */ amdsmi_status_t -amdsmi_dev_get_pci_bandwidth(amdsmi_processor_handle device_handle, amdsmi_pcie_bandwidth_t *bandwidth); +amdsmi_dev_get_pci_bandwidth(amdsmi_processor_handle processor_handle, amdsmi_pcie_bandwidth_t *bandwidth); /** * @brief Get the unique PCI device identifier associated for a device * - * @details Give a device handle @p device_handle and a pointer to a uint64_t @p + * @details Give a device handle @p processor_handle and a pointer to a uint64_t @p * bdfid, this function will write the Bus/Device/Function PCI identifier - * (BDFID) associated with device @p device_handle to the value pointed to by + * (BDFID) associated with device @p processor_handle to the value pointed to by * @p bdfid. * * The format of @p bdfid will be as follows: @@ -1497,7 +1497,7 @@ amdsmi_dev_get_pci_bandwidth(amdsmi_processor_handle device_handle, amdsmi_pcie_ * | Device | [ 7: 3] | * | Function | [ 2: 0] | * - * @param[in] device_handle a device handle + * @param[in] processor_handle a device handle * * @param[in,out] bdfid a pointer to uint64_t to which the device bdfid value * will be written @@ -1508,17 +1508,17 @@ amdsmi_dev_get_pci_bandwidth(amdsmi_processor_handle device_handle, amdsmi_pcie_ * * @return ::amdsmi_status_t | ::AMDSMI_STATUS_SUCCESS on success, non-zero on fail */ -amdsmi_status_t amdsmi_dev_get_pci_id(amdsmi_processor_handle device_handle, uint64_t *bdfid); +amdsmi_status_t amdsmi_dev_get_pci_id(amdsmi_processor_handle processor_handle, uint64_t *bdfid); /** * @brief Get the NUMA node associated with a device * - * @details Given a device handle @p device_handle and a pointer to a uint32_t @p + * @details Given a device handle @p processor_handle and a pointer to a uint32_t @p * numa_node, this function will retrieve the NUMA node value associated - * with device @p device_handle and store the value at location pointed to by + * with device @p processor_handle and store the value at location pointed to by * @p numa_node. * - * @param[in] device_handle a device handle + * @param[in] processor_handle a device handle * * @param[in,out] numa_node pointer to location where NUMA node value will * be written. @@ -1529,18 +1529,18 @@ amdsmi_status_t amdsmi_dev_get_pci_id(amdsmi_processor_handle device_handle, uin * * @return ::amdsmi_status_t | ::AMDSMI_STATUS_SUCCESS on success, non-zero on fail */ -amdsmi_status_t amdsmi_topo_get_numa_affinity(amdsmi_processor_handle device_handle, uint32_t *numa_node); +amdsmi_status_t amdsmi_topo_get_numa_affinity(amdsmi_processor_handle processor_handle, uint32_t *numa_node); /** * @brief Get PCIe traffic information * - * @details Give a device handle @p device_handle and pointers to a uint64_t's, @p + * @details Give a device handle @p processor_handle and pointers to a uint64_t's, @p * sent, @p received and @p max_pkt_sz, this function will write the number * of bytes sent and received in 1 second to @p sent and @p received, * respectively. The maximum possible packet size will be written to * @p max_pkt_sz. * - * @param[in] device_handle a device handle + * @param[in] processor_handle a device handle * * @param[in,out] sent a pointer to uint64_t to which the number of bytes sent * will be written in 1 second. If pointer is NULL, it will be ignored. @@ -1553,18 +1553,18 @@ amdsmi_status_t amdsmi_topo_get_numa_affinity(amdsmi_processor_handle device_han * * @return ::amdsmi_status_t | ::AMDSMI_STATUS_SUCCESS on success, non-zero on fail */ -amdsmi_status_t amdsmi_dev_get_pci_throughput(amdsmi_processor_handle device_handle, uint64_t *sent, +amdsmi_status_t amdsmi_dev_get_pci_throughput(amdsmi_processor_handle processor_handle, uint64_t *sent, uint64_t *received, uint64_t *max_pkt_sz); /** * @brief Get PCIe replay counter * - * @details Given a device handle @p device_handle and a pointer to a uint64_t @p + * @details Given a device handle @p processor_handle and a pointer to a uint64_t @p * counter, this function will write the sum of the number of NAK's received * by the GPU and the NAK's generated by the GPU to memory pointed to by @p * counter. * - * @param[in] device_handle a device handle + * @param[in] processor_handle a device handle * * @param[in,out] counter a pointer to uint64_t to which the sum of the NAK's * received and generated by the GPU is written @@ -1575,7 +1575,7 @@ amdsmi_status_t amdsmi_dev_get_pci_throughput(amdsmi_processor_handle device_han * * @return ::amdsmi_status_t | ::AMDSMI_STATUS_SUCCESS on success, non-zero on fail */ -amdsmi_status_t amdsmi_dev_get_pci_replay_counter(amdsmi_processor_handle device_handle, +amdsmi_status_t amdsmi_dev_get_pci_replay_counter(amdsmi_processor_handle processor_handle, uint64_t *counter); /** @} End PCIeQuer */ @@ -1589,7 +1589,7 @@ amdsmi_status_t amdsmi_dev_get_pci_replay_counter(amdsmi_processor_handle devic /** * @brief Control the set of allowed PCIe bandwidths that can be used. * - * @details Given a device handle @p device_handle and a 64 bit bitmask @p bw_bitmask, + * @details Given a device handle @p processor_handle and a 64 bit bitmask @p bw_bitmask, * this function will limit the set of allowable bandwidths. If a bit in @p * bw_bitmask has a value of 1, then the frequency (as ordered in an * ::amdsmi_frequencies_t returned by :: amdsmi_dev_get_gpu_clk_freq()) corresponding @@ -1606,7 +1606,7 @@ amdsmi_status_t amdsmi_dev_get_pci_replay_counter(amdsmi_processor_handle devic * * @note This function requires root access * - * @param[in] device_handle a device handle + * @param[in] processor_handle a device handle * * @param[in] bw_bitmask A bitmask indicating the indices of the * bandwidths that are to be enabled (1) and disabled (0). Only the lowest @@ -1615,7 +1615,7 @@ amdsmi_status_t amdsmi_dev_get_pci_replay_counter(amdsmi_processor_handle devic * * @return ::amdsmi_status_t | ::AMDSMI_STATUS_SUCCESS on success, non-zero on fail */ -amdsmi_status_t amdsmi_dev_set_pci_bandwidth(amdsmi_processor_handle device_handle, uint64_t bw_bitmask); +amdsmi_status_t amdsmi_dev_set_pci_bandwidth(amdsmi_processor_handle processor_handle, uint64_t bw_bitmask); /** @} End PCIeCont */ @@ -1630,9 +1630,9 @@ amdsmi_status_t amdsmi_dev_set_pci_bandwidth(amdsmi_processor_handle device_han * * @details This function will write the current average power consumption * (in microwatts) to the uint64_t pointed to by @p power, for the given - * device handle @p device_handle and a pointer to a uint64_t @p power + * device handle @p processor_handle and a pointer to a uint64_t @p power * - * @param[in] device_handle a device handle + * @param[in] processor_handle a device handle * * @param[in] sensor_ind a 0-based sensor index. Normally, this will be 0. * If a device has more than one sensor, it could be greater than 0. @@ -1647,20 +1647,20 @@ amdsmi_status_t amdsmi_dev_set_pci_bandwidth(amdsmi_processor_handle device_han * @return ::amdsmi_status_t | ::AMDSMI_STATUS_SUCCESS on success, non-zero on fail */ amdsmi_status_t -amdsmi_dev_get_power_ave(amdsmi_processor_handle device_handle, uint32_t sensor_ind, uint64_t *power); +amdsmi_dev_get_power_ave(amdsmi_processor_handle processor_handle, uint32_t sensor_ind, uint64_t *power); /** * @brief Get the energy accumulator counter of the device with provided * device handle. * - * @details Given a device handle @p device_handle, a pointer to a uint64_t + * @details Given a device handle @p processor_handle, a pointer to a uint64_t * @p power, and a pointer to a uint64_t @p timestamp, this function will write * amount of energy consumed to the uint64_t pointed to by @p power, * and the timestamp to the uint64_t pointed to by @p timestamp. * The amdsmi_dev_get_power_ave() is an average of a short time. This function * accumulates all energy consumed. * - * @param[in] device_handle a device handle + * @param[in] processor_handle a device handle * @param[in,out] counter_resolution resolution of the counter @p power in * micro Joules * @@ -1677,7 +1677,7 @@ amdsmi_dev_get_power_ave(amdsmi_processor_handle device_handle, uint32_t sensor_ * @return ::amdsmi_status_t | ::AMDSMI_STATUS_SUCCESS on success, non-zero on fail */ amdsmi_status_t -amdsmi_dev_get_energy_count(amdsmi_processor_handle device_handle, uint64_t *power, +amdsmi_dev_get_energy_count(amdsmi_processor_handle processor_handle, uint64_t *power, float *counter_resolution, uint64_t *timestamp); /** @} End PowerQuer */ @@ -1694,7 +1694,7 @@ amdsmi_dev_get_energy_count(amdsmi_processor_handle device_handle, uint64_t *pow * @p cap must be between the minimum and maximum power cap values set by the * system, which can be obtained from ::amdsmi_dev_power_cap_range_get. * - * @param[in] device_handle a device handle + * @param[in] processor_handle a device handle * * @param[in] sensor_ind a 0-based sensor index. Normally, this will be 0. * If a device has more than one sensor, it could be greater than 0. @@ -1705,17 +1705,17 @@ amdsmi_dev_get_energy_count(amdsmi_processor_handle device_handle, uint64_t *pow * @return ::amdsmi_status_t | ::AMDSMI_STATUS_SUCCESS on success, non-zero on fail */ amdsmi_status_t - amdsmi_dev_set_power_cap(amdsmi_processor_handle device_handle, uint32_t sensor_ind, uint64_t cap); + amdsmi_dev_set_power_cap(amdsmi_processor_handle processor_handle, uint32_t sensor_ind, uint64_t cap); /** * @brief Set the power performance profile * * @details This function will attempt to set the current profile to the provided - * profile, given a device handle @p device_handle and a @p profile. The provided + * profile, given a device handle @p processor_handle and a @p profile. The provided * profile must be one of the currently supported profiles, as indicated by a * call to :: amdsmi_dev_get_power_profile_presets() * - * @param[in] device_handle a device handle + * @param[in] processor_handle a device handle * * @param[in] reserved Not currently used. Set to 0. * @@ -1725,7 +1725,7 @@ amdsmi_status_t * @return ::amdsmi_status_t | ::AMDSMI_STATUS_SUCCESS on success, non-zero on fail */ amdsmi_status_t - amdsmi_dev_set_power_profile(amdsmi_processor_handle device_handle, uint32_t reserved, + amdsmi_dev_set_power_profile(amdsmi_processor_handle processor_handle, uint32_t reserved, amdsmi_power_profile_preset_masks_t profile); /** @} End PowerCont*/ @@ -1739,11 +1739,11 @@ amdsmi_status_t /** * @brief Get the total amount of memory that exists * - * @details Given a device handle @p device_handle, a type of memory @p mem_type, and + * @details Given a device handle @p processor_handle, a type of memory @p mem_type, and * a pointer to a uint64_t @p total, this function will write the total amount * of @p mem_type memory that exists to the location pointed to by @p total. * - * @param[in] device_handle a device handle + * @param[in] processor_handle a device handle * * @param[in] mem_type The type of memory for which the total amount will be * found @@ -1758,7 +1758,7 @@ amdsmi_status_t * @return ::amdsmi_status_t | ::AMDSMI_STATUS_SUCCESS on success, non-zero on fail */ amdsmi_status_t -amdsmi_dev_get_memory_total(amdsmi_processor_handle device_handle, amdsmi_memory_type_t mem_type, +amdsmi_dev_get_memory_total(amdsmi_processor_handle processor_handle, amdsmi_memory_type_t mem_type, uint64_t *total); /** @@ -1767,7 +1767,7 @@ amdsmi_dev_get_memory_total(amdsmi_processor_handle device_handle, amdsmi_memory * @details This function will write the amount of @p mem_type memory that * that is currently being used to the location pointed to by @p used. * - * @param[in] device_handle a device handle + * @param[in] processor_handle a device handle * * @param[in] mem_type The type of memory for which the amount being used will * be found @@ -1782,17 +1782,17 @@ amdsmi_dev_get_memory_total(amdsmi_processor_handle device_handle, amdsmi_memory * @return ::amdsmi_status_t | ::AMDSMI_STATUS_SUCCESS on success, non-zero on fail */ amdsmi_status_t -amdsmi_dev_get_memory_usage(amdsmi_processor_handle device_handle, amdsmi_memory_type_t mem_type, +amdsmi_dev_get_memory_usage(amdsmi_processor_handle processor_handle, amdsmi_memory_type_t mem_type, uint64_t *used); /** * @brief The first call to this API returns the number of bad pages which * should be used to allocate the buffer that should contain the bad page * records. - * @details This call will query the device @p device_handle for the + * @details This call will query the device @p processor_handle for the * number of bad pages (written to @p num_pages address). The results are * written to address held by the @p info pointer. - * @param[in] device_handle a device handle + * @param[in] processor_handle a device handle * @param[out] num_pages Number of bad page records. * @param[out] info The results will be written to the * amdsmi_retired_page_record_t pointer. @@ -1800,16 +1800,16 @@ amdsmi_dev_get_memory_usage(amdsmi_processor_handle device_handle, amdsmi_memory * @return ::amdsmi_status_t | ::AMDSMI_STATUS_SUCCESS on success, non-zero on fail */ amdsmi_status_t -amdsmi_get_bad_page_info(amdsmi_processor_handle device_handle, uint32_t *num_pages, amdsmi_retired_page_record_t *info); +amdsmi_get_bad_page_info(amdsmi_processor_handle processor_handle, uint32_t *num_pages, amdsmi_retired_page_record_t *info); /** * @brief Returns if RAS features are enabled or disabled for given block * - * @details Given a device handle @p device_handle, this function queries the + * @details Given a device handle @p processor_handle, this function queries the * state of RAS features for a specific block @p block. Result will be written * to address held by pointer @p state. * - * @param[in] device_handle Device handle which to query + * @param[in] processor_handle Device handle which to query * * @param[in] block Block which to query * @@ -1823,17 +1823,17 @@ amdsmi_get_bad_page_info(amdsmi_processor_handle device_handle, uint32_t *num_pa * @return ::amdsmi_status_t | ::AMDSMI_STATUS_SUCCESS on success, non-zero on fail */ amdsmi_status_t -amdsmi_get_ras_block_features_enabled(amdsmi_processor_handle device_handle, amdsmi_gpu_block_t block, +amdsmi_get_ras_block_features_enabled(amdsmi_processor_handle processor_handle, amdsmi_gpu_block_t block, amdsmi_ras_err_state_t *state); /** * @brief Get percentage of time any device memory is being used * - * @details Given a device handle @p device_handle, this function returns the + * @details Given a device handle @p processor_handle, this function returns the * percentage of time that any device memory is being used for the specified * device. * - * @param[in] device_handle a device handle + * @param[in] processor_handle a device handle * * @param[in,out] busy_percent a pointer to the uint32_t to which the busy * percent will be written @@ -1845,18 +1845,18 @@ amdsmi_get_ras_block_features_enabled(amdsmi_processor_handle device_handle, amd * @return ::amdsmi_status_t | ::AMDSMI_STATUS_SUCCESS on success, non-zero on fail */ amdsmi_status_t -amdsmi_dev_get_memory_busy_percent(amdsmi_processor_handle device_handle, uint32_t *busy_percent); +amdsmi_dev_get_memory_busy_percent(amdsmi_processor_handle processor_handle, uint32_t *busy_percent); /** * @brief Get information about reserved ("retired") memory pages * - * @details Given a device handle @p device_handle, this function returns retired page + * @details Given a device handle @p processor_handle, this function returns retired page * information @p records corresponding to the device with the provided device - * handle @p device_handle. The number of retired page records is returned through @p + * handle @p processor_handle. The number of retired page records is returned through @p * num_pages. @p records may be NULL on input. In this case, the number of * records available for retrieval will be returned through @p num_pages. * - * @param[in] device_handle a device handle + * @param[in] processor_handle a device handle * * @param[in,out] num_pages a pointer to a uint32. As input, the value passed * through this parameter is the number of ::amdsmi_retired_page_record_t's that @@ -1878,7 +1878,7 @@ amdsmi_dev_get_memory_busy_percent(amdsmi_processor_handle device_handle, uint32 * @return ::amdsmi_status_t | ::AMDSMI_STATUS_SUCCESS on success, non-zero on fail */ amdsmi_status_t -amdsmi_dev_get_memory_reserved_pages(amdsmi_processor_handle device_handle, uint32_t *num_pages, +amdsmi_dev_get_memory_reserved_pages(amdsmi_processor_handle processor_handle, uint32_t *num_pages, amdsmi_retired_page_record_t *records); /** @} End MemQuer */ @@ -1893,11 +1893,11 @@ amdsmi_dev_get_memory_reserved_pages(amdsmi_processor_handle device_handle, uint * @brief Get the fan speed in RPMs of the device with the specified device * handle and 0-based sensor index. * - * @details Given a device handle @p device_handle and a pointer to a uint32_t + * @details Given a device handle @p processor_handle and a pointer to a uint32_t * @p speed, this function will write the current fan speed in RPMs to the * uint32_t pointed to by @p speed * - * @param[in] device_handle a device handle + * @param[in] processor_handle a device handle * * @param[in] sensor_ind a 0-based sensor index. Normally, this will be 0. * If a device has more than one sensor, it could be greater than 0. @@ -1911,19 +1911,19 @@ amdsmi_dev_get_memory_reserved_pages(amdsmi_processor_handle device_handle, uint * * @return ::amdsmi_status_t | ::AMDSMI_STATUS_SUCCESS on success, non-zero on fail */ -amdsmi_status_t amdsmi_dev_get_fan_rpms(amdsmi_processor_handle device_handle, uint32_t sensor_ind, +amdsmi_status_t amdsmi_dev_get_fan_rpms(amdsmi_processor_handle processor_handle, uint32_t sensor_ind, int64_t *speed); /** * @brief Get the fan speed for the specified device as a value relative to * ::AMDSMI_MAX_FAN_SPEED * - * @details Given a device handle @p device_handle and a pointer to a uint32_t + * @details Given a device handle @p processor_handle and a pointer to a uint32_t * @p speed, this function will write the current fan speed (a value * between 0 and the maximum fan speed, ::AMDSMI_MAX_FAN_SPEED) to the uint32_t * pointed to by @p speed * - * @param[in] device_handle a device handle + * @param[in] processor_handle a device handle * * @param[in] sensor_ind a 0-based sensor index. Normally, this will be 0. * If a device has more than one sensor, it could be greater than 0. @@ -1937,17 +1937,17 @@ amdsmi_status_t amdsmi_dev_get_fan_rpms(amdsmi_processor_handle device_handle, u * * @return ::amdsmi_status_t | ::AMDSMI_STATUS_SUCCESS on success, non-zero on fail */ -amdsmi_status_t amdsmi_dev_get_fan_speed(amdsmi_processor_handle device_handle, +amdsmi_status_t amdsmi_dev_get_fan_speed(amdsmi_processor_handle processor_handle, uint32_t sensor_ind, int64_t *speed); /** * @brief Get the max. fan speed of the device with provided device handle. * - * @details Given a device handle @p device_handle and a pointer to a uint32_t + * @details Given a device handle @p processor_handle and a pointer to a uint32_t * @p max_speed, this function will write the maximum fan speed possible to * the uint32_t pointed to by @p max_speed * - * @param[in] device_handle a device handle + * @param[in] processor_handle a device handle * * @param[in] sensor_ind a 0-based sensor index. Normally, this will be 0. * If a device has more than one sensor, it could be greater than 0. @@ -1961,19 +1961,19 @@ amdsmi_status_t amdsmi_dev_get_fan_speed(amdsmi_processor_handle device_handle, * * @return ::amdsmi_status_t | ::AMDSMI_STATUS_SUCCESS on success, non-zero on fail */ -amdsmi_status_t amdsmi_dev_get_fan_speed_max(amdsmi_processor_handle device_handle, +amdsmi_status_t amdsmi_dev_get_fan_speed_max(amdsmi_processor_handle processor_handle, uint32_t sensor_ind, uint64_t *max_speed); /** * @brief Get the temperature metric value for the specified metric, from the * specified temperature sensor on the specified device. * - * @details Given a device handle @p device_handle, a sensor type @p sensor_type, a + * @details Given a device handle @p processor_handle, a sensor type @p sensor_type, a * ::amdsmi_temperature_metric_t @p metric and a pointer to an int64_t @p * temperature, this function will write the value of the metric indicated by * @p metric and @p sensor_type to the memory location @p temperature. * - * @param[in] device_handle a device handle + * @param[in] processor_handle a device handle * * @param[in] sensor_type part of device from which temperature should be * obtained. This should come from the enum ::amdsmi_temperature_type_t @@ -1990,7 +1990,7 @@ amdsmi_status_t amdsmi_dev_get_fan_speed_max(amdsmi_processor_handle device_hand * * @return ::amdsmi_status_t | ::AMDSMI_STATUS_SUCCESS on success, non-zero on fail */ -amdsmi_status_t amdsmi_dev_get_temp_metric(amdsmi_processor_handle device_handle, +amdsmi_status_t amdsmi_dev_get_temp_metric(amdsmi_processor_handle processor_handle, amdsmi_temperature_type_t sensor_type, amdsmi_temperature_metric_t metric, int64_t *temperature); @@ -1998,12 +1998,12 @@ amdsmi_status_t amdsmi_dev_get_temp_metric(amdsmi_processor_handle device_handl * @brief Get the voltage metric value for the specified metric, from the * specified voltage sensor on the specified device. * - * @details Given a device handle @p device_handle, a sensor type @p sensor_type, a + * @details Given a device handle @p processor_handle, a sensor type @p sensor_type, a * ::amdsmi_voltage_metric_t @p metric and a pointer to an int64_t @p * voltage, this function will write the value of the metric indicated by * @p metric and @p sensor_type to the memory location @p voltage. * - * @param[in] device_handle a device handle + * @param[in] processor_handle a device handle * * @param[in] sensor_type part of device from which voltage should be * obtained. This should come from the enum ::amdsmi_voltage_type_t @@ -2020,7 +2020,7 @@ amdsmi_status_t amdsmi_dev_get_temp_metric(amdsmi_processor_handle device_handl * * @return ::amdsmi_status_t | ::AMDSMI_STATUS_SUCCESS on success, non-zero on fail */ -amdsmi_status_t amdsmi_dev_get_volt_metric(amdsmi_processor_handle device_handle, +amdsmi_status_t amdsmi_dev_get_volt_metric(amdsmi_processor_handle processor_handle, amdsmi_voltage_type_t sensor_type, amdsmi_voltage_metric_t metric, int64_t *voltage); @@ -2037,27 +2037,27 @@ amdsmi_status_t amdsmi_dev_get_volt_metric(amdsmi_processor_handle device_handl * * @details This function returns control of the fan to the system * - * @param[in] device_handle a device handle + * @param[in] processor_handle a device handle * * @param[in] sensor_ind a 0-based sensor index. Normally, this will be 0. * If a device has more than one sensor, it could be greater than 0. * * @return ::amdsmi_status_t | ::AMDSMI_STATUS_SUCCESS on success, non-zero on fail */ -amdsmi_status_t amdsmi_dev_reset_fan(amdsmi_processor_handle device_handle, uint32_t sensor_ind); +amdsmi_status_t amdsmi_dev_reset_fan(amdsmi_processor_handle processor_handle, uint32_t sensor_ind); /** * @brief Set the fan speed for the specified device with the provided speed, * in RPMs. * - * @details Given a device handle @p device_handle and a integer value indicating + * @details Given a device handle @p processor_handle and a integer value indicating * speed @p speed, this function will attempt to set the fan speed to @p speed. * An error will be returned if the specified speed is outside the allowable * range for the device. The maximum value is 255 and the minimum is 0. * * @note This function requires root access * - * @param[in] device_handle a device handle + * @param[in] processor_handle a device handle * * @param[in] sensor_ind a 0-based sensor index. Normally, this will be 0. * If a device has more than one sensor, it could be greater than 0. @@ -2066,7 +2066,7 @@ amdsmi_status_t amdsmi_dev_reset_fan(amdsmi_processor_handle device_handle, uint * * @return ::amdsmi_status_t | ::AMDSMI_STATUS_SUCCESS on success, non-zero on fail */ -amdsmi_status_t amdsmi_dev_set_fan_speed(amdsmi_processor_handle device_handle, +amdsmi_status_t amdsmi_dev_set_fan_speed(amdsmi_processor_handle processor_handle, uint32_t sensor_ind, uint64_t speed); /** @} End PhysCont */ @@ -2081,12 +2081,12 @@ amdsmi_status_t amdsmi_dev_set_fan_speed(amdsmi_processor_handle device_handle, /** * @brief Get percentage of time device is busy doing any processing * - * @details Given a device handle @p device_handle, this function returns the + * @details Given a device handle @p processor_handle, this function returns the * percentage of time that the specified device is busy. The device is * considered busy if any one or more of its sub-blocks are working, and idle * if none of the sub-blocks are working. * - * @param[in] device_handle a device handle + * @param[in] processor_handle a device handle * * @param[in,out] busy_percent a pointer to the uint32_t to which the busy * percent will be written @@ -2098,19 +2098,19 @@ amdsmi_status_t amdsmi_dev_set_fan_speed(amdsmi_processor_handle device_handle, * @return ::amdsmi_status_t | ::AMDSMI_STATUS_SUCCESS on success, non-zero on fail */ amdsmi_status_t -amdsmi_dev_get_busy_percent(amdsmi_processor_handle device_handle, uint32_t *busy_percent); +amdsmi_dev_get_busy_percent(amdsmi_processor_handle processor_handle, uint32_t *busy_percent); /** * @brief Get coarse grain utilization counter of the specified device * - * @details Given a device handle @p device_handle, the array of the utilization counters, + * @details Given a device handle @p processor_handle, the array of the utilization counters, * the size of the array, this function returns the coarse grain utilization counters * and timestamp. * The counter is the accumulated percentages. Every milliseconds the firmware calculates * % busy count and then accumulates that value in the counter. This provides minimally * invasive coarse grain GPU usage information. * - * @param[in] device_handle a device handle + * @param[in] processor_handle a device handle * * @param[in,out] utilization_counters Multiple utilization counters can be retreived with a single * call. The caller must allocate enough space to the utilization_counters array. The caller also @@ -2125,7 +2125,7 @@ amdsmi_dev_get_busy_percent(amdsmi_processor_handle device_handle, uint32_t *bus * @return ::amdsmi_status_t | ::AMDSMI_STATUS_SUCCESS on success, non-zero on fail */ amdsmi_status_t -amdsmi_get_utilization_count(amdsmi_processor_handle device_handle, +amdsmi_get_utilization_count(amdsmi_processor_handle processor_handle, amdsmi_utilization_counter_t utilization_counters[], uint32_t count, uint64_t *timestamp); @@ -2133,39 +2133,39 @@ amdsmi_get_utilization_count(amdsmi_processor_handle device_handle, /** * @brief Get current PCIE info of the device with provided device handle. * - * @details Given a device handle @p device_handle, this function returns PCIE info of the + * @details Given a device handle @p processor_handle, this function returns PCIE info of the * given device. * - * @param[in] device_handle a device handle + * @param[in] processor_handle a device handle * * @param[out] info amdsmi_pcie_info_t struct which will hold all the extracted PCIE info data. * * @return ::amdsmi_status_t | ::AMDSMI_STATUS_SUCCESS on success, non-zero on fail */ -amdsmi_status_t amdsmi_get_pcie_link_status(amdsmi_processor_handle device_handle, amdsmi_pcie_info_t *info); +amdsmi_status_t amdsmi_get_pcie_link_status(amdsmi_processor_handle processor_handle, amdsmi_pcie_info_t *info); /** * @brief Get max PCIe capabilities of the device with provided device handle. * - * @details Given a device handle @p device_handle, this function returns PCIe caps info of the + * @details Given a device handle @p processor_handle, this function returns PCIe caps info of the * given device. * - * @param[in] device_handle a device handle + * @param[in] processor_handle a device handle * * @param[out] info amdsmi_pcie_info_t struct which will hold all the extracted PCIe caps data. * * @return ::amdsmi_status_t | ::AMDSMI_STATUS_SUCCESS on success, non-zero on fail */ -amdsmi_status_t amdsmi_get_pcie_link_caps(amdsmi_processor_handle device_handle, amdsmi_pcie_info_t *info); +amdsmi_status_t amdsmi_get_pcie_link_caps(amdsmi_processor_handle processor_handle, amdsmi_pcie_info_t *info); /** * @brief Get the performance level of the device * * @details This function will write the ::amdsmi_dev_perf_level_t to the uint32_t - * pointed to by @p perf, for a given device handle @p device_handle and a pointer + * pointed to by @p perf, for a given device handle @p processor_handle and a pointer * to a uint32_t @p perf. * - * @param[in] device_handle a device handle + * @param[in] processor_handle a device handle * * @param[in,out] perf a pointer to ::amdsmi_dev_perf_level_t to which the * performance level will be written @@ -2176,13 +2176,13 @@ amdsmi_status_t amdsmi_get_pcie_link_caps(amdsmi_processor_handle device_handle, * * @return ::amdsmi_status_t | ::AMDSMI_STATUS_SUCCESS on success, non-zero on fail */ -amdsmi_status_t amdsmi_dev_get_perf_level(amdsmi_processor_handle device_handle, +amdsmi_status_t amdsmi_dev_get_perf_level(amdsmi_processor_handle processor_handle, amdsmi_dev_perf_level_t *perf); /** * @brief Enter performance determinism mode with provided device handle. * - * @details Given a device handle @p device_handle and @p clkvalue this function + * @details Given a device handle @p processor_handle and @p clkvalue this function * will enable performance determinism mode, which enforces a GFXCLK frequency * SoftMax limit per GPU set by the user. This prevents the GFXCLK PLL from * stretching when running the same workload on different GPUS, making @@ -2190,24 +2190,24 @@ amdsmi_status_t amdsmi_dev_get_perf_level(amdsmi_processor_handle device_handle, * level ::amdsmi_dev_perf_level_t of the device being * ::AMDSMI_DEV_PERF_LEVEL_DETERMINISM. * - * @param[in] device_handle a device handle + * @param[in] processor_handle a device handle * * @param[in] clkvalue Softmax value for GFXCLK in MHz. * * @return ::amdsmi_status_t | ::AMDSMI_STATUS_SUCCESS on success, non-zero on fail */ amdsmi_status_t -amdsmi_set_perf_determinism_mode(amdsmi_processor_handle device_handle, uint64_t clkvalue); +amdsmi_set_perf_determinism_mode(amdsmi_processor_handle processor_handle, uint64_t clkvalue); /** * @brief Get the overdrive percent associated with the device with provided * device handle. * - * @details Given a device handle @p device_handle and a pointer to a uint32_t @p od, + * @details Given a device handle @p processor_handle and a pointer to a uint32_t @p od, * this function will write the overdrive percentage to the uint32_t pointed * to by @p od * - * @param[in] device_handle a device handle + * @param[in] processor_handle a device handle * * @param[in,out] od a pointer to uint32_t to which the overdrive percentage * will be written @@ -2219,18 +2219,18 @@ amdsmi_set_perf_determinism_mode(amdsmi_processor_handle device_handle, uint64_t * @return ::amdsmi_status_t | ::AMDSMI_STATUS_SUCCESS on success, non-zero on fail */ -amdsmi_status_t amdsmi_dev_get_overdrive_level(amdsmi_processor_handle device_handle, uint32_t *od); +amdsmi_status_t amdsmi_dev_get_overdrive_level(amdsmi_processor_handle processor_handle, uint32_t *od); /** * @brief Get the list of possible system clock speeds of device for a * specified clock type. * - * @details Given a device handle @p device_handle, a clock type @p clk_type, and a + * @details Given a device handle @p processor_handle, a clock type @p clk_type, and a * pointer to a to an ::amdsmi_frequencies_t structure @p f, this function will * fill in @p f with the possible clock speeds, and indication of the current * clock speed selection. * - * @param[in] device_handle a device handle + * @param[in] processor_handle a device handle * * @param[in] clk_type the type of clock for which the frequency is desired * @@ -2240,28 +2240,28 @@ amdsmi_status_t amdsmi_dev_get_overdrive_level(amdsmi_processor_handle device_ha * * @return ::amdsmi_status_t | ::AMDSMI_STATUS_SUCCESS on success, non-zero on fail */ -amdsmi_status_t amdsmi_dev_get_gpu_clk_freq(amdsmi_processor_handle device_handle, +amdsmi_status_t amdsmi_dev_get_gpu_clk_freq(amdsmi_processor_handle processor_handle, amdsmi_clk_type_t clk_type, amdsmi_frequencies_t *f); /** * @brief Reset the gpu associated with the device with provided device handle * - * @details Given a device handle @p device_handle, this function will reset the GPU + * @details Given a device handle @p processor_handle, this function will reset the GPU * - * @param[in] device_handle a device handle + * @param[in] processor_handle a device handle * * @return ::amdsmi_status_t | ::AMDSMI_STATUS_SUCCESS on success, non-zero on fail */ -amdsmi_status_t amdsmi_dev_reset_gpu(amdsmi_processor_handle device_handle); +amdsmi_status_t amdsmi_dev_reset_gpu(amdsmi_processor_handle processor_handle); /** * @brief This function retrieves the voltage/frequency curve information * - * @details Given a device handle @p device_handle and a pointer to a + * @details Given a device handle @p processor_handle and a pointer to a * ::amdsmi_od_volt_freq_data_t structure @p odv, this function will populate @p * odv. See ::amdsmi_od_volt_freq_data_t for more details. * - * @param[in] device_handle a device handle + * @param[in] processor_handle a device handle * * @param[in,out] odv a pointer to an ::amdsmi_od_volt_freq_data_t structure * If this parameter is nullptr, this function will return @@ -2271,17 +2271,17 @@ amdsmi_status_t amdsmi_dev_reset_gpu(amdsmi_processor_handle device_handle); * * @return ::amdsmi_status_t | ::AMDSMI_STATUS_SUCCESS on success, non-zero on fail */ -amdsmi_status_t amdsmi_dev_get_od_volt_info(amdsmi_processor_handle device_handle, +amdsmi_status_t amdsmi_dev_get_od_volt_info(amdsmi_processor_handle processor_handle, amdsmi_od_volt_freq_data_t *odv); /** * @brief This function retrieves the gpu metrics information * - * @details Given a device handle @p device_handle and a pointer to a + * @details Given a device handle @p processor_handle and a pointer to a * ::amdsmi_gpu_metrics_t structure @p pgpu_metrics, this function will populate * @p pgpu_metrics. See ::amdsmi_gpu_metrics_t for more details. * - * @param[in] device_handle a device handle + * @param[in] processor_handle a device handle * * @param[in,out] pgpu_metrics a pointer to an ::amdsmi_gpu_metrics_t structure * If this parameter is nullptr, this function will return @@ -2291,17 +2291,17 @@ amdsmi_status_t amdsmi_dev_get_od_volt_info(amdsmi_processor_handle device_hand * * @return ::amdsmi_status_t | ::AMDSMI_STATUS_SUCCESS on success, non-zero on fail */ -amdsmi_status_t amdsmi_dev_get_gpu_metrics_info(amdsmi_processor_handle device_handle, +amdsmi_status_t amdsmi_dev_get_gpu_metrics_info(amdsmi_processor_handle processor_handle, amdsmi_gpu_metrics_t *pgpu_metrics); /** * @brief This function sets the clock range information * - * @details Given a device handle @p device_handle, a minimum clock value @p minclkvalue, + * @details Given a device handle @p processor_handle, a minimum clock value @p minclkvalue, * a maximum clock value @p maxclkvalue and a clock type @p clkType this function * will set the sclk|mclk range * - * @param[in] device_handle a device handle + * @param[in] processor_handle a device handle * * @param[in] minclkvalue value to apply to the clock range. Frequency values * are in MHz. @@ -2313,18 +2313,18 @@ amdsmi_status_t amdsmi_dev_get_gpu_metrics_info(amdsmi_processor_handle device_ * * @return ::amdsmi_status_t | ::AMDSMI_STATUS_SUCCESS on success, non-zero on fail */ -amdsmi_status_t amdsmi_dev_set_clk_range(amdsmi_processor_handle device_handle, uint64_t minclkvalue, +amdsmi_status_t amdsmi_dev_set_clk_range(amdsmi_processor_handle processor_handle, uint64_t minclkvalue, uint64_t maxclkvalue, amdsmi_clk_type_t clkType); /** * @brief This function sets the clock frequency information * - * @details Given a device handle @p device_handle, a frequency level @p level, + * @details Given a device handle @p processor_handle, a frequency level @p level, * a clock value @p clkvalue and a clock type @p clkType this function * will set the sclk|mclk range * - * @param[in] device_handle a device handle + * @param[in] processor_handle a device handle * * @param[in] level AMDSMI_FREQ_IND_MIN|AMDSMI_FREQ_IND_MAX to set the * minimum (0) or maximum (1) speed. @@ -2336,17 +2336,17 @@ amdsmi_status_t amdsmi_dev_set_clk_range(amdsmi_processor_handle device_handle, * * @return ::amdsmi_status_t | ::AMDSMI_STATUS_SUCCESS on success, non-zero on fail */ -amdsmi_status_t amdsmi_dev_set_od_clk_info(amdsmi_processor_handle device_handle, amdsmi_freq_ind_t level, +amdsmi_status_t amdsmi_dev_set_od_clk_info(amdsmi_processor_handle processor_handle, amdsmi_freq_ind_t level, uint64_t clkvalue, amdsmi_clk_type_t clkType); /** * @brief This function sets 1 of the 3 voltage curve points. * - * @details Given a device handle @p device_handle, a voltage point @p vpoint + * @details Given a device handle @p processor_handle, a voltage point @p vpoint * and a voltage value @p voltvalue this function will set voltage curve point * - * @param[in] device_handle a device handle + * @param[in] processor_handle a device handle * * @param[in] vpoint voltage point [0|1|2] on the voltage curve * @@ -2358,14 +2358,14 @@ amdsmi_status_t amdsmi_dev_set_od_clk_info(amdsmi_processor_handle device_handl * * @return ::amdsmi_status_t | ::AMDSMI_STATUS_SUCCESS on success, non-zero on fail */ -amdsmi_status_t amdsmi_dev_set_od_volt_info(amdsmi_processor_handle device_handle, uint32_t vpoint, +amdsmi_status_t amdsmi_dev_set_od_volt_info(amdsmi_processor_handle processor_handle, uint32_t vpoint, uint64_t clkvalue, uint64_t voltvalue); /** * @brief This function will retrieve the current valid regions in the * frequency/voltage space. * - * @details Given a device handle @p device_handle, a pointer to an unsigned integer + * @details Given a device handle @p processor_handle, a pointer to an unsigned integer * @p num_regions and a buffer of ::amdsmi_freq_volt_region_t structures, @p * buffer, this function will populate @p buffer with the current * frequency-volt space regions. The caller should assign @p buffer to memory @@ -2376,7 +2376,7 @@ amdsmi_status_t amdsmi_dev_set_od_volt_info(amdsmi_processor_handle device_hand * The number of regions to expect this function provide (@p num_regions) can * be obtained by calling :: amdsmi_dev_get_od_volt_info(). * - * @param[in] device_handle a device handle + * @param[in] processor_handle a device handle * * @param[in,out] num_regions As input, this is the number of * ::amdsmi_freq_volt_region_t structures that can be written to @p buffer. As @@ -2396,14 +2396,14 @@ amdsmi_status_t amdsmi_dev_set_od_volt_info(amdsmi_processor_handle device_hand * * @return ::amdsmi_status_t | ::AMDSMI_STATUS_SUCCESS on success, non-zero on fail */ -amdsmi_status_t amdsmi_dev_get_od_volt_curve_regions(amdsmi_processor_handle device_handle, +amdsmi_status_t amdsmi_dev_get_od_volt_curve_regions(amdsmi_processor_handle processor_handle, uint32_t *num_regions, amdsmi_freq_volt_region_t *buffer); /** * @brief Get the list of available preset power profiles and an indication of * which profile is currently active. * - * @details Given a device handle @p device_handle and a pointer to a + * @details Given a device handle @p processor_handle and a pointer to a * ::amdsmi_power_profile_status_t @p status, this function will set the bits of * the ::amdsmi_power_profile_status_t.available_profiles bit field of @p status to * 1 if the profile corresponding to the respective @@ -2416,7 +2416,7 @@ amdsmi_status_t amdsmi_dev_get_od_volt_curve_regions(amdsmi_processor_handle de * ::amdsmi_power_profile_status_t.current will be set to the * ::amdsmi_power_profile_preset_masks_t of the profile that is currently active. * - * @param[in] device_handle a device handle + * @param[in] processor_handle a device handle * * @param[in] sensor_ind a 0-based sensor index. Normally, this will be 0. * If a device has more than one sensor, it could be greater than 0. @@ -2431,7 +2431,7 @@ amdsmi_status_t amdsmi_dev_get_od_volt_curve_regions(amdsmi_processor_handle de * @return ::amdsmi_status_t | ::AMDSMI_STATUS_SUCCESS on success, non-zero on fail */ amdsmi_status_t - amdsmi_dev_get_power_profile_presets(amdsmi_processor_handle device_handle, uint32_t sensor_ind, + amdsmi_dev_get_power_profile_presets(amdsmi_processor_handle processor_handle, uint32_t sensor_ind, amdsmi_power_profile_status_t *status); /** @} End PerfQuer */ @@ -2450,39 +2450,39 @@ amdsmi_status_t * @deprecated :: amdsmi_dev_set_perf_level_v1() is preferred, with an * interface that more closely matches the rest of the amd_smi API. * - * @details Given a device handle @p device_handle and an ::amdsmi_dev_perf_level_t @p + * @details Given a device handle @p processor_handle and an ::amdsmi_dev_perf_level_t @p * perf_level, this function will set the PowerPlay performance level for the * device to the value @p perf_lvl. * * @note This function requires root access * - * @param[in] device_handle a device handle + * @param[in] processor_handle a device handle * * @param[in] perf_lvl the value to which the performance level should be set * * @return ::amdsmi_status_t | ::AMDSMI_STATUS_SUCCESS on success, non-zero on fail */ amdsmi_status_t - amdsmi_dev_set_perf_level(amdsmi_processor_handle device_handle, amdsmi_dev_perf_level_t perf_lvl); + amdsmi_dev_set_perf_level(amdsmi_processor_handle processor_handle, amdsmi_dev_perf_level_t perf_lvl); /** * @brief Set the PowerPlay performance level associated with the device with * provided device handle with the provided value. * - * @details Given a device handle @p device_handle and an ::amdsmi_dev_perf_level_t @p + * @details Given a device handle @p processor_handle and an ::amdsmi_dev_perf_level_t @p * perf_level, this function will set the PowerPlay performance level for the * device to the value @p perf_lvl. * * @note This function requires root access * - * @param[in] device_handle a device handle + * @param[in] processor_handle a device handle * * @param[in] perf_lvl the value to which the performance level should be set * * @return ::amdsmi_status_t | ::AMDSMI_STATUS_SUCCESS on success, non-zero on fail */ amdsmi_status_t - amdsmi_dev_set_perf_level_v1(amdsmi_processor_handle device_handle, amdsmi_dev_perf_level_t perf_lvl); + amdsmi_dev_set_perf_level_v1(amdsmi_processor_handle processor_handle, amdsmi_dev_perf_level_t perf_lvl); /** * @brief Set the overdrive percent associated with the device with provided @@ -2492,7 +2492,7 @@ amdsmi_status_t * has the same functionaltiy, with an interface that more closely * matches the rest of the amd_smi API. * - * @details Given a device handle @p device_handle and an overdrive level @p od, + * @details Given a device handle @p processor_handle and an overdrive level @p od, * this function will set the overdrive level for the device to the value * @p od. The overdrive level is an integer value between 0 and 20, inclusive, * which represents the overdrive percentage; e.g., a value of 5 specifies @@ -2517,19 +2517,19 @@ amdsmi_status_t * WARRANTY AND MAY NOT BE COVERED BY YOUR BOARD OR SYSTEM MANUFACTURER'S * WARRANTY. Please use this utility with caution. * - * @param[in] device_handle a device handle + * @param[in] processor_handle a device handle * * @param[in] od the value to which the overdrive level should be set * * @return ::amdsmi_status_t | ::AMDSMI_STATUS_SUCCESS on success, non-zero on fail */ -amdsmi_status_t amdsmi_dev_set_overdrive_level(amdsmi_processor_handle device_handle, uint32_t od); +amdsmi_status_t amdsmi_dev_set_overdrive_level(amdsmi_processor_handle processor_handle, uint32_t od); /** * @brief Set the overdrive percent associated with the device with provided * device handle with the provided value. See details for WARNING. * - * @details Given a device handle @p device_handle and an overdrive level @p od, + * @details Given a device handle @p processor_handle and an overdrive level @p od, * this function will set the overdrive level for the device to the value * @p od. The overdrive level is an integer value between 0 and 20, inclusive, * which represents the overdrive percentage; e.g., a value of 5 specifies @@ -2556,19 +2556,19 @@ amdsmi_status_t amdsmi_dev_set_overdrive_level(amdsmi_processor_handle device_h * * @note This function requires root access * - * @param[in] device_handle a device handle + * @param[in] processor_handle a device handle * * @param[in] od the value to which the overdrive level should be set * * @return ::amdsmi_status_t | ::AMDSMI_STATUS_SUCCESS on success, non-zero on fail */ -amdsmi_status_t amdsmi_dev_set_overdrive_level_v1(amdsmi_processor_handle device_handle, uint32_t od); +amdsmi_status_t amdsmi_dev_set_overdrive_level_v1(amdsmi_processor_handle processor_handle, uint32_t od); /** * @brief Control the set of allowed frequencies that can be used for the * specified clock. * - * @details Given a device handle @p device_handle, a clock type @p clk_type, and a + * @details Given a device handle @p processor_handle, a clock type @p clk_type, and a * 64 bit bitmask @p freq_bitmask, this function will limit the set of * allowable frequencies. If a bit in @p freq_bitmask has a value of 1, then * the frequency (as ordered in an ::amdsmi_frequencies_t returned by @@ -2585,7 +2585,7 @@ amdsmi_status_t amdsmi_dev_set_overdrive_level_v1(amdsmi_processor_handle devic * * @note This function requires root access * - * @param[in] device_handle a device handle + * @param[in] processor_handle a device handle * * @param[in] clk_type the type of clock for which the set of frequencies * will be modified @@ -2596,7 +2596,7 @@ amdsmi_status_t amdsmi_dev_set_overdrive_level_v1(amdsmi_processor_handle devic * * @return ::amdsmi_status_t | ::AMDSMI_STATUS_SUCCESS on success, non-zero on fail */ -amdsmi_status_t amdsmi_dev_set_clk_freq(amdsmi_processor_handle device_handle, +amdsmi_status_t amdsmi_dev_set_clk_freq(amdsmi_processor_handle processor_handle, amdsmi_clk_type_t clk_type, uint64_t freq_bitmask); /** @} End PerfCont */ @@ -2661,12 +2661,12 @@ amdsmi_get_version_str(amdsmi_sw_component_t component, char *ver_str, /** * @brief Retrieve the error counts for a GPU block * - * @details Given a device handle @p device_handle, an ::amdsmi_gpu_block_t @p block and a + * @details Given a device handle @p processor_handle, an ::amdsmi_gpu_block_t @p block and a * pointer to an ::amdsmi_error_count_t @p ec, this function will write the error * count values for the GPU block indicated by @p block to memory pointed to by * @p ec. * - * @param[in] device_handle a device handle + * @param[in] processor_handle a device handle * * @param[in] block The block for which error counts should be retrieved * @@ -2679,13 +2679,13 @@ amdsmi_get_version_str(amdsmi_sw_component_t component, char *ver_str, * * @return ::amdsmi_status_t | ::AMDSMI_STATUS_SUCCESS on success, non-zero on fail */ -amdsmi_status_t amdsmi_dev_get_ecc_count(amdsmi_processor_handle device_handle, +amdsmi_status_t amdsmi_dev_get_ecc_count(amdsmi_processor_handle processor_handle, amdsmi_gpu_block_t block, amdsmi_error_count_t *ec); /** * @brief Retrieve the enabled ECC bit-mask * - * @details Given a device handle @p device_handle, and a pointer to a uint64_t @p + * @details Given a device handle @p processor_handle, and a pointer to a uint64_t @p * enabled_mask, this function will write bits to memory pointed to by * @p enabled_blocks. Upon a successful call, @p enabled_blocks can then be * AND'd with elements of the ::amdsmi_gpu_block_t ennumeration to determine if @@ -2695,7 +2695,7 @@ amdsmi_status_t amdsmi_dev_get_ecc_count(amdsmi_processor_handle device_handle, * but there may not be kernel support for reading error counters for that * block. * - * @param[in] device_handle a device handle + * @param[in] processor_handle a device handle * * @param[in,out] enabled_blocks A pointer to a uint64_t to which the enabled * blocks bits will be written. @@ -2706,18 +2706,18 @@ amdsmi_status_t amdsmi_dev_get_ecc_count(amdsmi_processor_handle device_handle, * * @return ::amdsmi_status_t | ::AMDSMI_STATUS_SUCCESS on success, non-zero on fail */ -amdsmi_status_t amdsmi_dev_get_ecc_enabled(amdsmi_processor_handle device_handle, +amdsmi_status_t amdsmi_dev_get_ecc_enabled(amdsmi_processor_handle processor_handle, uint64_t *enabled_blocks); /** * @brief Retrieve the ECC status for a GPU block * - * @details Given a device handle @p device_handle, an ::amdsmi_gpu_block_t @p block and + * @details Given a device handle @p processor_handle, an ::amdsmi_gpu_block_t @p block and * a pointer to an ::amdsmi_ras_err_state_t @p state, this function will write * the current state for the GPU block indicated by @p block to memory pointed * to by @p state. * - * @param[in] device_handle a device handle + * @param[in] processor_handle a device handle * * @param[in] block The block for which error counts should be retrieved * @@ -2730,7 +2730,7 @@ amdsmi_status_t amdsmi_dev_get_ecc_enabled(amdsmi_processor_handle device_handl * * @return ::amdsmi_status_t | ::AMDSMI_STATUS_SUCCESS on success, non-zero on fail */ -amdsmi_status_t amdsmi_dev_get_ecc_status(amdsmi_processor_handle device_handle, amdsmi_gpu_block_t block, +amdsmi_status_t amdsmi_dev_get_ecc_status(amdsmi_processor_handle processor_handle, amdsmi_gpu_block_t block, amdsmi_ras_err_state_t *state); /** @@ -2856,11 +2856,11 @@ amdsmi_status_string(amdsmi_status_t status, const char **status_string); /** * @brief Tell if an event group is supported by a given device * - * @details Given a device handle @p device_handle and an event group specifier @p + * @details Given a device handle @p processor_handle and an event group specifier @p * group, tell if @p group type events are supported by the device associated - * with @p device_handle + * with @p processor_handle * - * @param[in] device_handle device handle of device being queried + * @param[in] processor_handle device handle of device being queried * * @param[in] group ::amdsmi_event_group_t identifier of group for which support * is being queried @@ -2868,20 +2868,20 @@ amdsmi_status_string(amdsmi_status_t status, const char **status_string); * @return ::amdsmi_status_t | ::AMDSMI_STATUS_SUCCESS on success, non-zero on fail */ amdsmi_status_t -amdsmi_dev_counter_group_supported(amdsmi_processor_handle device_handle, amdsmi_event_group_t group); +amdsmi_dev_counter_group_supported(amdsmi_processor_handle processor_handle, amdsmi_event_group_t group); /** * @brief Create a performance counter object * * @details Create a performance counter object of type @p type for the device - * with a device handle of @p device_handle, and write a handle to the object to the + * with a device handle of @p processor_handle, and write a handle to the object to the * memory location pointed to by @p evnt_handle. @p evnt_handle can be used * with other performance event operations. The handle should be deallocated * with ::amdsmi_dev_destroy_counter() when no longer needed. * * @note This function requires root access * - * @param[in] device_handle a device handle + * @param[in] processor_handle a device handle * * @param[in] type the ::amdsmi_event_type_t of performance event to create * @@ -2895,7 +2895,7 @@ amdsmi_dev_counter_group_supported(amdsmi_processor_handle device_handle, amdsmi * @return ::amdsmi_status_t | ::AMDSMI_STATUS_SUCCESS on success, non-zero on fail */ amdsmi_status_t -amdsmi_dev_create_counter(amdsmi_processor_handle device_handle, amdsmi_event_type_t type, +amdsmi_dev_create_counter(amdsmi_processor_handle processor_handle, amdsmi_event_type_t type, amdsmi_event_handle_t *evnt_handle); /** @@ -2956,12 +2956,12 @@ amdsmi_read_counter(amdsmi_event_handle_t evt_handle, /** * @brief Get the number of currently available counters * - * @details Given a device handle @p device_handle, a performance event group @p grp, + * @details Given a device handle @p processor_handle, a performance event group @p grp, * and a pointer to a uint32_t @p available, this function will write the * number of @p grp type counters that are available on the device with handle - * @p device_handle to the memory that @p available points to. + * @p processor_handle to the memory that @p available points to. * - * @param[in] device_handle a device handle + * @param[in] processor_handle a device handle * * @param[in] grp an event device group * @@ -2971,7 +2971,7 @@ amdsmi_read_counter(amdsmi_event_handle_t evt_handle, * @return ::amdsmi_status_t | ::AMDSMI_STATUS_SUCCESS on success, non-zero on fail */ amdsmi_status_t - amdsmi_counter_get_available_counters(amdsmi_processor_handle device_handle, + amdsmi_counter_get_available_counters(amdsmi_processor_handle processor_handle, amdsmi_event_group_t grp, uint32_t *available); /** @} End PerfCntr */ @@ -3036,14 +3036,14 @@ amdsmi_get_compute_process_info_by_pid(uint32_t pid, amdsmi_process_info_t *proc * @brief Get the device indices currently being used by a process * * @details Given a process id @p pid, a non-NULL pointer to an array of - * uint32_t's @p device_handleices of length *@p num_devices, this function will + * uint32_t's @p processor_handleices of length *@p num_devices, this function will * write up to @p num_devices device indices to the memory pointed to by - * @p device_handleices. If @p device_handleices is not NULL, @p num_devices will be + * @p processor_handleices. If @p processor_handleices is not NULL, @p num_devices will be * updated with the number of gpu's currently being used by process @p pid. - * If @p device_handleices is NULL, @p device_handleices will be updated with the number of + * If @p processor_handleices is NULL, @p processor_handleices will be updated with the number of * gpus currently being used by @p pid. Calling this function with @p * dv_indices being NULL is a way to determine how much memory is required - * for when @p device_handleices is not NULL. + * for when @p processor_handleices is not NULL. * * @param[in] pid The process id of the process for which the number of gpus * currently being used is requested @@ -3055,8 +3055,8 @@ amdsmi_get_compute_process_info_by_pid(uint32_t pid, amdsmi_process_info_t *proc * * @param[in,out] num_devices A pointer to a uint32_t, which on input, should * contain the amount of memory in uint32_t's which have been provided by the - * @p device_handleices argument. On output, if @p device_handleices is non-NULL, this will - * be updated with the number uint32_t's actually written. If @p device_handleices is + * @p processor_handleices argument. On output, if @p processor_handleices is non-NULL, this will + * be updated with the number uint32_t's actually written. If @p processor_handleices is * NULL, this argument will be updated with the number devices being used. * * @return ::amdsmi_status_t | ::AMDSMI_STATUS_SUCCESS on success, non-zero on fail @@ -3076,12 +3076,12 @@ amdsmi_get_compute_process_gpus(uint32_t pid, uint32_t *dv_indices, /** * @brief Retrieve the XGMI error status for a device * - * @details Given a device handle @p device_handle, and a pointer to an + * @details Given a device handle @p processor_handle, and a pointer to an * ::amdsmi_xgmi_status_t @p status, this function will write the current XGMI - * error state ::amdsmi_xgmi_status_t for the device @p device_handle to the memory + * error state ::amdsmi_xgmi_status_t for the device @p processor_handle to the memory * pointed to by @p status. * - * @param[in] device_handle a device handle + * @param[in] processor_handle a device handle * * @param[in,out] status A pointer to an ::amdsmi_xgmi_status_t to which the * XGMI error state should be written @@ -3093,21 +3093,21 @@ amdsmi_get_compute_process_gpus(uint32_t pid, uint32_t *dv_indices, * @return ::amdsmi_status_t | ::AMDSMI_STATUS_SUCCESS on success, non-zero on fail */ amdsmi_status_t -amdsmi_dev_xgmi_error_status(amdsmi_processor_handle device_handle, amdsmi_xgmi_status_t *status); +amdsmi_dev_xgmi_error_status(amdsmi_processor_handle processor_handle, amdsmi_xgmi_status_t *status); /** * @brief Reset the XGMI error status for a device * - * @details Given a device handle @p device_handle, this function will reset the - * current XGMI error state ::amdsmi_xgmi_status_t for the device @p device_handle to + * @details Given a device handle @p processor_handle, this function will reset the + * current XGMI error state ::amdsmi_xgmi_status_t for the device @p processor_handle to * amdsmi_xgmi_status_t::AMDSMI_XGMI_STATUS_NO_ERRORS * - * @param[in] device_handle a device handle + * @param[in] processor_handle a device handle * * @return ::amdsmi_status_t | ::AMDSMI_STATUS_SUCCESS on success, non-zero on fail */ amdsmi_status_t -amdsmi_dev_reset_xgmi_error(amdsmi_processor_handle device_handle); +amdsmi_dev_reset_xgmi_error(amdsmi_processor_handle processor_handle); /** @} End SysInfo */ @@ -3120,12 +3120,12 @@ amdsmi_dev_reset_xgmi_error(amdsmi_processor_handle device_handle); /** * @brief Retrieve the NUMA CPU node number for a device * - * @details Given a device handle @p device_handle, and a pointer to an + * @details Given a device handle @p processor_handle, and a pointer to an * uint32_t @p numa_node, this function will write the - * node number of NUMA CPU for the device @p device_handle to the memory + * node number of NUMA CPU for the device @p processor_handle to the memory * pointed to by @p numa_node. * - * @param[in] device_handle a device handle + * @param[in] processor_handle a device handle * * @param[in,out] numa_node A pointer to an uint32_t to which the * numa node number should be written. @@ -3133,20 +3133,20 @@ amdsmi_dev_reset_xgmi_error(amdsmi_processor_handle device_handle); * @return ::amdsmi_status_t | ::AMDSMI_STATUS_SUCCESS on success, non-zero on fail */ amdsmi_status_t -amdsmi_topo_get_numa_node_number(amdsmi_processor_handle device_handle, uint32_t *numa_node); +amdsmi_topo_get_numa_node_number(amdsmi_processor_handle processor_handle, uint32_t *numa_node); /** * @brief Retrieve the weight for a connection between 2 GPUs * - * @details Given a source device handle @p device_handle_src and - * a destination device handle @p device_handle_dst, and a pointer to an + * @details Given a source device handle @p processor_handle_src and + * a destination device handle @p processor_handle_dst, and a pointer to an * uint64_t @p weight, this function will write the - * weight for the connection between the device @p device_handle_src - * and @p device_handle_dst to the memory pointed to by @p weight. + * weight for the connection between the device @p processor_handle_src + * and @p processor_handle_dst to the memory pointed to by @p weight. * - * @param[in] device_handle_src the source device handle + * @param[in] processor_handle_src the source device handle * - * @param[in] device_handle_dst the destination device handle + * @param[in] processor_handle_dst the destination device handle * * @param[in,out] weight A pointer to an uint64_t to which the * weight for the connection should be written. @@ -3154,21 +3154,21 @@ amdsmi_topo_get_numa_node_number(amdsmi_processor_handle device_handle, uint32_t * @return ::amdsmi_status_t | ::AMDSMI_STATUS_SUCCESS on success, non-zero on fail */ amdsmi_status_t -amdsmi_topo_get_link_weight(amdsmi_processor_handle device_handle_src, amdsmi_processor_handle device_handle_dst, +amdsmi_topo_get_link_weight(amdsmi_processor_handle processor_handle_src, amdsmi_processor_handle processor_handle_dst, uint64_t *weight); /** * @brief Retreive minimal and maximal io link bandwidth between 2 GPUs * - * @details Given a source device handle @p device_handle_src and - * a destination device handle @p device_handle_dst, pointer to an + * @details Given a source device handle @p processor_handle_src and + * a destination device handle @p processor_handle_dst, pointer to an * uint64_t @p min_bandwidth, and a pointer to uint64_t @p max_bandiwidth, * this function will write theoretical minimal and maximal bandwidth limits. * API works if src and dst are connected via xgmi and have 1 hop distance. * - * @param[in] device_handle_src the source device handle + * @param[in] processor_handle_src the source device handle * - * @param[in] device_handle_dst the destination device handle + * @param[in] processor_handle_dst the destination device handle * * @param[in,out] min_bandwidth A pointer to an uint64_t to which the * minimal bandwidth for the connection should be written. @@ -3179,22 +3179,22 @@ amdsmi_topo_get_link_weight(amdsmi_processor_handle device_handle_src, amdsmi_pr * @return ::amdsmi_status_t | ::AMDSMI_STATUS_SUCCESS on success, non-zero on fail */ amdsmi_status_t - amdsmi_get_minmax_bandwidth(amdsmi_processor_handle device_handle_src, amdsmi_processor_handle device_handle_dst, + amdsmi_get_minmax_bandwidth(amdsmi_processor_handle processor_handle_src, amdsmi_processor_handle processor_handle_dst, uint64_t *min_bandwidth, uint64_t *max_bandwidth); /** * @brief Retrieve the hops and the connection type between 2 GPUs * - * @details Given a source device handle @p device_handle_src and - * a destination device handle @p device_handle_dst, and a pointer to an + * @details Given a source device handle @p processor_handle_src and + * a destination device handle @p processor_handle_dst, and a pointer to an * uint64_t @p hops and a pointer to an AMDSMI_IO_LINK_TYPE @p type, * this function will write the number of hops and the connection type - * between the device @p device_handle_src and @p device_handle_dst to the memory + * between the device @p processor_handle_src and @p processor_handle_dst to the memory * pointed to by @p hops and @p type. * - * @param[in] device_handle_src the source device handle + * @param[in] processor_handle_src the source device handle * - * @param[in] device_handle_dst the destination device handle + * @param[in] processor_handle_dst the destination device handle * * @param[in,out] hops A pointer to an uint64_t to which the * hops for the connection should be written. @@ -3205,22 +3205,22 @@ amdsmi_status_t * @return ::amdsmi_status_t | ::AMDSMI_STATUS_SUCCESS on success, non-zero on fail */ amdsmi_status_t -amdsmi_topo_get_link_type(amdsmi_processor_handle device_handle_src, - amdsmi_processor_handle device_handle_dst, +amdsmi_topo_get_link_type(amdsmi_processor_handle processor_handle_src, + amdsmi_processor_handle processor_handle_dst, uint64_t *hops, AMDSMI_IO_LINK_TYPE *type); /** * @brief Return P2P availability status between 2 GPUs * - * @details Given a source device handle @p device_handle_src and - * a destination device handle @p device_handle_dst, and a pointer to a + * @details Given a source device handle @p processor_handle_src and + * a destination device handle @p processor_handle_dst, and a pointer to a * bool @p accessible, this function will write the P2P connection status - * between the device @p device_handle_src and @p device_handle_dst to the memory + * between the device @p processor_handle_src and @p processor_handle_dst to the memory * pointed to by @p accessible. * - * @param[in] device_handle_src the source device handle + * @param[in] processor_handle_src the source device handle * - * @param[in] device_handle_dst the destination device handle + * @param[in] processor_handle_dst the destination device handle * * @param[in,out] accessible A pointer to a bool to which the status for * the P2P connection availablity should be written. @@ -3228,7 +3228,7 @@ amdsmi_topo_get_link_type(amdsmi_processor_handle device_handle_src, * @return ::amdsmi_status_t | ::AMDSMI_STATUS_SUCCESS on success, non-zero on fail */ amdsmi_status_t -amdsmi_is_P2P_accessible(amdsmi_processor_handle device_handle_src, amdsmi_processor_handle device_handle_dst, +amdsmi_is_P2P_accessible(amdsmi_processor_handle processor_handle_src, amdsmi_processor_handle processor_handle_dst, bool *accessible); /** @} End HWTopo */ @@ -3279,7 +3279,7 @@ amdsmi_is_P2P_accessible(amdsmi_processor_handle device_handle_src, amdsmi_proce * amdsmi_status_t err; * amdsmi_processor_handle device; * - * // Get the device handle via amdsmi_get_device_handles() + * // Get the device handle via amdsmi_get_processor_handles() * // ... ... * * std::cout << "Supported AMDSMI Functions:" << std::endl; * @@ -3347,17 +3347,17 @@ amdsmi_is_P2P_accessible(amdsmi_processor_handle device_handle_src, amdsmi_proce /** * @brief Get a function name iterator of supported AMDSMI functions for a device * - * @details Given a device handle @p device_handle, this function will write a function + * @details Given a device handle @p processor_handle, this function will write a function * iterator handle to the caller-provided memory pointed to by @p handle. This * handle can be used to iterate through all the supported functions. * - * Note that although this function takes in @p device_handle as an argument, + * Note that although this function takes in @p processor_handle as an argument, * ::amdsmi_dev_open_supported_func_iterator itself will not be among the * functions listed as supported. This is because * ::amdsmi_dev_open_supported_func_iterator does not depend on hardware or * driver support and should always be supported. * - * @param[in] device_handle a device handle of device for which support information is + * @param[in] processor_handle a device handle of device for which support information is * requested * * @param[in,out] handle A pointer to caller-provided memory to which the @@ -3366,7 +3366,7 @@ amdsmi_is_P2P_accessible(amdsmi_processor_handle device_handle_src, amdsmi_proce * @return ::amdsmi_status_t | ::AMDSMI_STATUS_SUCCESS on success, non-zero on fail */ amdsmi_status_t -amdsmi_dev_open_supported_func_iterator(amdsmi_processor_handle device_handle, +amdsmi_dev_open_supported_func_iterator(amdsmi_processor_handle processor_handle, amdsmi_func_id_iter_handle_t *handle); /** @@ -3461,27 +3461,27 @@ amdsmi_get_func_iter_value(amdsmi_func_id_iter_handle_t handle, * @brief Prepare to collect event notifications for a GPU * * @details This function prepares to collect events for the GPU with device - * ID @p device_handle, by initializing any required system parameters. This call + * ID @p processor_handle, by initializing any required system parameters. This call * may open files which will remain open until ::amdsmi_stop_event_notification() * is called. * - * @param device_handle a device handle corresponding to the device on which to + * @param processor_handle a device handle corresponding to the device on which to * listen for events * * @return ::amdsmi_status_t | ::AMDSMI_STATUS_SUCCESS on success, non-zero on fail */ amdsmi_status_t -amdsmi_init_event_notification(amdsmi_processor_handle device_handle); +amdsmi_init_event_notification(amdsmi_processor_handle processor_handle); /** * @brief Specify which events to collect for a device * - * @details Given a device handle @p device_handle and a @p mask consisting of + * @details Given a device handle @p processor_handle and a @p mask consisting of * elements of ::amdsmi_evt_notification_type_t OR'd together, this function * will listen for the events specified in @p mask on the device - * corresponding to @p device_handle. + * corresponding to @p processor_handle. * - * @param device_handle a device handle corresponding to the device on which to + * @param processor_handle a device handle corresponding to the device on which to * listen for events * * @param mask Bitmask generated by OR'ing 1 or more elements of @@ -3500,7 +3500,7 @@ amdsmi_init_event_notification(amdsmi_processor_handle device_handle); * @return ::amdsmi_status_t | ::AMDSMI_STATUS_SUCCESS on success, non-zero on fail */ amdsmi_status_t - amdsmi_set_event_notification_mask(amdsmi_processor_handle device_handle, uint64_t mask); + amdsmi_set_event_notification_mask(amdsmi_processor_handle processor_handle, uint64_t mask); /** * @brief Collect event notifications, waiting a specified amount of time @@ -3546,35 +3546,35 @@ amdsmi_status_t * notification for a GPU * * @details Any resources used by event notification for the GPU with - * device handle @p device_handle will be free with this + * device handle @p processor_handle will be free with this * function. This includes freeing any memory and closing file handles. This * should be called for every call to ::amdsmi_init_event_notification() * - * @param[in] device_handle The device handle of the GPU for which event + * @param[in] processor_handle The device handle of the GPU for which event * notification resources will be free * * @return ::amdsmi_status_t | ::AMDSMI_STATUS_SUCCESS on success, non-zero on fail */ -amdsmi_status_t amdsmi_stop_event_notification(amdsmi_processor_handle device_handle); +amdsmi_status_t amdsmi_stop_event_notification(amdsmi_processor_handle processor_handle); /** @} End EvntNotif */ /** * @brief Returns BDF of the given device * - * @param[in] device_handle Device which to query + * @param[in] processor_handle Device which to query * * @param[out] bdf Reference to BDF. Must be allocated by user. * * @return ::amdsmi_status_t | ::AMDSMI_STATUS_SUCCESS on success, non-zero on fail */ amdsmi_status_t -amdsmi_get_device_bdf(amdsmi_processor_handle device_handle, amdsmi_bdf_t *bdf); +amdsmi_get_device_bdf(amdsmi_processor_handle processor_handle, amdsmi_bdf_t *bdf); /** * @brief Returns the UUID of the device * - * @param[in] device_handle Device which to query + * @param[in] processor_handle Device which to query * * @param[in,out] uuid_length Length of the uuid string. As input, must be * equal or greater than SMI_GPU_UUID_SIZE and be allocated by @@ -3586,7 +3586,7 @@ amdsmi_get_device_bdf(amdsmi_processor_handle device_handle, amdsmi_bdf_t *bdf); * @return ::amdsmi_status_t | ::AMDSMI_STATUS_SUCCESS on success, non-zero on fail */ amdsmi_status_t -amdsmi_get_device_uuid(amdsmi_processor_handle device_handle, unsigned int *uuid_length, char *uuid); +amdsmi_get_device_uuid(amdsmi_processor_handle processor_handle, unsigned int *uuid_length, char *uuid); /*****************************************************************************/ /** @defgroup swversion SW Version Information @@ -3596,7 +3596,7 @@ amdsmi_get_device_uuid(amdsmi_processor_handle device_handle, unsigned int *uuid /** * @brief Returns the driver version information * - * @param[in] device_handle Device which to query + * @param[in] processor_handle Device which to query * * @param[in,out] length As input parameter length of the user allocated * string buffer. As output parameter length of the returned @@ -3608,7 +3608,7 @@ amdsmi_get_device_uuid(amdsmi_processor_handle device_handle, unsigned int *uuid * @return ::amdsmi_status_t | ::AMDSMI_STATUS_SUCCESS on success, non-zero on fail */ amdsmi_status_t -amdsmi_get_driver_version(amdsmi_processor_handle device_handle, int *length, char *version); +amdsmi_get_driver_version(amdsmi_processor_handle processor_handle, int *length, char *version); /** @} End swversion */ @@ -3624,7 +3624,7 @@ amdsmi_get_driver_version(amdsmi_processor_handle device_handle, int *length, ch * the family, the vendor ID, the subvendor ID, the device ID, * the revision ID and the serial number. * - * @param[in] device_handle Device which to query + * @param[in] processor_handle Device which to query * * @param[out] info Reference to static asic information structure. * Must be allocated by user. @@ -3632,12 +3632,12 @@ amdsmi_get_driver_version(amdsmi_processor_handle device_handle, int *length, ch * @return ::amdsmi_status_t | ::AMDSMI_STATUS_SUCCESS on success, non-zero on fail */ amdsmi_status_t -amdsmi_get_asic_info(amdsmi_processor_handle device_handle, amdsmi_asic_info_t *info); +amdsmi_get_asic_info(amdsmi_processor_handle processor_handle, amdsmi_asic_info_t *info); /** * @brief Returns the board part number and board information for the requested device * - * @param[in] device_handle Device which to query + * @param[in] processor_handle Device which to query * * @param[out] info Reference to board info structure. * Must be allocated by user. @@ -3645,13 +3645,13 @@ amdsmi_get_asic_info(amdsmi_processor_handle device_handle, amdsmi_asic_info_t * * @return ::amdsmi_status_t | ::AMDSMI_STATUS_SUCCESS on success, non-zero on fail */ amdsmi_status_t -amdsmi_get_board_info(amdsmi_processor_handle device_handle, amdsmi_board_info_t *info); +amdsmi_get_board_info(amdsmi_processor_handle processor_handle, amdsmi_board_info_t *info); /** * @brief Returns the power caps as currently configured in the * system. * - * @param[in] device_handle Device which to query + * @param[in] processor_handle Device which to query * @param[in] sensor_ind A 0-based sensor index. Normally, this will be 0. * If a device has more than one sensor, it could be greater than 0. * @param[out] info Reference to power caps information structure. Must be @@ -3660,13 +3660,13 @@ amdsmi_get_board_info(amdsmi_processor_handle device_handle, amdsmi_board_info_t * @return ::amdsmi_status_t | ::AMDSMI_STATUS_SUCCESS on success, non-zero on fail */ amdsmi_status_t -amdsmi_get_power_cap_info(amdsmi_processor_handle device_handle, uint32_t sensor_ind, +amdsmi_get_power_cap_info(amdsmi_processor_handle processor_handle, uint32_t sensor_ind, amdsmi_power_cap_info_t *info); /** * @brief Returns XGMI information for the GPU. * - * @param[in] device_handle Device which to query + * @param[in] processor_handle Device which to query * * @param[out] info Reference to xgmi information structure. Must be * allocated by user. @@ -3675,13 +3675,13 @@ amdsmi_get_power_cap_info(amdsmi_processor_handle device_handle, uint32_t sensor * @return ::amdsmi_status_t | ::AMDSMI_STATUS_SUCCESS on success, non-zero on fail */ amdsmi_status_t -amdsmi_get_xgmi_info(amdsmi_processor_handle device_handle, amdsmi_xgmi_info_t *info); +amdsmi_get_xgmi_info(amdsmi_processor_handle processor_handle, amdsmi_xgmi_info_t *info); /** * @brief Returns the device capabilities as currently configured in * the system * - * @param[in] device_handle Device which to query + * @param[in] processor_handle Device which to query * * @param[out] info Reference to caps information structure. Must be * allocated by user. @@ -3689,7 +3689,7 @@ amdsmi_get_xgmi_info(amdsmi_processor_handle device_handle, amdsmi_xgmi_info_t * * @return ::amdsmi_status_t | ::AMDSMI_STATUS_SUCCESS on success, non-zero on fail */ amdsmi_status_t -amdsmi_get_caps_info(amdsmi_processor_handle device_handle, amdsmi_gpu_caps_t *info); +amdsmi_get_caps_info(amdsmi_processor_handle processor_handle, amdsmi_gpu_caps_t *info); /** @} End asicinfo */ @@ -3701,19 +3701,19 @@ amdsmi_get_caps_info(amdsmi_processor_handle device_handle, amdsmi_gpu_caps_t *i /** * @brief Returns the firmware versions running on the device. * - * @param[in] device_handle Device which to query + * @param[in] processor_handle Device which to query * * @param[out] info Reference to the fw info. Must be allocated by user. * * @return ::amdsmi_status_t | ::AMDSMI_STATUS_SUCCESS on success, non-zero on fail */ amdsmi_status_t -amdsmi_get_fw_info(amdsmi_processor_handle device_handle, amdsmi_fw_info_t *info); +amdsmi_get_fw_info(amdsmi_processor_handle processor_handle, amdsmi_fw_info_t *info); /** * @brief Returns the static information for the vBIOS on the device. * - * @param[in] device_handle Device which to query + * @param[in] processor_handle Device which to query * * @param[out] info Reference to static vBIOS information. * Must be allocated by user. @@ -3721,7 +3721,7 @@ amdsmi_get_fw_info(amdsmi_processor_handle device_handle, amdsmi_fw_info_t *info * @return ::amdsmi_status_t | ::AMDSMI_STATUS_SUCCESS on success, non-zero on fail */ amdsmi_status_t -amdsmi_get_vbios_info(amdsmi_processor_handle device_handle, amdsmi_vbios_info_t *info); +amdsmi_get_vbios_info(amdsmi_processor_handle processor_handle, amdsmi_vbios_info_t *info); /** @} End fwinfo */ @@ -3734,34 +3734,34 @@ amdsmi_get_vbios_info(amdsmi_processor_handle device_handle, amdsmi_vbios_info_t * @brief Returns the current usage of the GPU engines (GFX, MM and MEM). * Each usage is reported as a percentage from 0-100%. * - * @param[in] device_handle Device which to query + * @param[in] processor_handle Device which to query * * @param[out] info Reference to the gpu engine usage structure. Must be allocated by user. * * @return ::amdsmi_status_t | ::AMDSMI_STATUS_SUCCESS on success, non-zero on fail */ amdsmi_status_t -amdsmi_get_gpu_activity(amdsmi_processor_handle device_handle, amdsmi_engine_usage_t *info); +amdsmi_get_gpu_activity(amdsmi_processor_handle processor_handle, amdsmi_engine_usage_t *info); /** * @brief Returns the current power and voltage of the GPU. * The voltage is in units of mV and the power in units of W. * - * @param[in] device_handle Device which to query + * @param[in] processor_handle Device which to query * * @param[out] info Reference to the gpu power structure. Must be allocated by user. * * @return ::amdsmi_status_t | ::AMDSMI_STATUS_SUCCESS on success, non-zero on fail */ amdsmi_status_t -amdsmi_get_power_measure(amdsmi_processor_handle device_handle, amdsmi_power_measure_t *info); +amdsmi_get_power_measure(amdsmi_processor_handle processor_handle, amdsmi_power_measure_t *info); /** * @brief Returns the measurements of the clocks in the GPU * for the GFX and multimedia engines and Memory. This call * reports the averages over 1s in MHz. * - * @param[in] device_handle Device which to query + * @param[in] processor_handle Device which to query * * @param[in] clk_type Enum representing the clock type to query. * @@ -3771,13 +3771,13 @@ amdsmi_get_power_measure(amdsmi_processor_handle device_handle, amdsmi_power_mea * @return ::amdsmi_status_t | ::AMDSMI_STATUS_SUCCESS on success, non-zero on fail */ amdsmi_status_t -amdsmi_get_clock_measure(amdsmi_processor_handle device_handle, amdsmi_clk_type_t clk_type, amdsmi_clk_measure_t *info); +amdsmi_get_clock_measure(amdsmi_processor_handle processor_handle, amdsmi_clk_type_t clk_type, amdsmi_clk_measure_t *info); /** * @brief Returns the VRAM usage (both total and used memory) * in MegaBytes. * - * @param[in] device_handle Device which to query + * @param[in] processor_handle Device which to query * * * @param[out] info Reference to vram information. @@ -3786,7 +3786,7 @@ amdsmi_get_clock_measure(amdsmi_processor_handle device_handle, amdsmi_clk_type_ * @return ::amdsmi_status_t | ::AMDSMI_STATUS_SUCCESS on success, non-zero on fail */ amdsmi_status_t -amdsmi_get_vram_usage(amdsmi_processor_handle device_handle, amdsmi_vram_info_t *info); +amdsmi_get_vram_usage(amdsmi_processor_handle processor_handle, amdsmi_vram_info_t *info); /** @} End gpumon */ @@ -3799,7 +3799,7 @@ amdsmi_get_vram_usage(amdsmi_processor_handle device_handle, amdsmi_vram_info_t * @brief Returns current and supported frequency range * for the specified clock type. * - * @param[in] device_handle Device which to query + * @param[in] processor_handle Device which to query * * @param[in] clk_type Clock type for which to get current and supported * frequency range. @@ -3810,7 +3810,7 @@ amdsmi_get_vram_usage(amdsmi_processor_handle device_handle, amdsmi_vram_info_t * @return ::amdsmi_status_t | ::AMDSMI_STATUS_SUCCESS on success, non-zero on fail */ amdsmi_status_t -amdsmi_get_target_frequency_range(amdsmi_processor_handle device_handle, amdsmi_clk_type_t clk_type, amdsmi_frequency_range_t *range); +amdsmi_get_target_frequency_range(amdsmi_processor_handle processor_handle, amdsmi_clk_type_t clk_type, amdsmi_frequency_range_t *range); /** @} End powermon */ @@ -3827,7 +3827,7 @@ amdsmi_get_target_frequency_range(amdsmi_processor_handle device_handle, amdsmi_ * sets max_processes to 0, the total number of processes will be * returned. * - * @param[in] device_handle Device which to query + * @param[in] processor_handle Device which to query * * @param[out] list Reference to a user-provided buffer where the process * list will be returned. This buffer must contain at least @@ -3841,13 +3841,13 @@ amdsmi_get_target_frequency_range(amdsmi_processor_handle device_handle, amdsmi_ * @return ::amdsmi_status_t | ::AMDSMI_STATUS_SUCCESS on success, non-zero on fail */ amdsmi_status_t -amdsmi_get_process_list(amdsmi_processor_handle device_handle, amdsmi_process_handle *list, uint32_t *max_processes); +amdsmi_get_process_list(amdsmi_processor_handle processor_handle, amdsmi_process_handle *list, uint32_t *max_processes); /** * @brief Returns the process information of a given process. * Engine usage show how much time the process spend using these engines in ns. * - * @param[in] device_handle Device which to query + * @param[in] processor_handle Device which to query * * @param[in] process Handle of process to query. * @@ -3857,7 +3857,7 @@ amdsmi_get_process_list(amdsmi_processor_handle device_handle, amdsmi_process_ha * @return ::amdsmi_status_t | ::AMDSMI_STATUS_SUCCESS on success, non-zero on fail */ amdsmi_status_t -amdsmi_get_process_info(amdsmi_processor_handle device_handle, amdsmi_process_handle process, amdsmi_proc_info_t *info); +amdsmi_get_process_info(amdsmi_processor_handle processor_handle, amdsmi_process_handle process, amdsmi_proc_info_t *info); /** @} End processinfo */ @@ -3870,7 +3870,7 @@ amdsmi_get_process_info(amdsmi_processor_handle device_handle, amdsmi_process_ha * @brief Returns the number of ECC errors (correctable and * uncorrectable) in the given GPU. * - * @param[in] device_handle Device which to query + * @param[in] processor_handle Device which to query * * @param[out] ec Reference to ecc error count structure. * Must be allocated by user. @@ -3878,7 +3878,7 @@ amdsmi_get_process_info(amdsmi_processor_handle device_handle, amdsmi_process_ha * @return ::amdsmi_status_t | ::AMDSMI_STATUS_SUCCESS on success, non-zero on fail */ amdsmi_status_t -amdsmi_get_ecc_error_count(amdsmi_processor_handle device_handle, amdsmi_error_count_t *ec); +amdsmi_get_ecc_error_count(amdsmi_processor_handle processor_handle, amdsmi_error_count_t *ec); /** @} End eccinfo */ diff --git a/include/amd_smi/impl/amd_smi_system.h b/include/amd_smi/impl/amd_smi_system.h index 53fbf248d5..997d21aafe 100644 --- a/include/amd_smi/impl/amd_smi_system.h +++ b/include/amd_smi/impl/amd_smi_system.h @@ -69,11 +69,11 @@ class AMDSmiSystem { amdsmi_status_t handle_to_socket(amdsmi_socket_handle socket_handle, AMDSmiSocket** socket); - amdsmi_status_t handle_to_device(amdsmi_processor_handle device_handle, + amdsmi_status_t handle_to_device(amdsmi_processor_handle processor_handle, AMDSmiProcessor** device); amdsmi_status_t gpu_index_to_handle(uint32_t gpu_index, - amdsmi_processor_handle* device_handle); + amdsmi_processor_handle* processor_handle); private: AMDSmiSystem() : init_flag_(AMDSMI_INIT_AMD_GPUS) {} diff --git a/py-interface/README.md b/py-interface/README.md index 75394dd900..573c460e89 100644 --- a/py-interface/README.md +++ b/py-interface/README.md @@ -47,7 +47,7 @@ in amdsmi-lib and `err_info` is a string that explains the error that occurred. Example: ```python try: - num_of_GPUs = len(amdsmi_get_device_handles()) + num_of_GPUs = len(amdsmi_get_processor_handles()) if num_of_GPUs == 0: print("No GPUs on machine") except AmdSmiException as e: @@ -115,27 +115,27 @@ Exceptions that can be thrown by `amdsmi_get_device_type` function: Example: ```python try: - type_of_GPU = amdsmi_get_device_type(device_handle) + type_of_GPU = amdsmi_get_device_type(processor_handle) if type_of_GPU == 1: print("This is an AMD GPU") except AmdSmiException as e: print(e) ``` -## amdsmi_get_device_handles +## amdsmi_get_processor_handles Description: Returns list of GPU device handle objects on current machine Input parameters: `None` Output: List of GPU device handle objects -Exceptions that can be thrown by `amdsmi_get_device_handles` function: +Exceptions that can be thrown by `amdsmi_get_processor_handles` function: * `AmdSmiLibraryException` Example: ```python try: - devices = amdsmi_get_device_handles() + devices = amdsmi_get_processor_handles() if len(devices) == 0: print("No GPUs on machine") else: @@ -191,7 +191,7 @@ except AmdSmiException as e: ``` -## amdsmi_get_device_handle_from_bdf +## amdsmi_get_processor_handle_from_bdf Description: Returns device handle from the given BDF Input parameters: bdf string in form of either `::.` or `:.` in hexcode format. @@ -203,14 +203,14 @@ Where: Output: device handle object -Exceptions that can be thrown by `amdsmi_get_device_handle_from_bdf` function: +Exceptions that can be thrown by `amdsmi_get_processor_handle_from_bdf` function: * `AmdSmiLibraryException` * `AmdSmiBdfFormatException` Example: ```python try: - device = amdsmi_get_device_handle_from_bdf("0000:23:00.0") + device = amdsmi_get_processor_handle_from_bdf("0000:23:00.0") print(amdsmi_get_device_uuid(device)) except AmdSmiException as e: print(e) @@ -220,7 +220,7 @@ except AmdSmiException as e: Description: Returns BDF of the given device Input parameters: -* `device_handle` dev for which to query +* `processor_handle` dev for which to query Output: BDF string in form of `::.` in hexcode format. Where: @@ -236,7 +236,7 @@ Exceptions that can be thrown by `amdsmi_get_device_bdf` function: Example: ```python try: - device = amdsmi_get_device_handles()[0] + device = amdsmi_get_processor_handles()[0] print("Device's bdf:", amdsmi_get_device_bdf(device)) except AmdSmiException as e: print(e) @@ -246,7 +246,7 @@ except AmdSmiException as e: Description: Returns the UUID of the device Input parameters: -* `device_handle` dev for which to query +* `processor_handle` dev for which to query Output: UUID string unique to the device @@ -257,7 +257,7 @@ Exceptions that can be thrown by `amdsmi_get_device_uuid` function: Example: ```python try: - device = amdsmi_get_device_handles()[0] + device = amdsmi_get_processor_handles()[0] print("Device UUID: ", amdsmi_get_device_uuid(device)) except AmdSmiException as e: print(e) @@ -267,7 +267,7 @@ except AmdSmiException as e: Description: Returns the version string of the driver Input parameters: -* `device_handle` dev for which to query +* `processor_handle` dev for which to query Output: Driver version string that is handling the device @@ -278,7 +278,7 @@ Exceptions that can be thrown by `amdsmi_get_driver_version` function: Example: ```python try: - device = amdsmi_get_device_handles()[0] + device = amdsmi_get_processor_handles()[0] print("Driver version: ", amdsmi_get_driver_version(device)) except AmdSmiException as e: print(e) @@ -288,7 +288,7 @@ except AmdSmiException as e: Description: Returns asic information for the given GPU Input parameters: -* `device_handle` device which to query +* `processor_handle` device which to query Output: Dictionary with fields @@ -309,7 +309,7 @@ Exceptions that can be thrown by `amdsmi_get_asic_info` function: Example: ```python try: - devices = amdsmi_get_device_handles() + devices = amdsmi_get_processor_handles() if len(devices) == 0: print("No GPUs on machine") else: @@ -329,7 +329,7 @@ Description: Returns dictionary of power capabilities as currently configured on the given GPU Input parameters: -* `device_handle` device which to query +* `processor_handle` device which to query Output: Dictionary with fields @@ -349,7 +349,7 @@ Exceptions that can be thrown by `amdsmi_get_power_cap_info` function: Example: ```python try: - devices = amdsmi_get_device_handles() + devices = amdsmi_get_processor_handles() if len(devices) == 0: print("No GPUs on machine") else: @@ -368,7 +368,7 @@ except AmdSmiException as e: Description: Returns capabilities as currently configured for the given GPU Input parameters: -* `device_handle` device which to query +* `processor_handle` device which to query Output: Dictionary with fields @@ -388,7 +388,7 @@ Exceptions that can be thrown by `amdsmi_get_caps_info` function: Example: ```python try: - devices = amdsmi_get_device_handles() + devices = amdsmi_get_processor_handles() if len(devices) == 0: print("No GPUs on machine") else: @@ -409,7 +409,7 @@ except AmdSmiException as e: Description: Returns the static information for the VBIOS on the device. Input parameters: -* `device_handle` device which to query +* `processor_handle` device which to query Output: Dictionary with fields @@ -429,7 +429,7 @@ Exceptions that can be thrown by `amdsmi_get_vbios_info` function: Example: ```python try: - devices = amdsmi_get_device_handles() + devices = amdsmi_get_processor_handles() if len(devices) == 0: print("No GPUs on machine") else: @@ -448,7 +448,7 @@ except AmdSmiException as e: Description: Returns GPU firmware related information. Input parameters: -* `device_handle` device which to query +* `processor_handle` device which to query Output: Dictionary with fields @@ -464,7 +464,7 @@ Exceptions that can be thrown by `amdsmi_get_fw_info` function: Example: ```python try: - devices = amdsmi_get_device_handles() + devices = amdsmi_get_processor_handles() if len(devices) == 0: print("No GPUs on machine") else: @@ -481,7 +481,7 @@ except AmdSmiException as e: Description: Returns the engine usage for the given GPU Input parameters: -* `device_handle` device which to query +* `processor_handle` device which to query Output: Dictionary with fields @@ -499,7 +499,7 @@ Exceptions that can be thrown by `amdsmi_get_gpu_activity` function: Example: ```python try: - devices = amdsmi_get_device_handles() + devices = amdsmi_get_processor_handles() if len(devices) == 0: print("No GPUs on machine") else: @@ -515,7 +515,7 @@ except AmdSmiException as e: Description: Returns the current power and voltage for the given GPU Input parameters: -* `device_handle` device which to query +* `processor_handle` device which to query Output: Dictionary with fields @@ -534,7 +534,7 @@ Exceptions that can be thrown by `amdsmi_get_power_measure` function: Example: ```python try: - devices = amdsmi_get_device_handles() + devices = amdsmi_get_processor_handles() if len(devices) == 0: print("No GPUs on machine") else: @@ -551,7 +551,7 @@ except AmdSmiException as e: Description: Returns total VRAM and VRAM in use Input parameters: -* `device_handle` device which to query +* `processor_handle` device which to query Output: Dictionary with fields @@ -568,7 +568,7 @@ Exceptions that can be thrown by `amdsmi_get_vram_usage` function: Example: ```python try: - devices = amdsmi_get_device_handles() + devices = amdsmi_get_processor_handles() if len(devices) == 0: print("No GPUs on machine") else: @@ -583,7 +583,7 @@ except AmdSmiException as e: Description: Returns the clock measure for the given GPU Input parameters: -* `device_handle` device which to query +* `processor_handle` device which to query * `clock_type` one of `AmdSmiClkType` enum values: Field | Description @@ -617,7 +617,7 @@ Exceptions that can be thrown by `amdsmi_get_clock_measure` function: Example: ```python try: - devices = amdsmi_get_device_handles() + devices = amdsmi_get_processor_handles() if len(devices) == 0: print("No GPUs on machine") else: @@ -636,7 +636,7 @@ Description: Returns the pcie link status for the given GPU Input parameters: -* `device_handle` device which to query +* `processor_handle` device which to query Output: Dictionary with fields @@ -653,7 +653,7 @@ Exceptions that can be thrown by `amdsmi_get_pcie_link_status` function: Example: ```python try: - devices = amdsmi_get_device_handles() + devices = amdsmi_get_processor_handles() if len(devices) == 0: print("No GPUs on machine") else: @@ -669,7 +669,7 @@ except AmdSmiException as e: Description: Returns the max pcie link capabilities for the given GPU Input parameters: -* `device_handle` device which to query +* `processor_handle` device which to query Output: Dictionary with fields @@ -686,7 +686,7 @@ Exceptions that can be thrown by `amdsmi_get_pcie_link_caps` function: Example: ```python try: - devices = amdsmi_get_device_handles() + devices = amdsmi_get_processor_handles() if len(devices) == 0: print("No GPUs on machine") else: @@ -702,7 +702,7 @@ except AmdSmiException as e: Description: Returns bad page info for the given GPU Input parameters: -* `device_handle` device which to query +* `processor_handle` device which to query Output: List consisting of dictionaries with fields for each bad page found @@ -721,7 +721,7 @@ Exceptions that can be thrown by `amdsmi_get_bad_page_info` function: Example: ```python try: - devices = amdsmi_get_device_handles() + devices = amdsmi_get_processor_handles() if len(devices) == 0: print("No GPUs on machine") else: @@ -746,7 +746,7 @@ Description: Returns the supported frequency target range for the given GPU Input parameters: -* `device_handle` device which to query +* `processor_handle` device which to query * `clock_type` one of `AmdSmiClkType` enum values: Field | Description @@ -780,7 +780,7 @@ Exceptions that can be thrown by `amdsmi_get_target_frequency_range` function: Example: ```python try: - devices = amdsmi_get_device_handles() + devices = amdsmi_get_processor_handles() if len(devices) == 0: print("No GPUs on machine") else: @@ -815,7 +815,7 @@ Description: Returns the list of processes for the given GPU Input parameters: -* `device_handle` device which to query +* `processor_handle` device which to query Output: List of process handles found @@ -827,7 +827,7 @@ Exceptions that can be thrown by `amdsmi_get_process_list` function: Example: ```python try: - devices = amdsmi_get_device_handles() + devices = amdsmi_get_processor_handles() if len(devices) == 0: print("No GPUs on machine") else: @@ -842,7 +842,7 @@ Description: Returns the info for the given process Input parameters: -* `device_handle` device which to query +* `processor_handle` device which to query * `process_handle` process which to query Output: Dictionary with fields @@ -863,7 +863,7 @@ Exceptions that can be thrown by `amdsmi_get_process_info` function: Example: ```python try: - devices = amdsmi_get_device_handles() + devices = amdsmi_get_processor_handles() if len(devices) == 0: print("No GPUs on machine") else: @@ -880,7 +880,7 @@ Description: Returns the ECC error count for the given GPU Input parameters: -* `device_handle` device which to query +* `processor_handle` device which to query Output: Dictionary with fields @@ -897,7 +897,7 @@ Exceptions that can be thrown by `amdsmi_get_ecc_error_count` function: Example: ```python try: - devices = amdsmi_get_device_handles() + devices = amdsmi_get_processor_handles() if len(devices) == 0: print("No GPUs on machine") else: @@ -914,7 +914,7 @@ Description: Returns board info for the given GPU Input parameters: -* `device_handle` device which to query +* `processor_handle` device which to query Output: Dictionary with fields correctable and uncorrectable @@ -932,7 +932,7 @@ Exceptions that can be thrown by `amdsmi_get_board_info` function: Example: ```python try: - device = amdsmi_get_device_handle_from_bdf("0000:23.00.0") + device = amdsmi_get_processor_handle_from_bdf("0000:23.00.0") board_info = amdsmi_get_board_info(device) print(board_info["serial_number"]) print(board_info["product_serial"]) @@ -946,7 +946,7 @@ Description: Returns status of each RAS block for the given GPU Input parameters: -* `device_handle` device which to query +* `processor_handle` device which to query Output: List containing dictionaries with fields for each RAS block @@ -963,7 +963,7 @@ Exceptions that can be thrown by `amdsmi_get_ras_block_features_enabled` functio Example: ```python try: - devices = amdsmi_get_device_handles() + devices = amdsmi_get_processor_handles() if len(devices) == 0: print("No GPUs on machine") else: @@ -986,7 +986,7 @@ Description: Allocates a new event reader notifier to monitor different types of Input parameters: -* `device_handle` device handle corresponding to the device on which to listen for events +* `processor_handle` device handle corresponding to the device on which to listen for events * `event_types` list of event types from AmdSmiEvtNotificationType enum. Specifying which events to collect for the given device. Event Type | Description @@ -1015,7 +1015,7 @@ Input parameters: `None` Example with manual cleanup of AmdSmiEventReader: ```python try: - devices = amdsmi_get_device_handles() + devices = amdsmi_get_processor_handles() if len(devices) == 0: print("No GPUs on machine") else: @@ -1030,7 +1030,7 @@ finally: Example with automatic cleanup using `with` statement: ```python try: - devices = amdsmi_get_device_handles() + devices = amdsmi_get_processor_handles() if len(devices) == 0: print("No GPUs on machine") else: @@ -1046,7 +1046,7 @@ Description: Get a function name iterator of supported AMDSMI functions for a de Input parameters: -* `device_handle` device which to query +* `processor_handle` device which to query Output: Handle for a function iterator @@ -1058,7 +1058,7 @@ Exceptions that can be thrown by `amdsmi_dev_open_supported_func_iterator` funct Example: ```python try: - devices = amdsmi_get_device_handles() + devices = amdsmi_get_processor_handles() if len(devices) == 0: print("No GPUs on machine") else: @@ -1087,7 +1087,7 @@ Exceptions that can be thrown by `amdsmi_dev_open_supported_variant_iterator` fu Example: ```python try: - devices = amdsmi_get_device_handles() + devices = amdsmi_get_processor_handles() if len(devices) == 0: print("No GPUs on machine") else: @@ -1118,7 +1118,7 @@ Exceptions that can be thrown by `amdsmi_next_func_iter` function: Example: ```python try: - devices = amdsmi_get_device_handles() + devices = amdsmi_get_processor_handles() if len(devices) == 0: print("No GPUs on machine") else: @@ -1149,7 +1149,7 @@ Exceptions that can be thrown by `amdsmi_dev_close_supported_func_iterator` func Example: ```python try: - devices = amdsmi_get_device_handles() + devices = amdsmi_get_processor_handles() if len(devices) == 0: print("No GPUs on machine") else: @@ -1183,7 +1183,7 @@ Exceptions that can be thrown by `amdsmi_get_func_iter_value` function: Example: ```python try: - devices = amdsmi_get_device_handles() + devices = amdsmi_get_processor_handles() if len(devices) == 0: print("No GPUs on machine") else: @@ -1200,7 +1200,7 @@ except AmdSmiException as e: Description: Control the set of allowed PCIe bandwidths that can be used Input parameters: -* `device_handle` handle for the given device +* `processor_handle` handle for the given device * `bw_bitmask` A bitmask indicating the indices of the bandwidths that are to be enabled (1) and disabled (0) @@ -1214,7 +1214,7 @@ Exceptions that can be thrown by ` amdsmi_dev_set_pci_bandwidth` function: Example: ```python try: - devices = amdsmi_get_device_handles() + devices = amdsmi_get_processor_handles() if len(devices) == 0: print("No GPUs on machine") else: @@ -1227,7 +1227,7 @@ except AmdSmiException as e: Description: Set the power cap value Input parameters: -* `device_handle` handle for the given device +* `processor_handle` handle for the given device * `sensor_ind` a 0-based sensor index. Normally, this will be 0. If a device has more than one sensor, it could be greater than 0 * `cap` int that indicates the desired power cap, in microwatts @@ -1242,7 +1242,7 @@ Exceptions that can be thrown by ` amdsmi_dev_set_power_cap` function: Example: ```python try: - devices = amdsmi_get_device_handles() + devices = amdsmi_get_processor_handles() if len(devices) == 0: print("No GPUs on machine") else: @@ -1256,7 +1256,7 @@ except AmdSmiException as e: Description: Set the power profile Input parameters: -* `device_handle` handle for the given device +* `processor_handle` handle for the given device * `reserved` Not currently used, set to 0 * `profile` a amdsmi_power_profile_preset_masks_t that hold the mask of the desired new power profile @@ -1271,7 +1271,7 @@ Exceptions that can be thrown by ` amdsmi_dev_set_power_profile` function: Example: ```python try: - devices = amdsmi_get_device_handles() + devices = amdsmi_get_processor_handles() if len(devices) == 0: print("No GPUs on machine") else: @@ -1287,7 +1287,7 @@ except AmdSmiException as e: Description: This function sets the clock range information Input parameters: -* `device_handle` handle for the given device +* `processor_handle` handle for the given device * `min_clk_value` minimum clock value for desired clock range * `max_clk_value` maximum clock value for desired clock range * `clk_type`AMDSMI_CLK_TYPE_SYS | AMDSMI_CLK_TYPE_MEM range type @@ -1302,7 +1302,7 @@ Exceptions that can be thrown by `amdsmi_dev_set_clk_range` function: Example: ```python try: - devices = amdsmi_get_device_handles() + devices = amdsmi_get_processor_handles() if len(devices) == 0: print("No GPUs on machine") else: @@ -1318,7 +1318,7 @@ Description: Get the unique PCI device identifier associated for a device Input parameters: -* `device_handle` device which to query +* `processor_handle` device which to query Output: device bdf The format of bdfid will be as follows: @@ -1360,7 +1360,7 @@ Description: Get the list of possible PCIe bandwidths that are available. Input parameters: -* `device_handle` device which to query +* `processor_handle` device which to query Output: Dictionary with the possible T/s values and associated number of lanes @@ -1402,7 +1402,7 @@ Description: Get PCIe traffic information Input parameters: -* `device_handle` device which to query +* `processor_handle` device which to query Output: Dictionary with the fields @@ -1437,7 +1437,7 @@ Description: Get PCIe replay counter Input parameters: -* `device_handle` device which to query +* `processor_handle` device which to query Output: counter value The sum of the NAK's received and generated by the GPU @@ -1467,7 +1467,7 @@ Description: Get the NUMA node associated with a device Input parameters: -* `device_handle` device which to query +* `processor_handle` device which to query Output: NUMA node value @@ -1496,7 +1496,7 @@ Description: Get the average power consumption of the device Input parameters: -* `device_handle` device which to query +* `processor_handle` device which to query * `sensor_id` a 0-based sensor index. Normally, this will be 0. If a device has more than one sensor, it could be greater than 0. @@ -1528,7 +1528,7 @@ Description: Get the energy accumulator counter of the device. Input parameters: -* `device_handle` device which to query +* `processor_handle` device which to query Output: Dictionary with fields @@ -1564,7 +1564,7 @@ Description: Get the total amount of memory that exists Input parameters: -* `device_handle` device which to query +* `processor_handle` device which to query * `mem_type` enum AmdSmiMemoryType Output: total amount of memory @@ -1595,7 +1595,7 @@ except AmdSmiException as e: Description: This function sets the clock frequency information Input parameters: -* `device_handle` handle for the given device +* `processor_handle` handle for the given device * `level` AMDSMI_FREQ_IND_MIN|AMDSMI_FREQ_IND_MAX to set the minimum (0) or maximum (1) speed * `clk_value` value to apply to the clock range @@ -1611,7 +1611,7 @@ Exceptions that can be thrown by ` amdsmi_dev_set_od_clk_info` function: Example: ```python try: - devices = amdsmi_get_device_handles() + devices = amdsmi_get_processor_handles() if len(devices) == 0: print("No GPUs on machine") else: @@ -1633,7 +1633,7 @@ Description: Get the current memory usage Input parameters: -* `device_handle` device which to query +* `processor_handle` device which to query * `mem_type` enum AmdSmiMemoryType Output: the amount of memory currently being used @@ -1662,7 +1662,7 @@ except AmdSmiException as e: Description: This function sets 1 of the 3 voltage curve points Input parameters: -* `device_handle` handle for the given device +* `processor_handle` handle for the given device * `vpoint` voltage point [0|1|2] on the voltage curve * `clk_value` clock value component of voltage curve point * `volt_value` voltage value component of voltage curve point @@ -1677,7 +1677,7 @@ Exceptions that can be thrown by ` amdsmi_dev_set_od_volt_info` function: Example: ```python try: - devices = amdsmi_get_device_handles() + devices = amdsmi_get_processor_handles() if len(devices) == 0: print("No GPUs on machine") else: @@ -1694,7 +1694,7 @@ Description: Get percentage of time any device memory is being used Input parameters: -* `device_handle` device which to query +* `processor_handle` device which to query Output: percentage of time that any device memory is being used for the specified device. @@ -1724,7 +1724,7 @@ Description: Set the PowerPlay performance level associated with the device with provided device handle with the provided value Input parameters: -* `device_handle` handle for the given device +* `processor_handle` handle for the given device * `perf_lvl` the value to which the performance level should be set Output: None @@ -1737,7 +1737,7 @@ Exceptions that can be thrown by ` amdsmi_dev_set_perf_level_v1` function: Example: ```python try: - devices = amdsmi_get_device_handles() + devices = amdsmi_get_processor_handles() if len(devices) == 0: print("No GPUs on machine") else: @@ -1751,7 +1751,7 @@ Description: Get the fan speed in RPMs of the device with the specified device handle and 0-based sensor index. Input parameters: -* `device_handle` handle for the given device +* `processor_handle` handle for the given device * `sensor_idx` a 0-based sensor index. Normally, this will be 0. If a device has more than one sensor, it could be greater than 0. @@ -1765,7 +1765,7 @@ Exceptions that can be thrown by `amdsmi_dev_get_fan_rpms` function: Example: ```python try: - devices = amdsmi_get_device_handles() + devices = amdsmi_get_processor_handles() if len(devices) == 0: print("No GPUs on machine") else: @@ -1780,7 +1780,7 @@ Description: Get the fan speed for the specified device as a value relative to AMDSMI_MAX_FAN_SPEED Input parameters: -* `device_handle` handle for the given device +* `processor_handle` handle for the given device * `sensor_idx` a 0-based sensor index. Normally, this will be 0. If a device has more than one sensor, it could be greater than 0. @@ -1794,7 +1794,7 @@ Exceptions that can be thrown by `amdsmi_dev_get_fan_speed` function: Example: ```python try: - devices = amdsmi_get_device_handles() + devices = amdsmi_get_processor_handles() if len(devices) == 0: print("No GPUs on machine") else: @@ -1808,7 +1808,7 @@ except AmdSmiException as e: Description: Get the max fan speed of the device with provided device handle Input parameters: -* `device_handle` handle for the given device +* `processor_handle` handle for the given device * `sensor_idx` a 0-based sensor index. Normally, this will be 0. If a device has more than one sensor, it could be greater than 0. @@ -1822,7 +1822,7 @@ Exceptions that can be thrown by `amdsmi_dev_get_fan_speed_max` function: Example: ```python try: - devices = amdsmi_get_device_handles() + devices = amdsmi_get_processor_handles() if len(devices) == 0: print("No GPUs on machine") else: @@ -1837,7 +1837,7 @@ Description: Get the temperature metric value for the specified metric, from the specified temperature sensor on the specified device Input parameters: -* `device_handle` handle for the given device +* `processor_handle` handle for the given device * `sensor_type` part of device from which temperature should be obtained * `metric` enum indicated which temperature value should be retrieved @@ -1851,7 +1851,7 @@ Exceptions that can be thrown by ` amdsmi_dev_get_temp_metric` function: Example: ```python try: - devices = amdsmi_get_device_handles() + devices = amdsmi_get_processor_handles() if len(devices) == 0: print("No GPUs on machine") else: @@ -1867,7 +1867,7 @@ Description: Get the voltage metric value for the specified metric, from the specified voltage sensor on the specified device Input parameters: -* `device_handle` handle for the given device +* `processor_handle` handle for the given device * `sensor_type` part of device from which voltage should be obtained * `metric` enum indicated which voltage value should be retrieved @@ -1881,7 +1881,7 @@ Exceptions that can be thrown by ` amdsmi_dev_get_volt_metric` function: Example: ```python try: - devices = amdsmi_get_device_handles() + devices = amdsmi_get_processor_handles() if len(devices) == 0: print("No GPUs on machine") else: @@ -1896,7 +1896,7 @@ except AmdSmiException as e: Description: Get percentage of time device is busy doing any processing Input parameters: -* `device_handle` handle for the given device +* `processor_handle` handle for the given device Output: How busy the device is (as percentage of time) @@ -1908,7 +1908,7 @@ Exceptions that can be thrown by `amdsmi_dev_get_busy_percent` function: Example: ```python try: - devices = amdsmi_get_device_handles() + devices = amdsmi_get_processor_handles() if len(devices) == 0: print("No GPUs on machine") else: @@ -1922,7 +1922,7 @@ except AmdSmiException as e: Description: Get coarse grain utilization counter of the specified device Input parameters: -* `device_handle` handle for the given device +* `processor_handle` handle for the given device * `counter_types` variable number of counter types desired Output: List containing dictionaries with fields @@ -1940,7 +1940,7 @@ Exceptions that can be thrown by `amdsmi_get_utilization_count` function: Example: ```python try: - devices = amdsmi_get_device_handles() + devices = amdsmi_get_processor_handles() if len(devices) == 0: print("No GPUs on machine") else: @@ -1963,7 +1963,7 @@ except AmdSmiException as e: Description: Get the performance level of the device with provided device handle Input parameters: -* `device_handle` handle for the given device +* `processor_handle` handle for the given device Output: Performance level as enum value of dev_perf_level_t @@ -1975,7 +1975,7 @@ Exceptions that can be thrown by `amdsmi_dev_get_perf_level` function: Example: ```python try: - devices = amdsmi_get_device_handles() + devices = amdsmi_get_processor_handles() if len(devices) == 0: print("No GPUs on machine") else: @@ -1989,7 +1989,7 @@ except AmdSmiException as e: Description: Enter performance determinism mode with provided device handle Input parameters: -* `device_handle` handle for the given device +* `processor_handle` handle for the given device * `clkvalue` softmax value for GFXCLK in MHz Output: None @@ -2002,7 +2002,7 @@ Exceptions that can be thrown by `amdsmi_set_perf_determinism_mode` function: Example: ```python try: - devices = amdsmi_get_device_handles() + devices = amdsmi_get_processor_handles() if len(devices) == 0: print("No GPUs on machine") else: @@ -2016,7 +2016,7 @@ Description: Get the overdrive percent associated with the device with provided device handle Input parameters: -* `device_handle` handle for the given device +* `processor_handle` handle for the given device Output: Overdrive percentage as integer @@ -2028,7 +2028,7 @@ Exceptions that can be thrown by `amdsmi_dev_get_overdrive_level` function: Example: ```python try: - devices = amdsmi_get_device_handles() + devices = amdsmi_get_processor_handles() if len(devices) == 0: print("No GPUs on machine") else: @@ -2043,7 +2043,7 @@ Description: Get the list of possible system clock speeds of device for a specified clock type Input parameters: -* `device_handle` handle for the given device +* `processor_handle` handle for the given device * `clk_type` the type of clock for which the frequency is desired Output: Dictionary with fields @@ -2062,7 +2062,7 @@ Exceptions that can be thrown by ` amdsmi_dev_get_gpu_clk_freq` function: Example: ```python try: - devices = amdsmi_get_device_handles() + devices = amdsmi_get_processor_handles() if len(devices) == 0: print("No GPUs on machine") else: @@ -2075,7 +2075,7 @@ except AmdSmiException as e: Description: This function retrieves the voltage/frequency curve information Input parameters: -* `device_handle` handle for the given device +* `processor_handle` handle for the given device Output: Dictionary with fields @@ -2097,7 +2097,7 @@ Exceptions that can be thrown by ` amdsmi_dev_get_od_volt_info` function: Example: ```python try: - devices = amdsmi_get_device_handles() + devices = amdsmi_get_processor_handles() if len(devices) == 0: print("No GPUs on machine") else: @@ -2110,7 +2110,7 @@ except AmdSmiException as e: Description: This function retrieves the gpu metrics information Input parameters: -* `device_handle` handle for the given device +* `processor_handle` handle for the given device Output: Dictionary with fields @@ -2159,7 +2159,7 @@ Exceptions that can be thrown by ` amdsmi_dev_get_gpu_metrics_info` function: Example: ```python try: - devices = amdsmi_get_device_handles() + devices = amdsmi_get_processor_handles() if len(devices) == 0: print("No GPUs on machine") else: @@ -2173,7 +2173,7 @@ Description: This function will retrieve the current valid regions in the frequency/voltage space Input parameters: -* `device_handle` handle for the given device +* `processor_handle` handle for the given device * `num_regions` number of freq volt regions Output: List containing a dictionary with fields for each freq volt region @@ -2191,7 +2191,7 @@ Exceptions that can be thrown by ` amdsmi_dev_get_od_volt_curve_regions` functio Example: ```python try: - devices = amdsmi_get_device_handles() + devices = amdsmi_get_processor_handles() if len(devices) == 0: print("No GPUs on machine") else: @@ -2205,7 +2205,7 @@ Description: Get the list of available preset power profiles and an indication which profile is currently active Input parameters: -* `device_handle` handle for the given device +* `processor_handle` handle for the given device * `sensor_idx` number of freq volt regions Output: Dictionary with fields @@ -2224,7 +2224,7 @@ Exceptions that can be thrown by ` amdsmi_dev_get_power_profile_presets` functio Example: ```python try: - devices = amdsmi_get_device_handles() + devices = amdsmi_get_processor_handles() if len(devices) == 0: print("No GPUs on machine") else: @@ -2239,7 +2239,7 @@ Description: Tell if an event group is supported by a given device Input parameters: -* `device_handle` device which to query +* `processor_handle` device which to query * `event_group` event group being checked for support Output: None @@ -2252,7 +2252,7 @@ Exceptions that can be thrown by `amdsmi_dev_counter_group_supported` function: Example: ```python try: - devices = amdsmi_get_device_handles() + devices = amdsmi_get_processor_handles() if len(devices) == 0: print("No GPUs on machine") else: @@ -2267,7 +2267,7 @@ Description: Creates a performance counter object Input parameters: -* `device_handle` device which to query +* `processor_handle` device which to query * `event_type` event group being checked for support Output: An event handle of the newly created performance counter object @@ -2280,7 +2280,7 @@ Exceptions that can be thrown by `amdsmi_dev_create_counter` function: Example: ```python try: - devices = amdsmi_get_device_handles() + devices = amdsmi_get_processor_handles() if len(devices) == 0: print("No GPUs on machine") else: @@ -2306,7 +2306,7 @@ Exceptions that can be thrown by `amdsmi_dev_destroy_counter` function: Example: ```python try: - devices = amdsmi_get_device_handles() + devices = amdsmi_get_processor_handles() if len(devices) == 0: print("No GPUs on machine") else: @@ -2334,7 +2334,7 @@ Exceptions that can be thrown by `amdsmi_control_counter` function: Example: ```python try: - devices = amdsmi_get_device_handles() + devices = amdsmi_get_processor_handles() if len(devices) == 0: print("No GPUs on machine") else: @@ -2367,7 +2367,7 @@ Exceptions that can be thrown by `amdsmi_read_counter` function: Example: ```python try: - devices = amdsmi_get_device_handles() + devices = amdsmi_get_processor_handles() if len(devices) == 0: print("No GPUs on machine") else: @@ -2382,7 +2382,7 @@ Description: Get the number of currently available counters Input parameters: -* `device_handle` handle for the given device +* `processor_handle` handle for the given device * `event_group` event group being checked as AmdSmiEventGroup Output: Number of available counters for the given device of the inputted event group @@ -2395,7 +2395,7 @@ Exceptions that can be thrown by ` amdsmi_counter_get_available_counters` functi Example: ```python try: - devices = amdsmi_get_device_handles() + devices = amdsmi_get_processor_handles() if len(devices) == 0: print("No GPUs on machine") else: @@ -2409,7 +2409,7 @@ except AmdSmiException as e: Description: Set a desired performance level for given device Input parameters: -* `device_handle` handle for the given device +* `processor_handle` handle for the given device * `perf_level` performance level being set as AmdSmiDevPerfLevel Output: None @@ -2422,7 +2422,7 @@ Exceptions that can be thrown by ` amdsmi_dev_set_perf_level` function: Example: ```python try: - devices = amdsmi_get_device_handles() + devices = amdsmi_get_processor_handles() if len(devices) == 0: print("No GPUs on machine") else: @@ -2436,7 +2436,7 @@ Description: Get the list of available preset power profiles and an indication o which profile is currently active. Input parameters: -* `device_handle` handle for the given device +* `processor_handle` handle for the given device * `sensor_idx` sensor index as integer Output: Dictionary with fields @@ -2455,7 +2455,7 @@ Exceptions that can be thrown by ` amdsmi_dev_get_power_profile_presets` functio Example: ```python try: - devices = amdsmi_get_device_handles() + devices = amdsmi_get_processor_handles() if len(devices) == 0: print("No GPUs on machine") else: @@ -2469,7 +2469,7 @@ except AmdSmiException as e: Description: Reset the gpu associated with the device with provided device handle Input parameters: -* `device_handle` handle for the given device +* `processor_handle` handle for the given device Output: None @@ -2481,7 +2481,7 @@ Exceptions that can be thrown by `amdsmi_dev_reset_gpu` function: Example: ```python try: - devices = amdsmi_get_device_handles() + devices = amdsmi_get_processor_handles() if len(devices) == 0: print("No GPUs on machine") else: @@ -2495,7 +2495,7 @@ Description: Set the fan speed for the specified device with the provided speed, in RPMs Input parameters: -* `device_handle` handle for the given device +* `processor_handle` handle for the given device * `sensor_idx` sensor index as integer * `fan_speed` the speed to which the function will attempt to set the fan @@ -2509,7 +2509,7 @@ Exceptions that can be thrown by `amdsmi_dev_set_fan_speed` function: Example: ```python try: - devices = amdsmi_get_device_handles() + devices = amdsmi_get_processor_handles() if len(devices) == 0: print("No GPUs on machine") else: @@ -2522,7 +2522,7 @@ except AmdSmiException as e: Description: Reset the fan to automatic driver control Input parameters: -* `device_handle` handle for the given device +* `processor_handle` handle for the given device * `sensor_idx` sensor index as integer Output: None @@ -2535,7 +2535,7 @@ Exceptions that can be thrown by `amdsmi_dev_reset_fan` function: Example: ```python try: - devices = amdsmi_get_device_handles() + devices = amdsmi_get_processor_handles() if len(devices) == 0: print("No GPUs on machine") else: @@ -2549,7 +2549,7 @@ Description: Control the set of allowed frequencies that can be used for the specified clock Input parameters: -* `device_handle` handle for the given device +* `processor_handle` handle for the given device * `clk_type` the type of clock for which the set of frequencies will be modified as AmdSmiClkType * `freq_bitmask` bitmask indicating the indices of the frequencies that are to @@ -2566,7 +2566,7 @@ Exceptions that can be thrown by ` amdsmi_dev_set_clk_freq` function: Example: ```python try: - devices = amdsmi_get_device_handles() + devices = amdsmi_get_processor_handles() if len(devices) == 0: print("No GPUs on machine") else: @@ -2581,7 +2581,7 @@ Description: Set the overdrive percent associated with the device with provided device handle with the provided value Input parameters: -* `device_handle` handle for the given device +* `processor_handle` handle for the given device * `overdrive_value` value to which the overdrive level should be set Output: None @@ -2594,7 +2594,7 @@ Exceptions that can be thrown by ` amdsmi_dev_set_overdrive_level_v1` function: Example: ```python try: - devices = amdsmi_get_device_handles() + devices = amdsmi_get_processor_handles() if len(devices) == 0: print("No GPUs on machine") else: @@ -2608,7 +2608,7 @@ Description: **deprecated** Set the overdrive percent associated with the device with provided device handle with the provided value Input parameters: -* `device_handle` handle for the given device +* `processor_handle` handle for the given device * `overdrive_value` value to which the overdrive level should be set Output: None @@ -2621,7 +2621,7 @@ Exceptions that can be thrown by ` amdsmi_dev_set_overdrive_level` function: Example: ```python try: - devices = amdsmi_get_device_handles() + devices = amdsmi_get_processor_handles() if len(devices) == 0: print("No GPUs on machine") else: @@ -2635,7 +2635,7 @@ except AmdSmiException as e: Description: Retrieve the error counts for a GPU block Input parameters: -* `device_handle` handle for the given device +* `processor_handle` handle for the given device * `block` The block for which error counts should be retrieved Output: Dict containing information about error counts @@ -2653,7 +2653,7 @@ Exceptions that can be thrown by ` amdsmi_dev_get_ecc_count` function: Example: ```python try: - devices = amdsmi_get_device_handles() + devices = amdsmi_get_processor_handles() if len(devices) == 0: print("No GPUs on machine") else: @@ -2668,7 +2668,7 @@ except AmdSmiException as e: Description: Retrieve the enabled ECC bit-mask Input parameters: -* `device_handle` handle for the given device +* `processor_handle` handle for the given device Output: Enabled ECC bit-mask @@ -2680,7 +2680,7 @@ Exceptions that can be thrown by ` amdsmi_dev_get_ecc_enabled` function: Example: ```python try: - devices = amdsmi_get_device_handles() + devices = amdsmi_get_processor_handles() if len(devices) == 0: print("No GPUs on machine") else: @@ -2695,7 +2695,7 @@ except AmdSmiException as e: Description: Retrieve the ECC status for a GPU block Input parameters: -* `device_handle` handle for the given device +* `processor_handle` handle for the given device * `block` The block for which ECC status should be retrieved Output: ECC status for a requested GPU block @@ -2708,7 +2708,7 @@ Exceptions that can be thrown by ` amdsmi_dev_get_ecc_status` function: Example: ```python try: - devices = amdsmi_get_device_handles() + devices = amdsmi_get_processor_handles() if len(devices) == 0: print("No GPUs on machine") else: @@ -2826,7 +2826,7 @@ except AmdSmiException as e: Description: Retrieve the XGMI error status for a device Input parameters: -* `device_handle` handle for the given device +* `processor_handle` handle for the given device Output: XGMI error status for a requested device @@ -2838,7 +2838,7 @@ Exceptions that can be thrown by `amdsmi_dev_xgmi_error_status` function: Example: ```python try: - devices = amdsmi_get_device_handles() + devices = amdsmi_get_processor_handles() if len(devices) == 0: print("No GPUs on machine") else: @@ -2853,7 +2853,7 @@ except AmdSmiException as e: Description: Reset the XGMI error status for a device Input parameters: -* `device_handle` handle for the given device +* `processor_handle` handle for the given device Output: None @@ -2865,7 +2865,7 @@ Exceptions that can be thrown by `amdsmi_dev_reset_xgmi_error` function: Example: ```python try: - devices = amdsmi_get_device_handles() + devices = amdsmi_get_processor_handles() if len(devices) == 0: print("No GPUs on machine") else: @@ -2879,7 +2879,7 @@ Description: Returns the device vendor name Input parameters: -* `device_handle` device which to query +* `processor_handle` device which to query Output: device vendor name @@ -2891,7 +2891,7 @@ Exceptions that can be thrown by `amdsmi_dev_get_vendor_name` function: Example: ```python try: - devices = amdsmi_get_device_handles() + devices = amdsmi_get_processor_handles() if len(devices) == 0: print("No GPUs on machine") else: @@ -2907,7 +2907,7 @@ Description: Get the device id associated with the device with provided device h Input parameters: -* `device_handle` device which to query +* `processor_handle` device which to query Output: device id @@ -2919,7 +2919,7 @@ Exceptions that can be thrown by `amdsmi_dev_get_id` function: Example: ```python try: - devices = amdsmi_get_device_handles() + devices = amdsmi_get_processor_handles() if len(devices) == 0: print("No GPUs on machine") else: @@ -2935,7 +2935,7 @@ Description: Get the vram vendor string of a gpu device. Input parameters: -* `device_handle` device which to query +* `processor_handle` device which to query Output: vram vendor @@ -2947,7 +2947,7 @@ Exceptions that can be thrown by `amdsmi_dev_get_vram_vendor` function: Example: ```python try: - devices = amdsmi_get_device_handles() + devices = amdsmi_get_processor_handles() if len(devices) == 0: print("No GPUs on machine") else: @@ -2963,7 +2963,7 @@ Description: Get the drm minor number associated with this device. Input parameters: -* `device_handle` device which to query +* `processor_handle` device which to query Output: drm minor number @@ -2975,7 +2975,7 @@ Exceptions that can be thrown by `amdsmi_dev_get_drm_render_minor` function: Example: ```python try: - devices = amdsmi_get_device_handles() + devices = amdsmi_get_processor_handles() if len(devices) == 0: print("No GPUs on machine") else: @@ -2991,7 +2991,7 @@ Description: Get the subsystem device id associated with the device with provide Input parameters: -* `device_handle` device which to query +* `processor_handle` device which to query Output: subsystem device id @@ -3003,7 +3003,7 @@ Exceptions that can be thrown by `amdsmi_dev_get_subsystem_id` function: Example: ```python try: - devices = amdsmi_get_device_handles() + devices = amdsmi_get_processor_handles() if len(devices) == 0: print("No GPUs on machine") else: @@ -3020,7 +3020,7 @@ Description: Get the name string for the device subsytem Input parameters: -* `device_handle` device which to query +* `processor_handle` device which to query Output: device subsytem @@ -3032,7 +3032,7 @@ Exceptions that can be thrown by `amdsmi_dev_get_subsystem_name` function: Example: ```python try: - devices = amdsmi_get_device_handles() + devices = amdsmi_get_processor_handles() if len(devices) == 0: print("No GPUs on machine") else: @@ -3057,7 +3057,7 @@ Exceptions that can be thrown by `amdsmi_get_version` function: Example: ```python try: - devices = amdsmi_get_device_handles() + devices = amdsmi_get_processor_handles() if len(devices) == 0: print("No GPUs on machine") else: @@ -3086,7 +3086,7 @@ Exceptions that can be thrown by `amdsmi_get_version_str` function: Example: ```python try: - devices = amdsmi_get_device_handles() + devices = amdsmi_get_processor_handles() if len(devices) == 0: print("No GPUs on machine") else: @@ -3103,7 +3103,7 @@ Description: Retrieve the NUMA CPU node number for a device Input parameters: -* `device_handle` device which to query +* `processor_handle` device which to query Output: node number of NUMA CPU for the device @@ -3115,7 +3115,7 @@ Exceptions that can be thrown by `amdsmi_topo_get_numa_node_number` function: Example: ```python try: - devices = amdsmi_get_device_handles() + devices = amdsmi_get_processor_handles() if len(devices) == 0: print("No GPUs on machine") else: @@ -3131,8 +3131,8 @@ Description: Retrieve the weight for a connection between 2 GPUs. Input parameters: -* `device_handle_src` the source device handle -* `device_handle_dest` the destination device handle +* `processor_handle_src` the source device handle +* `processor_handle_dest` the destination device handle Output: the weight for a connection between 2 GPUs @@ -3144,13 +3144,13 @@ Exceptions that can be thrown by `amdsmi_topo_get_link_weight` function: Example: ```python try: - devices = amdsmi_get_device_handles() + devices = amdsmi_get_processor_handles() if len(devices) == 0: print("No GPUs on machine") else: - device_handle_src = devices[0] - device_handle_dest = devices[1] - weight = amdsmi_topo_get_link_weight(device_handle_src, device_handle_dest) + processor_handle_src = devices[0] + processor_handle_dest = devices[1] + weight = amdsmi_topo_get_link_weight(processor_handle_src, processor_handle_dest) print(weight) except AmdSmiException as e: print(e) @@ -3162,8 +3162,8 @@ Description: Retreive minimal and maximal io link bandwidth between 2 GPUs. Input parameters: -* `device_handle_src` the source device handle -* `device_handle_dest` the destination device handle +* `processor_handle_src` the source device handle +* `processor_handle_dest` the destination device handle Output: Dictionary with fields: @@ -3180,13 +3180,13 @@ Exceptions that can be thrown by ` amdsmi_get_minmax_bandwidth` function: Example: ```python try: - devices = amdsmi_get_device_handles() + devices = amdsmi_get_processor_handles() if len(devices) == 0: print("No GPUs on machine") else: - device_handle_src = devices[0] - device_handle_dest = devices[1] - bandwith = amdsmi_get_minmax_bandwidth(device_handle_src, device_handle_dest) + processor_handle_src = devices[0] + processor_handle_dest = devices[1] + bandwith = amdsmi_get_minmax_bandwidth(processor_handle_src, processor_handle_dest) print(bandwith['min_bandwidth']) print(bandwith['max_bandwidth']) except AmdSmiException as e: @@ -3199,8 +3199,8 @@ Description: Retrieve the hops and the connection type between 2 GPUs Input parameters: -* `device_handle_src` the source device handle -* `device_handle_dest` the destination device handle +* `processor_handle_src` the source device handle +* `processor_handle_dest` the destination device handle Output: Dictionary with fields: @@ -3217,13 +3217,13 @@ Exceptions that can be thrown by `amdsmi_topo_get_link_type` function: Example: ```python try: - devices = amdsmi_get_device_handles() + devices = amdsmi_get_processor_handles() if len(devices) == 0: print("No GPUs on machine") else: - device_handle_src = devices[0] - device_handle_dest = devices[1] - link_type = amdsmi_topo_get_link_type(device_handle_src, device_handle_dest) + processor_handle_src = devices[0] + processor_handle_dest = devices[1] + link_type = amdsmi_topo_get_link_type(processor_handle_src, processor_handle_dest) print(link_type['hops']) print(link_type['type']) except AmdSmiException as e: @@ -3236,8 +3236,8 @@ Description: Return P2P availability status between 2 GPUs Input parameters: -* `device_handle_src` the source device handle -* `device_handle_dest` the destination device handle +* `processor_handle_src` the source device handle +* `processor_handle_dest` the destination device handle Output: P2P availability status between 2 GPUs @@ -3249,13 +3249,13 @@ Exceptions that can be thrown by `amdsmi_is_P2P_accessible` function: Example: ```python try: - devices = amdsmi_get_device_handles() + devices = amdsmi_get_processor_handles() if len(devices) == 0: print("No GPUs on machine") else: - device_handle_src = devices[0] - device_handle_dest = devices[1] - accessible = amdsmi_is_P2P_accessible(device_handle_src, device_handle_dest) + processor_handle_src = devices[0] + processor_handle_dest = devices[1] + accessible = amdsmi_is_P2P_accessible(processor_handle_src, processor_handle_dest) print(accessible) except AmdSmiException as e: print(e) @@ -3267,7 +3267,7 @@ Description: Returns XGMI information for the GPU. Input parameters: -* `device_handle` device handle +* `processor_handle` device handle Output: Dictionary with fields: @@ -3287,7 +3287,7 @@ Exceptions that can be thrown by `amdsmi_get_xgmi_info` function: Example: ```python try: - devices = amdsmi_get_device_handles() + devices = amdsmi_get_processor_handles() if len(devices) == 0: print("No GPUs on machine") else: diff --git a/py-interface/__init__.py b/py-interface/__init__.py index d95f571307..da3e3d94b1 100644 --- a/py-interface/__init__.py +++ b/py-interface/__init__.py @@ -25,13 +25,13 @@ from .amdsmi_interface import amdsmi_shut_down # Device Descovery from .amdsmi_interface import amdsmi_get_device_type -from .amdsmi_interface import amdsmi_get_device_handles +from .amdsmi_interface import amdsmi_get_processor_handles from .amdsmi_interface import amdsmi_get_socket_handles from .amdsmi_interface import amdsmi_get_socket_info from .amdsmi_interface import amdsmi_get_device_bdf from .amdsmi_interface import amdsmi_get_device_uuid -from .amdsmi_interface import amdsmi_get_device_handle_from_bdf +from .amdsmi_interface import amdsmi_get_processor_handle_from_bdf # # SW Version Information from .amdsmi_interface import amdsmi_get_driver_version diff --git a/py-interface/amdsmi_interface.py b/py-interface/amdsmi_interface.py index 29a8c8311f..a4aea1dc3f 100644 --- a/py-interface/amdsmi_interface.py +++ b/py-interface/amdsmi_interface.py @@ -293,11 +293,11 @@ class AmdSmiUtilizationCounterType(IntEnum): class AmdSmiEventReader: def __init__( - self, device_handle: amdsmi_wrapper.amdsmi_processor_handle, *event_types + self, processor_handle: amdsmi_wrapper.amdsmi_processor_handle, *event_types ): - if not isinstance(device_handle, amdsmi_wrapper.amdsmi_processor_handle): + if not isinstance(processor_handle, amdsmi_wrapper.amdsmi_processor_handle): raise AmdSmiParameterException( - device_handle, amdsmi_wrapper.amdsmi_processor_handle + processor_handle, amdsmi_wrapper.amdsmi_processor_handle ) if not isinstance(event_types, Iterable): raise AmdSmiParameterException( @@ -310,14 +310,14 @@ class AmdSmiEventReader: event_type, AmdSmiEvtNotificationType ) - self.device_handle = device_handle + self.processor_handle = processor_handle mask = 0 for event_type in event_types: mask |= (1 << (int(event_type) - 1)) - _check_res(amdsmi_wrapper.amdsmi_init_event_notification(device_handle)) + _check_res(amdsmi_wrapper.amdsmi_init_event_notification(processor_handle)) _check_res(amdsmi_wrapper. amdsmi_set_event_notification_mask( - device_handle, ctypes.c_uint64(mask))) + processor_handle, ctypes.c_uint64(mask))) def read(self, timestamp, num_elem=10): self.event_info = ( @@ -337,7 +337,7 @@ class AmdSmiEventReader: ): ret.append( { - "device_handle": self.event_info[i].device_handle, + "processor_handle": self.event_info[i].processor_handle, "event": AmdSmiEvtNotificationType( self.event_info[i].event ).name, @@ -349,7 +349,7 @@ class AmdSmiEventReader: def stop(self): _check_res(amdsmi_wrapper.amdsmi_stop_event_notification( - self.device_handle)) + self.processor_handle)) def __enter__(self): return self @@ -508,31 +508,31 @@ def amdsmi_get_socket_info(socket_handle): return socket_info.value.decode() -def amdsmi_get_device_handles() -> List[amdsmi_wrapper.amdsmi_processor_handle]: +def amdsmi_get_processor_handles() -> List[amdsmi_wrapper.amdsmi_processor_handle]: socket_handles = amdsmi_get_socket_handles() devices = [] for socket in socket_handles: device_count = ctypes.c_uint32() null_ptr = ctypes.POINTER(amdsmi_wrapper.amdsmi_processor_handle)() _check_res( - amdsmi_wrapper.amdsmi_get_device_handles( + amdsmi_wrapper.amdsmi_get_processor_handles( socket, ctypes.byref(device_count), null_ptr, ) ) - device_handles = ( + processor_handles = ( amdsmi_wrapper.amdsmi_processor_handle * device_count.value)() _check_res( - amdsmi_wrapper.amdsmi_get_device_handles( + amdsmi_wrapper.amdsmi_get_processor_handles( socket, ctypes.byref(device_count), - device_handles, + processor_handles, ) ) devices.extend( [ - amdsmi_wrapper.amdsmi_processor_handle(device_handles[dev_idx]) + amdsmi_wrapper.amdsmi_processor_handle(processor_handles[dev_idx]) for dev_idx in range(device_count.value) ] ) @@ -551,48 +551,48 @@ def amdsmi_shut_down(): def amdsmi_get_device_type( - device_handle: amdsmi_wrapper.amdsmi_processor_handle, + processor_handle: amdsmi_wrapper.amdsmi_processor_handle, ) -> ctypes.c_uint32: - if not isinstance(device_handle, amdsmi_wrapper.amdsmi_processor_handle): + if not isinstance(processor_handle, amdsmi_wrapper.amdsmi_processor_handle): raise AmdSmiParameterException( - device_handle, amdsmi_wrapper.amdsmi_processor_handle + processor_handle, amdsmi_wrapper.amdsmi_processor_handle ) dev_type = amdsmi_wrapper.device_type_t() _check_res( amdsmi_wrapper.amdsmi_get_device_type( - device_handle, ctypes.byref(dev_type)) + processor_handle, ctypes.byref(dev_type)) ) return dev_type.value -def amdsmi_get_device_bdf(device_handle: amdsmi_wrapper.amdsmi_processor_handle) -> str: - if not isinstance(device_handle, amdsmi_wrapper.amdsmi_processor_handle): +def amdsmi_get_device_bdf(processor_handle: amdsmi_wrapper.amdsmi_processor_handle) -> str: + if not isinstance(processor_handle, amdsmi_wrapper.amdsmi_processor_handle): raise AmdSmiParameterException( - device_handle, amdsmi_wrapper.amdsmi_processor_handle + processor_handle, amdsmi_wrapper.amdsmi_processor_handle ) bdf_info = amdsmi_wrapper.amdsmi_bdf_t() _check_res( amdsmi_wrapper.amdsmi_get_device_bdf( - device_handle, ctypes.byref(bdf_info)) + processor_handle, ctypes.byref(bdf_info)) ) return _format_bdf(bdf_info) def amdsmi_get_asic_info( - device_handle: amdsmi_wrapper.amdsmi_processor_handle, + processor_handle: amdsmi_wrapper.amdsmi_processor_handle, ) -> Dict[str, Any]: - if not isinstance(device_handle, amdsmi_wrapper.amdsmi_processor_handle): + if not isinstance(processor_handle, amdsmi_wrapper.amdsmi_processor_handle): raise AmdSmiParameterException( - device_handle, amdsmi_wrapper.amdsmi_processor_handle + processor_handle, amdsmi_wrapper.amdsmi_processor_handle ) asic_info = amdsmi_wrapper.amdsmi_asic_info_t() _check_res( amdsmi_wrapper.amdsmi_get_asic_info( - device_handle, ctypes.byref(asic_info)) + processor_handle, ctypes.byref(asic_info)) ) return { @@ -606,17 +606,17 @@ def amdsmi_get_asic_info( def amdsmi_get_power_cap_info( - device_handle: amdsmi_wrapper.amdsmi_processor_handle, + processor_handle: amdsmi_wrapper.amdsmi_processor_handle, ) -> Dict[str, Any]: - if not isinstance(device_handle, amdsmi_wrapper.amdsmi_processor_handle): + if not isinstance(processor_handle, amdsmi_wrapper.amdsmi_processor_handle): raise AmdSmiParameterException( - device_handle, amdsmi_wrapper.amdsmi_processor_handle + processor_handle, amdsmi_wrapper.amdsmi_processor_handle ) power_info = amdsmi_wrapper.amdsmi_power_cap_info_t() _check_res( amdsmi_wrapper.amdsmi_get_power_cap_info( - device_handle, ctypes.c_uint32(0), ctypes.byref(power_info) + processor_handle, ctypes.c_uint32(0), ctypes.byref(power_info) ) ) @@ -627,17 +627,17 @@ def amdsmi_get_power_cap_info( "max_power_cap": power_info.max_power_cap} def amdsmi_get_caps_info( - device_handle: amdsmi_wrapper.amdsmi_processor_handle, + processor_handle: amdsmi_wrapper.amdsmi_processor_handle, ) -> Dict[str, Any]: - if not isinstance(device_handle, amdsmi_wrapper.amdsmi_processor_handle): + if not isinstance(processor_handle, amdsmi_wrapper.amdsmi_processor_handle): raise AmdSmiParameterException( - device_handle, amdsmi_wrapper.amdsmi_processor_handle + processor_handle, amdsmi_wrapper.amdsmi_processor_handle ) gpu_caps = amdsmi_wrapper.amdsmi_gpu_caps_t() _check_res( amdsmi_wrapper.amdsmi_get_caps_info( - device_handle, ctypes.byref(gpu_caps)) + processor_handle, ctypes.byref(gpu_caps)) ) return { @@ -654,17 +654,17 @@ def amdsmi_get_caps_info( def amdsmi_get_vbios_info( - device_handle: amdsmi_wrapper.amdsmi_processor_handle, + processor_handle: amdsmi_wrapper.amdsmi_processor_handle, ) -> Dict[str, Any]: - if not isinstance(device_handle, amdsmi_wrapper.amdsmi_processor_handle): + if not isinstance(processor_handle, amdsmi_wrapper.amdsmi_processor_handle): raise AmdSmiParameterException( - device_handle, amdsmi_wrapper.amdsmi_processor_handle + processor_handle, amdsmi_wrapper.amdsmi_processor_handle ) vbios_info = amdsmi_wrapper.amdsmi_vbios_info_t() _check_res( amdsmi_wrapper.amdsmi_get_vbios_info( - device_handle, ctypes.byref(vbios_info)) + processor_handle, ctypes.byref(vbios_info)) ) return { @@ -677,17 +677,17 @@ def amdsmi_get_vbios_info( def amdsmi_get_gpu_activity( - device_handle: amdsmi_wrapper.amdsmi_processor_handle, + processor_handle: amdsmi_wrapper.amdsmi_processor_handle, ) -> Dict[str, Any]: - if not isinstance(device_handle, amdsmi_wrapper.amdsmi_processor_handle): + if not isinstance(processor_handle, amdsmi_wrapper.amdsmi_processor_handle): raise AmdSmiParameterException( - device_handle, amdsmi_wrapper.amdsmi_processor_handle + processor_handle, amdsmi_wrapper.amdsmi_processor_handle ) engine_usage = amdsmi_wrapper.amdsmi_engine_usage_t() _check_res( amdsmi_wrapper.amdsmi_get_gpu_activity( - device_handle, ctypes.byref(engine_usage) + processor_handle, ctypes.byref(engine_usage) ) ) @@ -699,12 +699,12 @@ def amdsmi_get_gpu_activity( def amdsmi_get_clock_measure( - device_handle: amdsmi_wrapper.amdsmi_processor_handle, + processor_handle: amdsmi_wrapper.amdsmi_processor_handle, clock_type: amdsmi_wrapper.amdsmi_clk_type_t, ) -> Dict[str, Any]: - if not isinstance(device_handle, amdsmi_wrapper.amdsmi_processor_handle): + if not isinstance(processor_handle, amdsmi_wrapper.amdsmi_processor_handle): raise AmdSmiParameterException( - device_handle, amdsmi_wrapper.amdsmi_processor_handle + processor_handle, amdsmi_wrapper.amdsmi_processor_handle ) if not isinstance(clock_type, AmdSmiClkType): raise AmdSmiParameterException(clock_type, AmdSmiClkType) @@ -712,7 +712,7 @@ def amdsmi_get_clock_measure( clock_measure = amdsmi_wrapper.amdsmi_clk_measure_t() _check_res( amdsmi_wrapper.amdsmi_get_clock_measure( - device_handle, + processor_handle, amdsmi_wrapper.amdsmi_clk_type_t(clock_type), ctypes.byref(clock_measure), ) @@ -727,11 +727,11 @@ def amdsmi_get_clock_measure( def amdsmi_get_bad_page_info( - device_handle: amdsmi_wrapper.amdsmi_processor_handle, + processor_handle: amdsmi_wrapper.amdsmi_processor_handle, ) -> Union[list, str]: - if not isinstance(device_handle, amdsmi_wrapper.amdsmi_processor_handle): + if not isinstance(processor_handle, amdsmi_wrapper.amdsmi_processor_handle): raise AmdSmiParameterException( - device_handle, amdsmi_wrapper.amdsmi_processor_handle + processor_handle, amdsmi_wrapper.amdsmi_processor_handle ) num_pages = ctypes.c_uint32() @@ -739,7 +739,7 @@ def amdsmi_get_bad_page_info( amdsmi_wrapper.amdsmi_retired_page_record_t)() _check_res( amdsmi_wrapper.amdsmi_get_bad_page_info( - device_handle, ctypes.byref(num_pages), retired_page_record + processor_handle, ctypes.byref(num_pages), retired_page_record ) ) table_records = _format_bad_page_info(retired_page_record, num_pages) @@ -752,12 +752,12 @@ def amdsmi_get_bad_page_info( def amdsmi_get_target_frequency_range( - device_handle: amdsmi_wrapper.amdsmi_processor_handle, + processor_handle: amdsmi_wrapper.amdsmi_processor_handle, clock_type: amdsmi_wrapper.amdsmi_clk_type_t, ) -> Dict[str, Any]: - if not isinstance(device_handle, amdsmi_wrapper.amdsmi_processor_handle): + if not isinstance(processor_handle, amdsmi_wrapper.amdsmi_processor_handle): raise AmdSmiParameterException( - device_handle, amdsmi_wrapper.amdsmi_processor_handle + processor_handle, amdsmi_wrapper.amdsmi_processor_handle ) if not isinstance(clock_type, AmdSmiClkType): raise AmdSmiParameterException(clock_type, AmdSmiClkType) @@ -765,7 +765,7 @@ def amdsmi_get_target_frequency_range( freq_range = amdsmi_wrapper.amdsmi_frequency_range_t() _check_res( amdsmi_wrapper.amdsmi_get_target_frequency_range( - device_handle, + processor_handle, amdsmi_wrapper.amdsmi_clk_type_t(clock_type), ctypes.byref(freq_range), ) @@ -780,17 +780,17 @@ def amdsmi_get_target_frequency_range( def amdsmi_get_ecc_error_count( - device_handle: amdsmi_wrapper.amdsmi_processor_handle, + processor_handle: amdsmi_wrapper.amdsmi_processor_handle, ) -> Dict[str, Any]: - if not isinstance(device_handle, amdsmi_wrapper.amdsmi_processor_handle): + if not isinstance(processor_handle, amdsmi_wrapper.amdsmi_processor_handle): raise AmdSmiParameterException( - device_handle, amdsmi_wrapper.amdsmi_processor_handle + processor_handle, amdsmi_wrapper.amdsmi_processor_handle ) error_count = amdsmi_wrapper.amdsmi_error_count_t() _check_res( amdsmi_wrapper.amdsmi_get_ecc_error_count( - device_handle, ctypes.byref(error_count) + processor_handle, ctypes.byref(error_count) ) ) @@ -801,17 +801,17 @@ def amdsmi_get_ecc_error_count( def amdsmi_get_board_info( - device_handle: amdsmi_wrapper.amdsmi_processor_handle, + processor_handle: amdsmi_wrapper.amdsmi_processor_handle, ) -> Dict[str, Any]: - if not isinstance(device_handle, amdsmi_wrapper.amdsmi_processor_handle): + if not isinstance(processor_handle, amdsmi_wrapper.amdsmi_processor_handle): raise AmdSmiParameterException( - device_handle, amdsmi_wrapper.amdsmi_processor_handle + processor_handle, amdsmi_wrapper.amdsmi_processor_handle ) board_info = amdsmi_wrapper.amdsmi_board_info_t() _check_res( amdsmi_wrapper.amdsmi_get_board_info( - device_handle, ctypes.byref(board_info)) + processor_handle, ctypes.byref(board_info)) ) return { @@ -822,11 +822,11 @@ def amdsmi_get_board_info( def amdsmi_get_ras_block_features_enabled( - device_handle: amdsmi_wrapper.amdsmi_processor_handle, + processor_handle: amdsmi_wrapper.amdsmi_processor_handle, ) -> Dict[str, Any]: - if not isinstance(device_handle, amdsmi_wrapper.amdsmi_processor_handle): + if not isinstance(processor_handle, amdsmi_wrapper.amdsmi_processor_handle): raise AmdSmiParameterException( - device_handle, amdsmi_wrapper.amdsmi_processor_handle + processor_handle, amdsmi_wrapper.amdsmi_processor_handle ) ras_state = amdsmi_wrapper.amdsmi_ras_err_state_t() @@ -838,7 +838,7 @@ def amdsmi_get_ras_block_features_enabled( gpu_block.name = "FUSE" _check_res( amdsmi_wrapper.amdsmi_get_ras_block_features_enabled( - device_handle, + processor_handle, amdsmi_wrapper.amdsmi_gpu_block_t(gpu_block.value), ctypes.byref(ras_state), ) @@ -854,11 +854,11 @@ def amdsmi_get_ras_block_features_enabled( def amdsmi_get_process_list( - device_handle: amdsmi_wrapper.amdsmi_processor_handle, + processor_handle: amdsmi_wrapper.amdsmi_processor_handle, ) -> List[amdsmi_wrapper.amdsmi_process_handle]: - if not isinstance(device_handle, amdsmi_wrapper.amdsmi_processor_handle): + if not isinstance(processor_handle, amdsmi_wrapper.amdsmi_processor_handle): raise AmdSmiParameterException( - device_handle, amdsmi_wrapper.amdsmi_processor_handle + processor_handle, amdsmi_wrapper.amdsmi_processor_handle ) max_processes = ctypes.c_uint32(0) @@ -866,7 +866,7 @@ def amdsmi_get_process_list( max_processes.value)() _check_res( amdsmi_wrapper.amdsmi_get_process_list( - device_handle, process_list, ctypes.byref(max_processes) + processor_handle, process_list, ctypes.byref(max_processes) ) ) @@ -874,7 +874,7 @@ def amdsmi_get_process_list( max_processes.value)() _check_res( amdsmi_wrapper.amdsmi_get_process_list( - device_handle, process_list, ctypes.byref(max_processes) + processor_handle, process_list, ctypes.byref(max_processes) ) ) @@ -882,12 +882,12 @@ def amdsmi_get_process_list( def amdsmi_get_process_info( - device_handle: amdsmi_wrapper.amdsmi_processor_handle, + processor_handle: amdsmi_wrapper.amdsmi_processor_handle, process: amdsmi_wrapper.amdsmi_process_handle, ) -> Dict[str, Any]: - if not isinstance(device_handle, amdsmi_wrapper.amdsmi_processor_handle): + if not isinstance(processor_handle, amdsmi_wrapper.amdsmi_processor_handle): raise AmdSmiParameterException( - device_handle, amdsmi_wrapper.amdsmi_processor_handle + processor_handle, amdsmi_wrapper.amdsmi_processor_handle ) if not isinstance(process, amdsmi_wrapper.amdsmi_process_handle): @@ -897,7 +897,7 @@ def amdsmi_get_process_info( info = amdsmi_wrapper.amdsmi_proc_info_t() _check_res( amdsmi_wrapper.amdsmi_get_process_info( - device_handle, process, ctypes.byref(info) + processor_handle, process, ctypes.byref(info) ) ) @@ -920,10 +920,10 @@ def amdsmi_get_process_info( } -def amdsmi_get_device_uuid(device_handle: amdsmi_wrapper.amdsmi_processor_handle) -> str: - if not isinstance(device_handle, amdsmi_wrapper.amdsmi_processor_handle): +def amdsmi_get_device_uuid(processor_handle: amdsmi_wrapper.amdsmi_processor_handle) -> str: + if not isinstance(processor_handle, amdsmi_wrapper.amdsmi_processor_handle): raise AmdSmiParameterException( - device_handle, amdsmi_wrapper.amdsmi_processor_handle + processor_handle, amdsmi_wrapper.amdsmi_processor_handle ) uuid = ctypes.create_string_buffer(_AMDSMI_GPU_UUID_SIZE) @@ -933,7 +933,7 @@ def amdsmi_get_device_uuid(device_handle: amdsmi_wrapper.amdsmi_processor_handle _check_res( amdsmi_wrapper.amdsmi_get_device_uuid( - device_handle, ctypes.byref(uuid_length), uuid + processor_handle, ctypes.byref(uuid_length), uuid ) ) @@ -941,11 +941,11 @@ def amdsmi_get_device_uuid(device_handle: amdsmi_wrapper.amdsmi_processor_handle def amdsmi_get_driver_version( - device_handle: amdsmi_wrapper.amdsmi_processor_handle, + processor_handle: amdsmi_wrapper.amdsmi_processor_handle, ) -> str: - if not isinstance(device_handle, amdsmi_wrapper.amdsmi_processor_handle): + if not isinstance(processor_handle, amdsmi_wrapper.amdsmi_processor_handle): raise AmdSmiParameterException( - device_handle, amdsmi_wrapper.amdsmi_processor_handle + processor_handle, amdsmi_wrapper.amdsmi_processor_handle ) length = ctypes.c_int() @@ -955,7 +955,7 @@ def amdsmi_get_driver_version( _check_res( amdsmi_wrapper.amdsmi_get_driver_version( - device_handle, ctypes.byref(length), version + processor_handle, ctypes.byref(length), version ) ) @@ -963,17 +963,17 @@ def amdsmi_get_driver_version( def amdsmi_get_power_measure( - device_handle: amdsmi_wrapper.amdsmi_processor_handle, + processor_handle: amdsmi_wrapper.amdsmi_processor_handle, ) -> Dict[str, Any]: - if not isinstance(device_handle, amdsmi_wrapper.amdsmi_processor_handle): + if not isinstance(processor_handle, amdsmi_wrapper.amdsmi_processor_handle): raise AmdSmiParameterException( - device_handle, amdsmi_wrapper.amdsmi_processor_handle + processor_handle, amdsmi_wrapper.amdsmi_processor_handle ) power_measure = amdsmi_wrapper.amdsmi_power_measure_t() _check_res( amdsmi_wrapper.amdsmi_get_power_measure( - device_handle, ctypes.byref(power_measure) + processor_handle, ctypes.byref(power_measure) ) ) @@ -986,14 +986,14 @@ def amdsmi_get_power_measure( def amdsmi_get_fw_info( - device_handle: amdsmi_wrapper.amdsmi_processor_handle + processor_handle: amdsmi_wrapper.amdsmi_processor_handle ) -> List[Dict[str, Any]]: - if not isinstance(device_handle, amdsmi_wrapper.amdsmi_processor_handle): + if not isinstance(processor_handle, amdsmi_wrapper.amdsmi_processor_handle): raise AmdSmiParameterException( - device_handle, amdsmi_wrapper.amdsmi_processor_handle) + processor_handle, amdsmi_wrapper.amdsmi_processor_handle) fw_info = amdsmi_wrapper.amdsmi_fw_info_t() _check_res(amdsmi_wrapper.amdsmi_get_fw_info( - device_handle, ctypes.byref(fw_info))) + processor_handle, ctypes.byref(fw_info))) firmwares = list() for i in range(0, fw_info.num_fw_info): firmwares.append({ @@ -1006,34 +1006,34 @@ def amdsmi_get_fw_info( def amdsmi_get_vram_usage( - device_handle: amdsmi_wrapper.amdsmi_processor_handle, + processor_handle: amdsmi_wrapper.amdsmi_processor_handle, ) -> Dict[str, Any]: - if not isinstance(device_handle, amdsmi_wrapper.amdsmi_processor_handle): + if not isinstance(processor_handle, amdsmi_wrapper.amdsmi_processor_handle): raise AmdSmiParameterException( - device_handle, amdsmi_wrapper.amdsmi_processor_handle + processor_handle, amdsmi_wrapper.amdsmi_processor_handle ) vram_info = amdsmi_wrapper.amdsmi_vram_info_t() _check_res( amdsmi_wrapper.amdsmi_get_vram_usage( - device_handle, ctypes.byref(vram_info)) + processor_handle, ctypes.byref(vram_info)) ) return {"vram_total": vram_info.vram_total, "vram_used": vram_info.vram_used} def amdsmi_get_pcie_link_status( - device_handle: amdsmi_wrapper.amdsmi_processor_handle, + processor_handle: amdsmi_wrapper.amdsmi_processor_handle, ) -> Dict[str, Any]: - if not isinstance(device_handle, amdsmi_wrapper.amdsmi_processor_handle): + if not isinstance(processor_handle, amdsmi_wrapper.amdsmi_processor_handle): raise AmdSmiParameterException( - device_handle, amdsmi_wrapper.amdsmi_processor_handle + processor_handle, amdsmi_wrapper.amdsmi_processor_handle ) pcie_info = amdsmi_wrapper.amdsmi_pcie_info_t() _check_res( amdsmi_wrapper.amdsmi_get_pcie_link_status( - device_handle, ctypes.byref(pcie_info) + processor_handle, ctypes.byref(pcie_info) ) ) @@ -1041,39 +1041,39 @@ def amdsmi_get_pcie_link_status( def amdsmi_get_pcie_link_caps( - device_handle: amdsmi_wrapper.amdsmi_processor_handle, + processor_handle: amdsmi_wrapper.amdsmi_processor_handle, ) -> Dict[str, Any]: - if not isinstance(device_handle, amdsmi_wrapper.amdsmi_processor_handle): + if not isinstance(processor_handle, amdsmi_wrapper.amdsmi_processor_handle): raise AmdSmiParameterException( - device_handle, amdsmi_wrapper.amdsmi_processor_handle + processor_handle, amdsmi_wrapper.amdsmi_processor_handle ) pcie_info = amdsmi_wrapper.amdsmi_pcie_info_t() _check_res( amdsmi_wrapper.amdsmi_get_pcie_link_caps( - device_handle, ctypes.byref(pcie_info)) + processor_handle, ctypes.byref(pcie_info)) ) return {"pcie_lanes": pcie_info.pcie_lanes, "pcie_speed": pcie_info.pcie_speed} -def amdsmi_get_device_handle_from_bdf(bdf): +def amdsmi_get_processor_handle_from_bdf(bdf): bdf = _parse_bdf(bdf) if bdf is None: raise AmdSmiBdfFormatException(bdf) amdsmi_bdf = _make_amdsmi_bdf_from_list(bdf) - device_handle = amdsmi_wrapper.amdsmi_processor_handle() - _check_res(amdsmi_wrapper.amdsmi_get_device_handle_from_bdf( - amdsmi_bdf, ctypes.byref(device_handle))) - return device_handle + processor_handle = amdsmi_wrapper.amdsmi_processor_handle() + _check_res(amdsmi_wrapper.amdsmi_get_processor_handle_from_bdf( + amdsmi_bdf, ctypes.byref(processor_handle))) + return processor_handle def amdsmi_dev_get_vendor_name( - device_handle: amdsmi_wrapper.amdsmi_processor_handle, + processor_handle: amdsmi_wrapper.amdsmi_processor_handle, ) -> str: - if not isinstance(device_handle, amdsmi_wrapper.amdsmi_processor_handle): + if not isinstance(processor_handle, amdsmi_wrapper.amdsmi_processor_handle): raise AmdSmiParameterException( - device_handle, amdsmi_wrapper.amdsmi_processor_handle + processor_handle, amdsmi_wrapper.amdsmi_processor_handle ) length = ctypes.c_uint64() @@ -1083,29 +1083,29 @@ def amdsmi_dev_get_vendor_name( _check_res( amdsmi_wrapper.amdsmi_dev_get_vendor_name( - device_handle, vendor_name, length) + processor_handle, vendor_name, length) ) return vendor_name.value.decode("utf-8") -def amdsmi_dev_get_id(device_handle: amdsmi_wrapper.amdsmi_processor_handle): - if not isinstance(device_handle, amdsmi_wrapper.amdsmi_processor_handle): +def amdsmi_dev_get_id(processor_handle: amdsmi_wrapper.amdsmi_processor_handle): + if not isinstance(processor_handle, amdsmi_wrapper.amdsmi_processor_handle): raise AmdSmiParameterException( - device_handle, amdsmi_wrapper.amdsmi_processor_handle + processor_handle, amdsmi_wrapper.amdsmi_processor_handle ) id = ctypes.c_uint16() _check_res(amdsmi_wrapper.amdsmi_dev_get_id( - device_handle, ctypes.byref(id))) + processor_handle, ctypes.byref(id))) return id.value -def amdsmi_dev_get_vram_vendor(device_handle: amdsmi_wrapper.amdsmi_processor_handle): - if not isinstance(device_handle, amdsmi_wrapper.amdsmi_processor_handle): +def amdsmi_dev_get_vram_vendor(processor_handle: amdsmi_wrapper.amdsmi_processor_handle): + if not isinstance(processor_handle, amdsmi_wrapper.amdsmi_processor_handle): raise AmdSmiParameterException( - device_handle, amdsmi_wrapper.amdsmi_processor_handle + processor_handle, amdsmi_wrapper.amdsmi_processor_handle ) length = ctypes.c_uint32() @@ -1115,47 +1115,47 @@ def amdsmi_dev_get_vram_vendor(device_handle: amdsmi_wrapper.amdsmi_processor_ha _check_res( amdsmi_wrapper.amdsmi_dev_get_vram_vendor( - device_handle, vram_vendor, length) + processor_handle, vram_vendor, length) ) return vram_vendor.value.decode("utf-8") -def amdsmi_dev_get_drm_render_minor(device_handle: amdsmi_wrapper.amdsmi_processor_handle): - if not isinstance(device_handle, amdsmi_wrapper.amdsmi_processor_handle): +def amdsmi_dev_get_drm_render_minor(processor_handle: amdsmi_wrapper.amdsmi_processor_handle): + if not isinstance(processor_handle, amdsmi_wrapper.amdsmi_processor_handle): raise AmdSmiParameterException( - device_handle, amdsmi_wrapper.amdsmi_processor_handle + processor_handle, amdsmi_wrapper.amdsmi_processor_handle ) minor = ctypes.c_uint32() _check_res( amdsmi_wrapper.amdsmi_dev_get_drm_render_minor( - device_handle, ctypes.byref(minor) + processor_handle, ctypes.byref(minor) ) ) return minor.value -def amdsmi_dev_get_subsystem_id(device_handle: amdsmi_wrapper.amdsmi_processor_handle): - if not isinstance(device_handle, amdsmi_wrapper.amdsmi_processor_handle): +def amdsmi_dev_get_subsystem_id(processor_handle: amdsmi_wrapper.amdsmi_processor_handle): + if not isinstance(processor_handle, amdsmi_wrapper.amdsmi_processor_handle): raise AmdSmiParameterException( - device_handle, amdsmi_wrapper.amdsmi_processor_handle + processor_handle, amdsmi_wrapper.amdsmi_processor_handle ) id = ctypes.c_uint16() _check_res( amdsmi_wrapper.amdsmi_dev_get_subsystem_id( - device_handle, ctypes.byref(id)) + processor_handle, ctypes.byref(id)) ) return id.value -def amdsmi_dev_get_subsystem_name(device_handle: amdsmi_wrapper.amdsmi_processor_handle): - if not isinstance(device_handle, amdsmi_wrapper.amdsmi_processor_handle): +def amdsmi_dev_get_subsystem_name(processor_handle: amdsmi_wrapper.amdsmi_processor_handle): + if not isinstance(processor_handle, amdsmi_wrapper.amdsmi_processor_handle): raise AmdSmiParameterException( - device_handle, amdsmi_wrapper.amdsmi_processor_handle + processor_handle, amdsmi_wrapper.amdsmi_processor_handle ) length = ctypes.c_uint64() @@ -1165,7 +1165,7 @@ def amdsmi_dev_get_subsystem_name(device_handle: amdsmi_wrapper.amdsmi_processor _check_res( amdsmi_wrapper.amdsmi_dev_get_subsystem_name( - device_handle, name, length) + processor_handle, name, length) ) return name.value.decode("utf-8") @@ -1200,18 +1200,18 @@ def amdsmi_get_version_str(sw_component: AmdSmiSwComponent): def amdsmi_topo_get_numa_node_number( - device_handle: amdsmi_wrapper.amdsmi_processor_handle, + processor_handle: amdsmi_wrapper.amdsmi_processor_handle, ): - if not isinstance(device_handle, amdsmi_wrapper.amdsmi_processor_handle): + if not isinstance(processor_handle, amdsmi_wrapper.amdsmi_processor_handle): raise AmdSmiParameterException( - device_handle, amdsmi_wrapper.amdsmi_processor_handle + processor_handle, amdsmi_wrapper.amdsmi_processor_handle ) numa_node_number = ctypes.c_uint32() _check_res( amdsmi_wrapper.amdsmi_topo_get_numa_node_number( - device_handle, ctypes.byref(numa_node_number) + processor_handle, ctypes.byref(numa_node_number) ) ) @@ -1219,24 +1219,24 @@ def amdsmi_topo_get_numa_node_number( def amdsmi_topo_get_link_weight( - device_handle_src: amdsmi_wrapper.amdsmi_processor_handle, - device_handle_dst: amdsmi_wrapper.amdsmi_processor_handle, + processor_handle_src: amdsmi_wrapper.amdsmi_processor_handle, + processor_handle_dst: amdsmi_wrapper.amdsmi_processor_handle, ): - if not isinstance(device_handle_src, amdsmi_wrapper.amdsmi_processor_handle): + if not isinstance(processor_handle_src, amdsmi_wrapper.amdsmi_processor_handle): raise AmdSmiParameterException( - device_handle_src, amdsmi_wrapper.amdsmi_processor_handle + processor_handle_src, amdsmi_wrapper.amdsmi_processor_handle ) - if not isinstance(device_handle_dst, amdsmi_wrapper.amdsmi_processor_handle): + if not isinstance(processor_handle_dst, amdsmi_wrapper.amdsmi_processor_handle): raise AmdSmiParameterException( - device_handle_dst, amdsmi_wrapper.amdsmi_processor_handle + processor_handle_dst, amdsmi_wrapper.amdsmi_processor_handle ) weight = ctypes.c_uint64() _check_res( amdsmi_wrapper.amdsmi_topo_get_link_weight( - device_handle_src, device_handle_dst, ctypes.byref(weight) + processor_handle_src, processor_handle_dst, ctypes.byref(weight) ) ) @@ -1244,17 +1244,17 @@ def amdsmi_topo_get_link_weight( def amdsmi_get_minmax_bandwidth( - device_handle_src: amdsmi_wrapper.amdsmi_processor_handle, - device_handle_dst: amdsmi_wrapper.amdsmi_processor_handle, + processor_handle_src: amdsmi_wrapper.amdsmi_processor_handle, + processor_handle_dst: amdsmi_wrapper.amdsmi_processor_handle, ): - if not isinstance(device_handle_src, amdsmi_wrapper.amdsmi_processor_handle): + if not isinstance(processor_handle_src, amdsmi_wrapper.amdsmi_processor_handle): raise AmdSmiParameterException( - device_handle_src, amdsmi_wrapper.amdsmi_processor_handle + processor_handle_src, amdsmi_wrapper.amdsmi_processor_handle ) - if not isinstance(device_handle_dst, amdsmi_wrapper.amdsmi_processor_handle): + if not isinstance(processor_handle_dst, amdsmi_wrapper.amdsmi_processor_handle): raise AmdSmiParameterException( - device_handle_dst, amdsmi_wrapper.amdsmi_processor_handle + processor_handle_dst, amdsmi_wrapper.amdsmi_processor_handle ) min_bandwidth = ctypes.c_uint64() @@ -1262,8 +1262,8 @@ def amdsmi_get_minmax_bandwidth( _check_res( amdsmi_wrapper. amdsmi_get_minmax_bandwidth( - device_handle_src, - device_handle_dst, + processor_handle_src, + processor_handle_dst, ctypes.byref(min_bandwidth), ctypes.byref(max_bandwidth), ) @@ -1273,17 +1273,17 @@ def amdsmi_get_minmax_bandwidth( def amdsmi_topo_get_link_type( - device_handle_src: amdsmi_wrapper.amdsmi_processor_handle, - device_handle_dst: amdsmi_wrapper.amdsmi_processor_handle, + processor_handle_src: amdsmi_wrapper.amdsmi_processor_handle, + processor_handle_dst: amdsmi_wrapper.amdsmi_processor_handle, ): - if not isinstance(device_handle_src, amdsmi_wrapper.amdsmi_processor_handle): + if not isinstance(processor_handle_src, amdsmi_wrapper.amdsmi_processor_handle): raise AmdSmiParameterException( - device_handle_src, amdsmi_wrapper.amdsmi_processor_handle + processor_handle_src, amdsmi_wrapper.amdsmi_processor_handle ) - if not isinstance(device_handle_dst, amdsmi_wrapper.amdsmi_processor_handle): + if not isinstance(processor_handle_dst, amdsmi_wrapper.amdsmi_processor_handle): raise AmdSmiParameterException( - device_handle_dst, amdsmi_wrapper.amdsmi_processor_handle + processor_handle_dst, amdsmi_wrapper.amdsmi_processor_handle ) hops = ctypes.c_uint64() @@ -1292,8 +1292,8 @@ def amdsmi_topo_get_link_type( _check_res( amdsmi_wrapper.amdsmi_topo_get_link_type( - #device_handle_src, device_handle_dst, ctypes.byref(hops), type - device_handle_src, device_handle_dst, ctypes.byref( + #processor_handle_src, processor_handle_dst, ctypes.byref(hops), type + processor_handle_src, processor_handle_dst, ctypes.byref( hops), ctypes.byref(type) ) ) @@ -1302,39 +1302,39 @@ def amdsmi_topo_get_link_type( def amdsmi_is_P2P_accessible( - device_handle_src: amdsmi_wrapper.amdsmi_processor_handle, - device_handle_dst: amdsmi_wrapper.amdsmi_processor_handle, + processor_handle_src: amdsmi_wrapper.amdsmi_processor_handle, + processor_handle_dst: amdsmi_wrapper.amdsmi_processor_handle, ): - if not isinstance(device_handle_src, amdsmi_wrapper.amdsmi_processor_handle): + if not isinstance(processor_handle_src, amdsmi_wrapper.amdsmi_processor_handle): raise AmdSmiParameterException( - device_handle_src, amdsmi_wrapper.amdsmi_processor_handle + processor_handle_src, amdsmi_wrapper.amdsmi_processor_handle ) - if not isinstance(device_handle_dst, amdsmi_wrapper.amdsmi_processor_handle): + if not isinstance(processor_handle_dst, amdsmi_wrapper.amdsmi_processor_handle): raise AmdSmiParameterException( - device_handle_dst, amdsmi_wrapper.amdsmi_processor_handle + processor_handle_dst, amdsmi_wrapper.amdsmi_processor_handle ) accessible = ctypes.c_bool() _check_res( amdsmi_wrapper.amdsmi_is_P2P_accessible( - device_handle_src, device_handle_dst, ctypes.byref(accessible) + processor_handle_src, processor_handle_dst, ctypes.byref(accessible) ) ) return accessible.value -def amdsmi_get_xgmi_info(device_handle: amdsmi_wrapper.amdsmi_processor_handle): - if not isinstance(device_handle, amdsmi_wrapper.amdsmi_processor_handle): +def amdsmi_get_xgmi_info(processor_handle: amdsmi_wrapper.amdsmi_processor_handle): + if not isinstance(processor_handle, amdsmi_wrapper.amdsmi_processor_handle): raise AmdSmiParameterException( - device_handle, amdsmi_wrapper.amdsmi_processor_handle + processor_handle, amdsmi_wrapper.amdsmi_processor_handle ) xgmi_info = amdsmi_wrapper.amdsmi_xgmi_info_t() - _check_res(amdsmi_wrapper.amdsmi_get_xgmi_info(device_handle, xgmi_info)) + _check_res(amdsmi_wrapper.amdsmi_get_xgmi_info(processor_handle, xgmi_info)) return { "xgmi_lanes": xgmi_info.xgmi_lanes, @@ -1345,29 +1345,29 @@ def amdsmi_get_xgmi_info(device_handle: amdsmi_wrapper.amdsmi_processor_handle): def amdsmi_dev_counter_group_supported( - device_handle: amdsmi_wrapper.amdsmi_processor_handle, + processor_handle: amdsmi_wrapper.amdsmi_processor_handle, event_group: AmdSmiEventGroup, ): - if not isinstance(device_handle, amdsmi_wrapper.amdsmi_processor_handle): + if not isinstance(processor_handle, amdsmi_wrapper.amdsmi_processor_handle): raise AmdSmiParameterException( - device_handle, amdsmi_wrapper.amdsmi_processor_handle + processor_handle, amdsmi_wrapper.amdsmi_processor_handle ) if not isinstance(event_group, AmdSmiEventGroup): raise AmdSmiParameterException(event_group, AmdSmiEventGroup) _check_res( amdsmi_wrapper.amdsmi_dev_counter_group_supported( - device_handle, event_group) + processor_handle, event_group) ) def amdsmi_dev_create_counter( - device_handle: amdsmi_wrapper.amdsmi_processor_handle, + processor_handle: amdsmi_wrapper.amdsmi_processor_handle, event_type: AmdSmiEventType, ) -> amdsmi_wrapper.amdsmi_event_handle_t: - if not isinstance(device_handle, amdsmi_wrapper.amdsmi_processor_handle): + if not isinstance(processor_handle, amdsmi_wrapper.amdsmi_processor_handle): raise AmdSmiParameterException( - device_handle, amdsmi_wrapper.amdsmi_processor_handle + processor_handle, amdsmi_wrapper.amdsmi_processor_handle ) if not isinstance(event_type, AmdSmiEventType): raise AmdSmiParameterException(event_type, AmdSmiEventType) @@ -1375,7 +1375,7 @@ def amdsmi_dev_create_counter( event_handle = amdsmi_wrapper.amdsmi_event_handle_t() _check_res( amdsmi_wrapper.amdsmi_dev_create_counter( - device_handle, event_type, ctypes.byref(event_handle) + processor_handle, event_type, ctypes.byref(event_handle) ) ) @@ -1432,12 +1432,12 @@ def amdsmi_read_counter( def amdsmi_counter_get_available_counters( - device_handle: amdsmi_wrapper.amdsmi_processor_handle, + processor_handle: amdsmi_wrapper.amdsmi_processor_handle, event_group: AmdSmiEventGroup, ) -> int: - if not isinstance(device_handle, amdsmi_wrapper.amdsmi_processor_handle): + if not isinstance(processor_handle, amdsmi_wrapper.amdsmi_processor_handle): raise AmdSmiParameterException( - device_handle, amdsmi_wrapper.amdsmi_processor_handle + processor_handle, amdsmi_wrapper.amdsmi_processor_handle ) if not isinstance(event_group, AmdSmiEventGroup): raise AmdSmiParameterException(event_group, AmdSmiEventGroup) @@ -1445,7 +1445,7 @@ def amdsmi_counter_get_available_counters( _check_res( amdsmi_wrapper. amdsmi_counter_get_available_counters( - device_handle, event_group, ctypes.byref(available) + processor_handle, event_group, ctypes.byref(available) ) ) @@ -1453,26 +1453,26 @@ def amdsmi_counter_get_available_counters( def amdsmi_dev_set_perf_level( - device_handle: amdsmi_wrapper.amdsmi_processor_handle, + processor_handle: amdsmi_wrapper.amdsmi_processor_handle, perf_level: AmdSmiDevPerfLevel, ): - if not isinstance(device_handle, amdsmi_wrapper.amdsmi_processor_handle): + if not isinstance(processor_handle, amdsmi_wrapper.amdsmi_processor_handle): raise AmdSmiParameterException( - device_handle, amdsmi_wrapper.amdsmi_processor_handle + processor_handle, amdsmi_wrapper.amdsmi_processor_handle ) if not isinstance(perf_level, AmdSmiDevPerfLevel): raise AmdSmiParameterException(perf_level, AmdSmiDevPerfLevel) _check_res(amdsmi_wrapper. amdsmi_dev_set_perf_level( - device_handle, perf_level)) + processor_handle, perf_level)) def amdsmi_dev_get_power_profile_presets( - device_handle: amdsmi_wrapper.amdsmi_processor_handle, sensor_idx: int + processor_handle: amdsmi_wrapper.amdsmi_processor_handle, sensor_idx: int ) -> Dict[str, Any]: - if not isinstance(device_handle, amdsmi_wrapper.amdsmi_processor_handle): + if not isinstance(processor_handle, amdsmi_wrapper.amdsmi_processor_handle): raise AmdSmiParameterException( - device_handle, amdsmi_wrapper.amdsmi_processor_handle + processor_handle, amdsmi_wrapper.amdsmi_processor_handle ) if not isinstance(sensor_idx, int): raise AmdSmiParameterException(sensor_idx, int) @@ -1482,7 +1482,7 @@ def amdsmi_dev_get_power_profile_presets( _check_res( amdsmi_wrapper. amdsmi_dev_get_power_profile_presets( - device_handle, sensor_idx, ctypes.byref(status) + processor_handle, sensor_idx, ctypes.byref(status) ) ) @@ -1493,21 +1493,21 @@ def amdsmi_dev_get_power_profile_presets( } -def amdsmi_dev_reset_gpu(device_handle: amdsmi_wrapper.amdsmi_processor_handle): - if not isinstance(device_handle, amdsmi_wrapper.amdsmi_processor_handle): +def amdsmi_dev_reset_gpu(processor_handle: amdsmi_wrapper.amdsmi_processor_handle): + if not isinstance(processor_handle, amdsmi_wrapper.amdsmi_processor_handle): raise AmdSmiParameterException( - device_handle, amdsmi_wrapper.amdsmi_processor_handle + processor_handle, amdsmi_wrapper.amdsmi_processor_handle ) - _check_res(amdsmi_wrapper.amdsmi_dev_reset_gpu(device_handle)) + _check_res(amdsmi_wrapper.amdsmi_dev_reset_gpu(processor_handle)) def amdsmi_set_perf_determinism_mode( - device_handle: amdsmi_wrapper.amdsmi_processor_handle, clock_value: int + processor_handle: amdsmi_wrapper.amdsmi_processor_handle, clock_value: int ): - if not isinstance(device_handle, amdsmi_wrapper.amdsmi_processor_handle): + if not isinstance(processor_handle, amdsmi_wrapper.amdsmi_processor_handle): raise AmdSmiParameterException( - device_handle, amdsmi_wrapper.amdsmi_processor_handle + processor_handle, amdsmi_wrapper.amdsmi_processor_handle ) if not isinstance(clock_value, int): raise AmdSmiParameterException(clock_value, int) @@ -1515,16 +1515,16 @@ def amdsmi_set_perf_determinism_mode( _check_res( amdsmi_wrapper.amdsmi_set_perf_determinism_mode( - device_handle, clock_value) + processor_handle, clock_value) ) def amdsmi_dev_set_fan_speed( - device_handle: amdsmi_wrapper.amdsmi_processor_handle, sensor_idx: int, fan_speed: int + processor_handle: amdsmi_wrapper.amdsmi_processor_handle, sensor_idx: int, fan_speed: int ): - if not isinstance(device_handle, amdsmi_wrapper.amdsmi_processor_handle): + if not isinstance(processor_handle, amdsmi_wrapper.amdsmi_processor_handle): raise AmdSmiParameterException( - device_handle, amdsmi_wrapper.amdsmi_processor_handle + processor_handle, amdsmi_wrapper.amdsmi_processor_handle ) if not isinstance(sensor_idx, int): raise AmdSmiParameterException(sensor_idx, int) @@ -1535,32 +1535,32 @@ def amdsmi_dev_set_fan_speed( _check_res( amdsmi_wrapper.amdsmi_dev_set_fan_speed( - device_handle, sensor_idx, fan_speed) + processor_handle, sensor_idx, fan_speed) ) def amdsmi_dev_reset_fan( - device_handle: amdsmi_wrapper.amdsmi_processor_handle, sensor_idx: int + processor_handle: amdsmi_wrapper.amdsmi_processor_handle, sensor_idx: int ): - if not isinstance(device_handle, amdsmi_wrapper.amdsmi_processor_handle): + if not isinstance(processor_handle, amdsmi_wrapper.amdsmi_processor_handle): raise AmdSmiParameterException( - device_handle, amdsmi_wrapper.amdsmi_processor_handle + processor_handle, amdsmi_wrapper.amdsmi_processor_handle ) if not isinstance(sensor_idx, int): raise AmdSmiParameterException(sensor_idx, int) sensor_idx = ctypes.c_uint32(sensor_idx) - _check_res(amdsmi_wrapper.amdsmi_dev_reset_fan(device_handle, sensor_idx)) + _check_res(amdsmi_wrapper.amdsmi_dev_reset_fan(processor_handle, sensor_idx)) def amdsmi_dev_set_clk_freq( - device_handle: amdsmi_wrapper.amdsmi_processor_handle, + processor_handle: amdsmi_wrapper.amdsmi_processor_handle, clk_type: AmdSmiClkType, freq_bitmask: int, ): - if not isinstance(device_handle, amdsmi_wrapper.amdsmi_processor_handle): + if not isinstance(processor_handle, amdsmi_wrapper.amdsmi_processor_handle): raise AmdSmiParameterException( - device_handle, amdsmi_wrapper.amdsmi_processor_handle + processor_handle, amdsmi_wrapper.amdsmi_processor_handle ) if not isinstance(clk_type, AmdSmiClkType): raise AmdSmiParameterException(clk_type, AmdSmiParameterException) @@ -1569,17 +1569,17 @@ def amdsmi_dev_set_clk_freq( freq_bitmask = ctypes.c_uint64(freq_bitmask) _check_res( amdsmi_wrapper. amdsmi_dev_set_clk_freq( - device_handle, clk_type, freq_bitmask + processor_handle, clk_type, freq_bitmask ) ) def amdsmi_dev_set_overdrive_level_v1( - device_handle: amdsmi_wrapper.amdsmi_processor_handle, overdrive_value: int + processor_handle: amdsmi_wrapper.amdsmi_processor_handle, overdrive_value: int ): - if not isinstance(device_handle, amdsmi_wrapper.amdsmi_processor_handle): + if not isinstance(processor_handle, amdsmi_wrapper.amdsmi_processor_handle): raise AmdSmiParameterException( - device_handle, amdsmi_wrapper.amdsmi_processor_handle + processor_handle, amdsmi_wrapper.amdsmi_processor_handle ) if not isinstance(overdrive_value, int): raise AmdSmiParameterException(overdrive_value, int) @@ -1587,16 +1587,16 @@ def amdsmi_dev_set_overdrive_level_v1( _check_res( amdsmi_wrapper. amdsmi_dev_set_overdrive_level_v1( - device_handle, overdrive_value) + processor_handle, overdrive_value) ) def amdsmi_dev_set_overdrive_level( - device_handle: amdsmi_wrapper.amdsmi_processor_handle, overdrive_value: int + processor_handle: amdsmi_wrapper.amdsmi_processor_handle, overdrive_value: int ): - if not isinstance(device_handle, amdsmi_wrapper.amdsmi_processor_handle): + if not isinstance(processor_handle, amdsmi_wrapper.amdsmi_processor_handle): raise AmdSmiParameterException( - device_handle, amdsmi_wrapper.amdsmi_processor_handle + processor_handle, amdsmi_wrapper.amdsmi_processor_handle ) if not isinstance(overdrive_value, int): raise AmdSmiParameterException(overdrive_value, int) @@ -1604,38 +1604,38 @@ def amdsmi_dev_set_overdrive_level( _check_res( amdsmi_wrapper. amdsmi_dev_set_overdrive_level( - device_handle, overdrive_value) + processor_handle, overdrive_value) ) def amdsmi_dev_open_supported_func_iterator( - device_handle: amdsmi_wrapper.amdsmi_processor_handle, + processor_handle: amdsmi_wrapper.amdsmi_processor_handle, ) -> amdsmi_wrapper.amdsmi_func_id_iter_handle_t: - if not isinstance(device_handle, amdsmi_wrapper.amdsmi_processor_handle): + if not isinstance(processor_handle, amdsmi_wrapper.amdsmi_processor_handle): raise AmdSmiParameterException( - device_handle, amdsmi_wrapper.amdsmi_processor_handle + processor_handle, amdsmi_wrapper.amdsmi_processor_handle ) obj_handle = amdsmi_wrapper.amdsmi_func_id_iter_handle_t() _check_res( amdsmi_wrapper.amdsmi_dev_open_supported_func_iterator( - device_handle, ctypes.byref(obj_handle) + processor_handle, ctypes.byref(obj_handle) ) ) return obj_handle -def amdsmi_dev_get_pci_id(device_handle: amdsmi_wrapper.amdsmi_processor_handle): - if not isinstance(device_handle, amdsmi_wrapper.amdsmi_processor_handle): +def amdsmi_dev_get_pci_id(processor_handle: amdsmi_wrapper.amdsmi_processor_handle): + if not isinstance(processor_handle, amdsmi_wrapper.amdsmi_processor_handle): raise AmdSmiParameterException( - device_handle, amdsmi_wrapper.amdsmi_processor_handle + processor_handle, amdsmi_wrapper.amdsmi_processor_handle ) bdfid = ctypes.c_uint64() _check_res( amdsmi_wrapper.amdsmi_dev_get_pci_id( - device_handle, ctypes.byref(bdfid)) + processor_handle, ctypes.byref(bdfid)) ) return bdfid.value @@ -1717,11 +1717,11 @@ def amdsmi_get_func_iter_value( def amdsmi_dev_set_pci_bandwidth( - device_handle: amdsmi_wrapper.amdsmi_processor_handle, bitmask: int + processor_handle: amdsmi_wrapper.amdsmi_processor_handle, bitmask: int ) -> None: - if not isinstance(device_handle, amdsmi_wrapper.amdsmi_processor_handle): + if not isinstance(processor_handle, amdsmi_wrapper.amdsmi_processor_handle): raise AmdSmiParameterException( - device_handle, amdsmi_wrapper.amdsmi_processor_handle + processor_handle, amdsmi_wrapper.amdsmi_processor_handle ) if not isinstance(bitmask, int): @@ -1729,7 +1729,7 @@ def amdsmi_dev_set_pci_bandwidth( _check_res( amdsmi_wrapper. amdsmi_dev_set_pci_bandwidth( - device_handle, ctypes.c_uint64(bitmask) + processor_handle, ctypes.c_uint64(bitmask) ) ) @@ -1742,17 +1742,17 @@ def _format_transfer_rate(transfer_rate): } -def amdsmi_dev_get_pci_bandwidth(device_handle: amdsmi_wrapper.amdsmi_processor_handle): - if not isinstance(device_handle, amdsmi_wrapper.amdsmi_processor_handle): +def amdsmi_dev_get_pci_bandwidth(processor_handle: amdsmi_wrapper.amdsmi_processor_handle): + if not isinstance(processor_handle, amdsmi_wrapper.amdsmi_processor_handle): raise AmdSmiParameterException( - device_handle, amdsmi_wrapper.amdsmi_processor_handle + processor_handle, amdsmi_wrapper.amdsmi_processor_handle ) bandwidth = amdsmi_wrapper.amdsmi_pcie_bandwidth_t() _check_res( amdsmi_wrapper.amdsmi_dev_get_pci_bandwidth( - device_handle, ctypes.byref(bandwidth)) + processor_handle, ctypes.byref(bandwidth)) ) transfer_rate = _format_transfer_rate(bandwidth.transfer_rate) @@ -1763,10 +1763,10 @@ def amdsmi_dev_get_pci_bandwidth(device_handle: amdsmi_wrapper.amdsmi_processor_ } -def amdsmi_dev_get_pci_throughput(device_handle: amdsmi_wrapper.amdsmi_processor_handle): - if not isinstance(device_handle, amdsmi_wrapper.amdsmi_processor_handle): +def amdsmi_dev_get_pci_throughput(processor_handle: amdsmi_wrapper.amdsmi_processor_handle): + if not isinstance(processor_handle, amdsmi_wrapper.amdsmi_processor_handle): raise AmdSmiParameterException( - device_handle, amdsmi_wrapper.amdsmi_processor_handle + processor_handle, amdsmi_wrapper.amdsmi_processor_handle ) sent = ctypes.c_uint64() @@ -1774,7 +1774,7 @@ def amdsmi_dev_get_pci_throughput(device_handle: amdsmi_wrapper.amdsmi_processor max_pkt_sz = ctypes.c_uint64() _check_res( - amdsmi_wrapper.amdsmi_dev_get_pci_throughput(device_handle, ctypes.byref( + amdsmi_wrapper.amdsmi_dev_get_pci_throughput(processor_handle, ctypes.byref( sent), ctypes.byref(received), ctypes.byref(max_pkt_sz)) ) @@ -1785,44 +1785,44 @@ def amdsmi_dev_get_pci_throughput(device_handle: amdsmi_wrapper.amdsmi_processor } -def amdsmi_dev_get_pci_replay_counter(device_handle: amdsmi_wrapper.amdsmi_processor_handle): - if not isinstance(device_handle, amdsmi_wrapper.amdsmi_processor_handle): +def amdsmi_dev_get_pci_replay_counter(processor_handle: amdsmi_wrapper.amdsmi_processor_handle): + if not isinstance(processor_handle, amdsmi_wrapper.amdsmi_processor_handle): raise AmdSmiParameterException( - device_handle, amdsmi_wrapper.amdsmi_processor_handle + processor_handle, amdsmi_wrapper.amdsmi_processor_handle ) counter = ctypes.c_uint64() _check_res( amdsmi_wrapper. amdsmi_dev_get_pci_replay_counter( - device_handle, ctypes.byref(counter)) + processor_handle, ctypes.byref(counter)) ) return counter.value -def amdsmi_topo_get_numa_affinity(device_handle: amdsmi_wrapper.amdsmi_processor_handle): - if not isinstance(device_handle, amdsmi_wrapper.amdsmi_processor_handle): +def amdsmi_topo_get_numa_affinity(processor_handle: amdsmi_wrapper.amdsmi_processor_handle): + if not isinstance(processor_handle, amdsmi_wrapper.amdsmi_processor_handle): raise AmdSmiParameterException( - device_handle, amdsmi_wrapper.amdsmi_processor_handle + processor_handle, amdsmi_wrapper.amdsmi_processor_handle ) numa_node = ctypes.c_uint32() _check_res( amdsmi_wrapper.amdsmi_topo_get_numa_affinity( - device_handle, ctypes.byref(numa_node)) + processor_handle, ctypes.byref(numa_node)) ) return numa_node.value def amdsmi_dev_set_power_cap( - device_handle: amdsmi_wrapper.amdsmi_processor_handle, sensor_ind: int, cap: int + processor_handle: amdsmi_wrapper.amdsmi_processor_handle, sensor_ind: int, cap: int ) -> None: - if not isinstance(device_handle, amdsmi_wrapper.amdsmi_processor_handle): + if not isinstance(processor_handle, amdsmi_wrapper.amdsmi_processor_handle): raise AmdSmiParameterException( - device_handle, amdsmi_wrapper.amdsmi_processor_handle + processor_handle, amdsmi_wrapper.amdsmi_processor_handle ) if not isinstance(sensor_ind, int): @@ -1833,35 +1833,35 @@ def amdsmi_dev_set_power_cap( _check_res( amdsmi_wrapper. amdsmi_dev_set_power_cap( - device_handle, ctypes.c_uint32(sensor_ind), ctypes.c_uint64(cap) + processor_handle, ctypes.c_uint32(sensor_ind), ctypes.c_uint64(cap) ) ) -def amdsmi_dev_get_power_ave(device_handle: amdsmi_wrapper.amdsmi_processor_handle, sensor_id: ctypes.c_uint32): - if not isinstance(device_handle, amdsmi_wrapper.amdsmi_processor_handle): +def amdsmi_dev_get_power_ave(processor_handle: amdsmi_wrapper.amdsmi_processor_handle, sensor_id: ctypes.c_uint32): + if not isinstance(processor_handle, amdsmi_wrapper.amdsmi_processor_handle): raise AmdSmiParameterException( - device_handle, amdsmi_wrapper.amdsmi_processor_handle + processor_handle, amdsmi_wrapper.amdsmi_processor_handle ) power = ctypes.c_uint64() _check_res( amdsmi_wrapper.amdsmi_dev_get_power_ave( - device_handle, sensor_id, ctypes.byref(power)) + processor_handle, sensor_id, ctypes.byref(power)) ) return power.value def amdsmi_dev_set_power_profile( - device_handle: amdsmi_wrapper.amdsmi_processor_handle, + processor_handle: amdsmi_wrapper.amdsmi_processor_handle, reserved: int, profile: AmdSmiPowerProfilePresetMasks, ) -> None: - if not isinstance(device_handle, amdsmi_wrapper.amdsmi_processor_handle): + if not isinstance(processor_handle, amdsmi_wrapper.amdsmi_processor_handle): raise AmdSmiParameterException( - device_handle, amdsmi_wrapper.amdsmi_processor_handle + processor_handle, amdsmi_wrapper.amdsmi_processor_handle ) if not isinstance(reserved, int): @@ -1872,15 +1872,15 @@ def amdsmi_dev_set_power_profile( _check_res( amdsmi_wrapper. amdsmi_dev_set_power_profile( - device_handle, ctypes.c_uint32(reserved), profile + processor_handle, ctypes.c_uint32(reserved), profile ) ) -def amdsmi_dev_get_energy_count(device_handle: amdsmi_wrapper.amdsmi_processor_handle): - if not isinstance(device_handle, amdsmi_wrapper.amdsmi_processor_handle): +def amdsmi_dev_get_energy_count(processor_handle: amdsmi_wrapper.amdsmi_processor_handle): + if not isinstance(processor_handle, amdsmi_wrapper.amdsmi_processor_handle): raise AmdSmiParameterException( - device_handle, amdsmi_wrapper.amdsmi_processor_handle + processor_handle, amdsmi_wrapper.amdsmi_processor_handle ) power = ctypes.c_uint64() @@ -1888,7 +1888,7 @@ def amdsmi_dev_get_energy_count(device_handle: amdsmi_wrapper.amdsmi_processor_h timestamp = ctypes.c_uint64() _check_res( - amdsmi_wrapper.amdsmi_dev_get_energy_count(device_handle, ctypes.byref( + amdsmi_wrapper.amdsmi_dev_get_energy_count(processor_handle, ctypes.byref( power), ctypes.byref(counter_resolution), ctypes.byref(timestamp)) ) @@ -1900,14 +1900,14 @@ def amdsmi_dev_get_energy_count(device_handle: amdsmi_wrapper.amdsmi_processor_h def amdsmi_dev_set_clk_range( - device_handle: amdsmi_wrapper.amdsmi_processor_handle, + processor_handle: amdsmi_wrapper.amdsmi_processor_handle, min_clk_value: int, max_clk_value: int, clk_type: AmdSmiClkType, ) -> None: - if not isinstance(device_handle, amdsmi_wrapper.amdsmi_processor_handle): + if not isinstance(processor_handle, amdsmi_wrapper.amdsmi_processor_handle): raise AmdSmiParameterException( - device_handle, amdsmi_wrapper.amdsmi_processor_handle + processor_handle, amdsmi_wrapper.amdsmi_processor_handle ) if not isinstance(min_clk_value, int): @@ -1921,7 +1921,7 @@ def amdsmi_dev_set_clk_range( _check_res( amdsmi_wrapper.amdsmi_dev_set_clk_range( - device_handle, + processor_handle, ctypes.c_uint64(min_clk_value), ctypes.c_uint64(max_clk_value), clk_type, @@ -1929,10 +1929,10 @@ def amdsmi_dev_set_clk_range( ) -def amdsmi_dev_get_memory_total(device_handle: amdsmi_wrapper.amdsmi_processor_handle, mem_type: AmdSmiMemoryType): - if not isinstance(device_handle, amdsmi_wrapper.amdsmi_processor_handle): +def amdsmi_dev_get_memory_total(processor_handle: amdsmi_wrapper.amdsmi_processor_handle, mem_type: AmdSmiMemoryType): + if not isinstance(processor_handle, amdsmi_wrapper.amdsmi_processor_handle): raise AmdSmiParameterException( - device_handle, amdsmi_wrapper.amdsmi_processor_handle + processor_handle, amdsmi_wrapper.amdsmi_processor_handle ) if not isinstance(mem_type, AmdSmiMemoryType): @@ -1944,21 +1944,21 @@ def amdsmi_dev_get_memory_total(device_handle: amdsmi_wrapper.amdsmi_processor_h _check_res( amdsmi_wrapper.amdsmi_dev_get_memory_total( - device_handle, mem_type, ctypes.byref(total)) + processor_handle, mem_type, ctypes.byref(total)) ) return total.value def amdsmi_dev_set_od_clk_info( - device_handle: amdsmi_wrapper.amdsmi_processor_handle, + processor_handle: amdsmi_wrapper.amdsmi_processor_handle, level: AmdSmiFreqInd, value: int, clk_type: AmdSmiClkType, ) -> None: - if not isinstance(device_handle, amdsmi_wrapper.amdsmi_processor_handle): + if not isinstance(processor_handle, amdsmi_wrapper.amdsmi_processor_handle): raise AmdSmiParameterException( - device_handle, amdsmi_wrapper.amdsmi_processor_handle + processor_handle, amdsmi_wrapper.amdsmi_processor_handle ) if not isinstance(level, AmdSmiFreqInd): @@ -1972,15 +1972,15 @@ def amdsmi_dev_set_od_clk_info( _check_res( amdsmi_wrapper. amdsmi_dev_set_od_clk_info( - device_handle, level, ctypes.c_uint64(value), clk_type + processor_handle, level, ctypes.c_uint64(value), clk_type ) ) -def amdsmi_dev_get_memory_usage(device_handle: amdsmi_wrapper.amdsmi_processor_handle, mem_type: AmdSmiMemoryType): - if not isinstance(device_handle, amdsmi_wrapper.amdsmi_processor_handle): +def amdsmi_dev_get_memory_usage(processor_handle: amdsmi_wrapper.amdsmi_processor_handle, mem_type: AmdSmiMemoryType): + if not isinstance(processor_handle, amdsmi_wrapper.amdsmi_processor_handle): raise AmdSmiParameterException( - device_handle, amdsmi_wrapper.amdsmi_processor_handle + processor_handle, amdsmi_wrapper.amdsmi_processor_handle ) if not isinstance(mem_type, AmdSmiMemoryType): @@ -1992,21 +1992,21 @@ def amdsmi_dev_get_memory_usage(device_handle: amdsmi_wrapper.amdsmi_processor_h _check_res( amdsmi_wrapper.amdsmi_dev_get_memory_usage( - device_handle, mem_type, ctypes.byref(used)) + processor_handle, mem_type, ctypes.byref(used)) ) return used.value def amdsmi_dev_set_od_volt_info( - device_handle: amdsmi_wrapper.amdsmi_processor_handle, + processor_handle: amdsmi_wrapper.amdsmi_processor_handle, vpoint: int, clk_value: int, volt_value: int, ) -> None: - if not isinstance(device_handle, amdsmi_wrapper.amdsmi_processor_handle): + if not isinstance(processor_handle, amdsmi_wrapper.amdsmi_processor_handle): raise AmdSmiParameterException( - device_handle, amdsmi_wrapper.amdsmi_processor_handle + processor_handle, amdsmi_wrapper.amdsmi_processor_handle ) if not isinstance(vpoint, int): @@ -2020,7 +2020,7 @@ def amdsmi_dev_set_od_volt_info( _check_res( amdsmi_wrapper. amdsmi_dev_set_od_volt_info( - device_handle, + processor_handle, ctypes.c_uint32(vpoint), ctypes.c_uint64(clk_value), ctypes.c_uint64(volt_value), @@ -2028,51 +2028,51 @@ def amdsmi_dev_set_od_volt_info( ) -def amdsmi_dev_get_memory_busy_percent(device_handle: amdsmi_wrapper.amdsmi_processor_handle): - if not isinstance(device_handle, amdsmi_wrapper.amdsmi_processor_handle): +def amdsmi_dev_get_memory_busy_percent(processor_handle: amdsmi_wrapper.amdsmi_processor_handle): + if not isinstance(processor_handle, amdsmi_wrapper.amdsmi_processor_handle): raise AmdSmiParameterException( - device_handle, amdsmi_wrapper.amdsmi_processor_handle + processor_handle, amdsmi_wrapper.amdsmi_processor_handle ) busy_percent = ctypes.c_uint32() _check_res( amdsmi_wrapper.amdsmi_dev_get_memory_busy_percent( - device_handle, ctypes.byref(busy_percent)) + processor_handle, ctypes.byref(busy_percent)) ) return busy_percent.value def amdsmi_dev_set_perf_level_v1( - device_handle: amdsmi_wrapper.amdsmi_processor_handle, + processor_handle: amdsmi_wrapper.amdsmi_processor_handle, perf_lvl: AmdSmiDevPerfLevel, ) -> None: - if not isinstance(device_handle, amdsmi_wrapper.amdsmi_processor_handle): + if not isinstance(processor_handle, amdsmi_wrapper.amdsmi_processor_handle): raise AmdSmiParameterException( - device_handle, amdsmi_wrapper.amdsmi_processor_handle + processor_handle, amdsmi_wrapper.amdsmi_processor_handle ) if not isinstance(perf_lvl, AmdSmiDevPerfLevel): raise AmdSmiParameterException(perf_lvl, AmdSmiDevPerfLevel) _check_res(amdsmi_wrapper. amdsmi_dev_set_perf_level_v1( - device_handle, perf_lvl)) + processor_handle, perf_lvl)) def amdsmi_dev_get_fan_rpms( - device_handle: amdsmi_wrapper.amdsmi_processor_handle, sensor_idx: int + processor_handle: amdsmi_wrapper.amdsmi_processor_handle, sensor_idx: int ) -> int: - if not isinstance(device_handle, amdsmi_wrapper.amdsmi_processor_handle): + if not isinstance(processor_handle, amdsmi_wrapper.amdsmi_processor_handle): raise AmdSmiParameterException( - device_handle, amdsmi_wrapper.amdsmi_processor_handle + processor_handle, amdsmi_wrapper.amdsmi_processor_handle ) if not isinstance(sensor_idx, int): raise AmdSmiParameterException(sensor_idx, int) fan_speed = ctypes.c_int64() _check_res( amdsmi_wrapper.amdsmi_dev_get_fan_rpms( - device_handle, sensor_idx, ctypes.byref(fan_speed) + processor_handle, sensor_idx, ctypes.byref(fan_speed) ) ) @@ -2080,18 +2080,18 @@ def amdsmi_dev_get_fan_rpms( def amdsmi_dev_get_fan_speed( - device_handle: amdsmi_wrapper.amdsmi_processor_handle, sensor_idx: int + processor_handle: amdsmi_wrapper.amdsmi_processor_handle, sensor_idx: int ) -> int: - if not isinstance(device_handle, amdsmi_wrapper.amdsmi_processor_handle): + if not isinstance(processor_handle, amdsmi_wrapper.amdsmi_processor_handle): raise AmdSmiParameterException( - device_handle, amdsmi_wrapper.amdsmi_processor_handle + processor_handle, amdsmi_wrapper.amdsmi_processor_handle ) if not isinstance(sensor_idx, int): raise AmdSmiParameterException(sensor_idx, int) fan_speed = ctypes.c_int64() _check_res( amdsmi_wrapper.amdsmi_dev_get_fan_speed( - device_handle, sensor_idx, ctypes.byref(fan_speed) + processor_handle, sensor_idx, ctypes.byref(fan_speed) ) ) @@ -2099,18 +2099,18 @@ def amdsmi_dev_get_fan_speed( def amdsmi_dev_get_fan_speed_max( - device_handle: amdsmi_wrapper.amdsmi_processor_handle, sensor_idx: int + processor_handle: amdsmi_wrapper.amdsmi_processor_handle, sensor_idx: int ) -> int: - if not isinstance(device_handle, amdsmi_wrapper.amdsmi_processor_handle): + if not isinstance(processor_handle, amdsmi_wrapper.amdsmi_processor_handle): raise AmdSmiParameterException( - device_handle, amdsmi_wrapper.amdsmi_processor_handle + processor_handle, amdsmi_wrapper.amdsmi_processor_handle ) if not isinstance(sensor_idx, int): raise AmdSmiParameterException(sensor_idx, int) fan_speed = ctypes.c_uint64() _check_res( amdsmi_wrapper.amdsmi_dev_get_fan_speed_max( - device_handle, sensor_idx, ctypes.byref(fan_speed) + processor_handle, sensor_idx, ctypes.byref(fan_speed) ) ) @@ -2118,13 +2118,13 @@ def amdsmi_dev_get_fan_speed_max( def amdsmi_dev_get_temp_metric( - device_handle: amdsmi_wrapper.amdsmi_processor_handle, + processor_handle: amdsmi_wrapper.amdsmi_processor_handle, sensor_type: AmdSmiTemperatureType, metric: AmdSmiTemperatureMetric, ) -> int: - if not isinstance(device_handle, amdsmi_wrapper.amdsmi_processor_handle): + if not isinstance(processor_handle, amdsmi_wrapper.amdsmi_processor_handle): raise AmdSmiParameterException( - device_handle, amdsmi_wrapper.amdsmi_processor_handle + processor_handle, amdsmi_wrapper.amdsmi_processor_handle ) if not isinstance(sensor_type, AmdSmiTemperatureType): raise AmdSmiParameterException(sensor_type, AmdSmiTemperatureType) @@ -2134,7 +2134,7 @@ def amdsmi_dev_get_temp_metric( temp_value = ctypes.c_int64() _check_res( amdsmi_wrapper. amdsmi_dev_get_temp_metric( - device_handle, sensor_type, metric, ctypes.byref(temp_value) + processor_handle, sensor_type, metric, ctypes.byref(temp_value) ) ) @@ -2142,13 +2142,13 @@ def amdsmi_dev_get_temp_metric( def amdsmi_dev_get_volt_metric( - device_handle: amdsmi_wrapper.amdsmi_processor_handle, + processor_handle: amdsmi_wrapper.amdsmi_processor_handle, sensor_type: AmdSmiVoltageType, metric: AmdSmiVoltageMetric, ) -> int: - if not isinstance(device_handle, amdsmi_wrapper.amdsmi_processor_handle): + if not isinstance(processor_handle, amdsmi_wrapper.amdsmi_processor_handle): raise AmdSmiParameterException( - device_handle, amdsmi_wrapper.amdsmi_processor_handle + processor_handle, amdsmi_wrapper.amdsmi_processor_handle ) if not isinstance(sensor_type, AmdSmiVoltageType): raise AmdSmiParameterException(sensor_type, AmdSmiVoltageType) @@ -2158,7 +2158,7 @@ def amdsmi_dev_get_volt_metric( voltage = ctypes.c_int64() _check_res( amdsmi_wrapper. amdsmi_dev_get_volt_metric( - device_handle, sensor_type, metric, ctypes.byref(voltage) + processor_handle, sensor_type, metric, ctypes.byref(voltage) ) ) @@ -2166,17 +2166,17 @@ def amdsmi_dev_get_volt_metric( def amdsmi_dev_get_busy_percent( - device_handle: amdsmi_wrapper.amdsmi_processor_handle, + processor_handle: amdsmi_wrapper.amdsmi_processor_handle, ) -> int: - if not isinstance(device_handle, amdsmi_wrapper.amdsmi_processor_handle): + if not isinstance(processor_handle, amdsmi_wrapper.amdsmi_processor_handle): raise AmdSmiParameterException( - device_handle, amdsmi_wrapper.amdsmi_processor_handle + processor_handle, amdsmi_wrapper.amdsmi_processor_handle ) busy_percent = ctypes.c_uint32() _check_res( amdsmi_wrapper.amdsmi_dev_get_busy_percent( - device_handle, ctypes.byref(busy_percent) + processor_handle, ctypes.byref(busy_percent) ) ) @@ -2184,12 +2184,12 @@ def amdsmi_dev_get_busy_percent( def amdsmi_get_utilization_count( - device_handle: amdsmi_wrapper.amdsmi_processor_handle, + processor_handle: amdsmi_wrapper.amdsmi_processor_handle, *counter_types: Tuple[AmdSmiUtilizationCounterType] ) -> List[Dict[str, Any]]: - if not isinstance(device_handle, amdsmi_wrapper.amdsmi_processor_handle): + if not isinstance(processor_handle, amdsmi_wrapper.amdsmi_processor_handle): raise AmdSmiParameterException( - device_handle, amdsmi_wrapper.amdsmi_processor_handle + processor_handle, amdsmi_wrapper.amdsmi_processor_handle ) if not len(counter_types): raise AmdSmiLibraryException(amdsmi_wrapper.AMDSMI_STATUS_INVAL) @@ -2210,7 +2210,7 @@ def amdsmi_get_utilization_count( _check_res( amdsmi_wrapper.amdsmi_get_utilization_count( - device_handle, util_counter_list, count, ctypes.byref(timestamp) + processor_handle, util_counter_list, count, ctypes.byref(timestamp) ) ) if count.value != len(counters): @@ -2230,18 +2230,18 @@ def amdsmi_get_utilization_count( def amdsmi_dev_get_perf_level( - device_handle: amdsmi_wrapper.amdsmi_processor_handle, + processor_handle: amdsmi_wrapper.amdsmi_processor_handle, ) -> str: - if not isinstance(device_handle, amdsmi_wrapper.amdsmi_processor_handle): + if not isinstance(processor_handle, amdsmi_wrapper.amdsmi_processor_handle): raise AmdSmiParameterException( - device_handle, amdsmi_wrapper.amdsmi_processor_handle + processor_handle, amdsmi_wrapper.amdsmi_processor_handle ) perf = amdsmi_wrapper.amdsmi_dev_perf_level_t() _check_res( amdsmi_wrapper.amdsmi_dev_get_perf_level( - device_handle, ctypes.byref(perf)) + processor_handle, ctypes.byref(perf)) ) result = amdsmi_wrapper.c__EA_amdsmi_dev_perf_level_t__enumvalues[perf.value] @@ -2254,31 +2254,31 @@ def amdsmi_dev_get_perf_level( def amdsmi_set_perf_determinism_mode( - device_handle: amdsmi_wrapper.amdsmi_processor_handle, clkvalue: int + processor_handle: amdsmi_wrapper.amdsmi_processor_handle, clkvalue: int ) -> None: - if not isinstance(device_handle, amdsmi_wrapper.amdsmi_processor_handle): + if not isinstance(processor_handle, amdsmi_wrapper.amdsmi_processor_handle): raise AmdSmiParameterException( - device_handle, amdsmi_wrapper.amdsmi_processor_handle + processor_handle, amdsmi_wrapper.amdsmi_processor_handle ) if not isinstance(clkvalue, int): raise AmdSmiParameterException(clkvalue, int) _check_res(amdsmi_wrapper.amdsmi_set_perf_determinism_mode( - device_handle, clkvalue)) + processor_handle, clkvalue)) def amdsmi_dev_get_overdrive_level( - device_handle: amdsmi_wrapper.amdsmi_processor_handle, + processor_handle: amdsmi_wrapper.amdsmi_processor_handle, ) -> int: - if not isinstance(device_handle, amdsmi_wrapper.amdsmi_processor_handle): + if not isinstance(processor_handle, amdsmi_wrapper.amdsmi_processor_handle): raise AmdSmiParameterException( - device_handle, amdsmi_wrapper.amdsmi_processor_handle + processor_handle, amdsmi_wrapper.amdsmi_processor_handle ) od_level = ctypes.c_uint32() _check_res( amdsmi_wrapper.amdsmi_dev_get_overdrive_level( - device_handle, ctypes.byref(od_level) + processor_handle, ctypes.byref(od_level) ) ) @@ -2286,11 +2286,11 @@ def amdsmi_dev_get_overdrive_level( def amdsmi_dev_get_gpu_clk_freq( - device_handle: amdsmi_wrapper.amdsmi_processor_handle, clk_type: AmdSmiClkType + processor_handle: amdsmi_wrapper.amdsmi_processor_handle, clk_type: AmdSmiClkType ) -> Dict[str, Any]: - if not isinstance(device_handle, amdsmi_wrapper.amdsmi_processor_handle): + if not isinstance(processor_handle, amdsmi_wrapper.amdsmi_processor_handle): raise AmdSmiParameterException( - device_handle, amdsmi_wrapper.amdsmi_processor_handle + processor_handle, amdsmi_wrapper.amdsmi_processor_handle ) if not isinstance(clk_type, AmdSmiClkType): raise AmdSmiParameterException(clk_type, AmdSmiClkType) @@ -2298,7 +2298,7 @@ def amdsmi_dev_get_gpu_clk_freq( freq = amdsmi_wrapper.amdsmi_frequencies_t() _check_res( amdsmi_wrapper. amdsmi_dev_get_gpu_clk_freq( - device_handle, clk_type, ctypes.byref(freq) + processor_handle, clk_type, ctypes.byref(freq) ) ) @@ -2310,17 +2310,17 @@ def amdsmi_dev_get_gpu_clk_freq( def amdsmi_dev_get_od_volt_info( - device_handle: amdsmi_wrapper.amdsmi_processor_handle, + processor_handle: amdsmi_wrapper.amdsmi_processor_handle, ) -> Dict[str, Any]: - if not isinstance(device_handle, amdsmi_wrapper.amdsmi_processor_handle): + if not isinstance(processor_handle, amdsmi_wrapper.amdsmi_processor_handle): raise AmdSmiParameterException( - device_handle, amdsmi_wrapper.amdsmi_processor_handle + processor_handle, amdsmi_wrapper.amdsmi_processor_handle ) freq_data = amdsmi_wrapper.amdsmi_od_volt_freq_data_t() _check_res( amdsmi_wrapper. amdsmi_dev_get_od_volt_info( - device_handle, ctypes.byref(freq_data) + processor_handle, ctypes.byref(freq_data) ) ) @@ -2347,17 +2347,17 @@ def amdsmi_dev_get_od_volt_info( def amdsmi_dev_get_gpu_metrics_info( - device_handle: amdsmi_wrapper.amdsmi_processor_handle, + processor_handle: amdsmi_wrapper.amdsmi_processor_handle, ) -> Dict[str, Any]: - if not isinstance(device_handle, amdsmi_wrapper.amdsmi_processor_handle): + if not isinstance(processor_handle, amdsmi_wrapper.amdsmi_processor_handle): raise AmdSmiParameterException( - device_handle, amdsmi_wrapper.amdsmi_processor_handle + processor_handle, amdsmi_wrapper.amdsmi_processor_handle ) gpu_metrics = amdsmi_wrapper.amdsmi_gpu_metrics_t() _check_res( amdsmi_wrapper. amdsmi_dev_get_gpu_metrics_info( - device_handle, ctypes.byref(gpu_metrics) + processor_handle, ctypes.byref(gpu_metrics) ) ) @@ -2400,11 +2400,11 @@ def amdsmi_dev_get_gpu_metrics_info( def amdsmi_dev_get_od_volt_curve_regions( - device_handle: amdsmi_wrapper.amdsmi_processor_handle, num_regions: int + processor_handle: amdsmi_wrapper.amdsmi_processor_handle, num_regions: int ) -> List[Dict[str, Any]]: - if not isinstance(device_handle, amdsmi_wrapper.amdsmi_processor_handle): + if not isinstance(processor_handle, amdsmi_wrapper.amdsmi_processor_handle): raise AmdSmiParameterException( - device_handle, amdsmi_wrapper.amdsmi_processor_handle + processor_handle, amdsmi_wrapper.amdsmi_processor_handle ) if not isinstance(num_regions, int): raise AmdSmiParameterException(num_regions, int) @@ -2413,7 +2413,7 @@ def amdsmi_dev_get_od_volt_curve_regions( buffer = (amdsmi_wrapper.amdsmi_freq_volt_region_t * num_regions)() _check_res( amdsmi_wrapper. amdsmi_dev_get_od_volt_curve_regions( - device_handle, ctypes.byref(region_count), buffer + processor_handle, ctypes.byref(region_count), buffer ) ) @@ -2439,11 +2439,11 @@ def amdsmi_dev_get_od_volt_curve_regions( def amdsmi_dev_get_power_profile_presets( - device_handle: amdsmi_wrapper.amdsmi_processor_handle, sensor_idx: int + processor_handle: amdsmi_wrapper.amdsmi_processor_handle, sensor_idx: int ) -> Dict[str, Any]: - if not isinstance(device_handle, amdsmi_wrapper.amdsmi_processor_handle): + if not isinstance(processor_handle, amdsmi_wrapper.amdsmi_processor_handle): raise AmdSmiParameterException( - device_handle, amdsmi_wrapper.amdsmi_processor_handle + processor_handle, amdsmi_wrapper.amdsmi_processor_handle ) if not isinstance(sensor_idx, int): raise AmdSmiParameterException(sensor_idx, int) @@ -2451,7 +2451,7 @@ def amdsmi_dev_get_power_profile_presets( status = amdsmi_wrapper.amdsmi_power_profile_status_t() _check_res( amdsmi_wrapper. amdsmi_dev_get_power_profile_presets( - device_handle, sensor_idx, ctypes.byref(status) + processor_handle, sensor_idx, ctypes.byref(status) ) ) @@ -2463,11 +2463,11 @@ def amdsmi_dev_get_power_profile_presets( def amdsmi_dev_get_ecc_count( - device_handle: amdsmi_wrapper.amdsmi_processor_handle, block: AmdSmiGpuBlock + processor_handle: amdsmi_wrapper.amdsmi_processor_handle, block: AmdSmiGpuBlock ) -> Dict[str, int]: - if not isinstance(device_handle, amdsmi_wrapper.amdsmi_processor_handle): + if not isinstance(processor_handle, amdsmi_wrapper.amdsmi_processor_handle): raise AmdSmiParameterException( - device_handle, amdsmi_wrapper.amdsmi_processor_handle + processor_handle, amdsmi_wrapper.amdsmi_processor_handle ) if not isinstance(block, AmdSmiGpuBlock): @@ -2475,8 +2475,8 @@ def amdsmi_dev_get_ecc_count( ec = amdsmi_wrapper.amdsmi_error_count_t() _check_res( - amdsmi_wrapper.amdsmi_dev_get_ecc_count( - device_handle, block, ctypes.byref(ec)) + amdsmi_wrapper. amdsmi_dev_get_ecc_count( + processor_handle, block, ctypes.byref(ec)) ) return { @@ -2486,28 +2486,28 @@ def amdsmi_dev_get_ecc_count( def amdsmi_dev_get_ecc_enabled( - device_handle: amdsmi_wrapper.amdsmi_processor_handle, + processor_handle: amdsmi_wrapper.amdsmi_processor_handle, ) -> int: - if not isinstance(device_handle, amdsmi_wrapper.amdsmi_processor_handle): + if not isinstance(processor_handle, amdsmi_wrapper.amdsmi_processor_handle): raise AmdSmiParameterException( - device_handle, amdsmi_wrapper.amdsmi_processor_handle + processor_handle, amdsmi_wrapper.amdsmi_processor_handle ) blocks = ctypes.c_uint64(0) _check_res( amdsmi_wrapper. amdsmi_dev_get_ecc_enabled( - device_handle, ctypes.byref(blocks)) + processor_handle, ctypes.byref(blocks)) ) return blocks.value def amdsmi_dev_get_ecc_status( - device_handle: amdsmi_wrapper.amdsmi_processor_handle, block: AmdSmiGpuBlock + processor_handle: amdsmi_wrapper.amdsmi_processor_handle, block: AmdSmiGpuBlock ) -> AmdSmiRasErrState: - if not isinstance(device_handle, amdsmi_wrapper.amdsmi_processor_handle): + if not isinstance(processor_handle, amdsmi_wrapper.amdsmi_processor_handle): raise AmdSmiParameterException( - device_handle, amdsmi_wrapper.amdsmi_processor_handle + processor_handle, amdsmi_wrapper.amdsmi_processor_handle ) if not isinstance(block, AmdSmiGpuBlock): @@ -2516,7 +2516,7 @@ def amdsmi_dev_get_ecc_status( state = amdsmi_wrapper.amdsmi_ras_err_state_t() _check_res( amdsmi_wrapper. amdsmi_dev_get_ecc_status( - device_handle, block, ctypes.byref(state) + processor_handle, block, ctypes.byref(state) ) ) @@ -2604,39 +2604,39 @@ def amdsmi_get_compute_process_gpus(pid: int) -> List[int]: def amdsmi_dev_xgmi_error_status( - device_handle: amdsmi_wrapper.amdsmi_processor_handle, + processor_handle: amdsmi_wrapper.amdsmi_processor_handle, ) -> AmdSmiXgmiStatus: - if not isinstance(device_handle, amdsmi_wrapper.amdsmi_processor_handle): + if not isinstance(processor_handle, amdsmi_wrapper.amdsmi_processor_handle): raise AmdSmiParameterException( - device_handle, amdsmi_wrapper.amdsmi_processor_handle + processor_handle, amdsmi_wrapper.amdsmi_processor_handle ) status = amdsmi_wrapper.amdsmi_xgmi_status_t() _check_res( amdsmi_wrapper.amdsmi_dev_xgmi_error_status( - device_handle, ctypes.byref(status)) + processor_handle, ctypes.byref(status)) ) return AmdSmiXgmiStatus(status.value) def amdsmi_dev_reset_xgmi_error( - device_handle: amdsmi_wrapper.amdsmi_processor_handle, + processor_handle: amdsmi_wrapper.amdsmi_processor_handle, ) -> None: - if not isinstance(device_handle, amdsmi_wrapper.amdsmi_processor_handle): + if not isinstance(processor_handle, amdsmi_wrapper.amdsmi_processor_handle): raise AmdSmiParameterException( - device_handle, amdsmi_wrapper.amdsmi_processor_handle + processor_handle, amdsmi_wrapper.amdsmi_processor_handle ) - _check_res(amdsmi_wrapper.amdsmi_dev_reset_xgmi_error(device_handle)) + _check_res(amdsmi_wrapper.amdsmi_dev_reset_xgmi_error(processor_handle)) def amdsmi_dev_get_memory_reserved_pages( - device_handle: amdsmi_wrapper.amdsmi_processor_handle, + processor_handle: amdsmi_wrapper.amdsmi_processor_handle, ) -> Union[list, str]: - if not isinstance(device_handle, amdsmi_wrapper.amdsmi_processor_handle): + if not isinstance(processor_handle, amdsmi_wrapper.amdsmi_processor_handle): raise AmdSmiParameterException( - device_handle, amdsmi_wrapper.amdsmi_processor_handle + processor_handle, amdsmi_wrapper.amdsmi_processor_handle ) num_pages = ctypes.c_uint32() @@ -2644,7 +2644,7 @@ def amdsmi_dev_get_memory_reserved_pages( amdsmi_wrapper.amdsmi_retired_page_record_t)() _check_res( amdsmi_wrapper.amdsmi_dev_get_memory_reserved_pages( - device_handle, ctypes.byref(num_pages), retired_page_record + processor_handle, ctypes.byref(num_pages), retired_page_record ) ) diff --git a/py-interface/amdsmi_wrapper.py b/py-interface/amdsmi_wrapper.py index 105c190480..d2c07d3ec4 100644 --- a/py-interface/amdsmi_wrapper.py +++ b/py-interface/amdsmi_wrapper.py @@ -899,7 +899,7 @@ class struct_c__SA_amdsmi_evt_notification_data_t(Structure): struct_c__SA_amdsmi_evt_notification_data_t._pack_ = 1 # source:False struct_c__SA_amdsmi_evt_notification_data_t._fields_ = [ - ('device_handle', ctypes.POINTER(None)), + ('processor_handle', ctypes.POINTER(None)), ('event', amdsmi_evt_notification_type_t), ('message', ctypes.c_char * 64), ('PADDING_0', ctypes.c_ubyte * 4), @@ -1411,15 +1411,15 @@ size_t = ctypes.c_uint64 amdsmi_get_socket_info = _libraries['libamd_smi.so'].amdsmi_get_socket_info amdsmi_get_socket_info.restype = amdsmi_status_t amdsmi_get_socket_info.argtypes = [amdsmi_socket_handle, ctypes.POINTER(ctypes.c_char), size_t] -amdsmi_get_device_handles = _libraries['libamd_smi.so'].amdsmi_get_device_handles -amdsmi_get_device_handles.restype = amdsmi_status_t -amdsmi_get_device_handles.argtypes = [amdsmi_socket_handle, ctypes.POINTER(ctypes.c_uint32), ctypes.POINTER(ctypes.POINTER(None))] +amdsmi_get_processor_handles = _libraries['libamd_smi.so'].amdsmi_get_processor_handles +amdsmi_get_processor_handles.restype = amdsmi_status_t +amdsmi_get_processor_handles.argtypes = [amdsmi_socket_handle, ctypes.POINTER(ctypes.c_uint32), ctypes.POINTER(ctypes.POINTER(None))] amdsmi_get_device_type = _libraries['libamd_smi.so'].amdsmi_get_device_type amdsmi_get_device_type.restype = amdsmi_status_t amdsmi_get_device_type.argtypes = [amdsmi_processor_handle, ctypes.POINTER(c__EA_device_type_t)] -amdsmi_get_device_handle_from_bdf = _libraries['libamd_smi.so'].amdsmi_get_device_handle_from_bdf -amdsmi_get_device_handle_from_bdf.restype = amdsmi_status_t -amdsmi_get_device_handle_from_bdf.argtypes = [amdsmi_bdf_t, ctypes.POINTER(ctypes.POINTER(None))] +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.argtypes = [amdsmi_bdf_t, ctypes.POINTER(ctypes.POINTER(None))] amdsmi_dev_get_id = _libraries['libamd_smi.so'].amdsmi_dev_get_id amdsmi_dev_get_id.restype = amdsmi_status_t amdsmi_dev_get_id.argtypes = [amdsmi_processor_handle, ctypes.POINTER(ctypes.c_uint16)] @@ -1899,7 +1899,7 @@ __all__ = \ 'amdsmi_get_compute_process_gpus', 'amdsmi_get_compute_process_info', 'amdsmi_get_compute_process_info_by_pid', 'amdsmi_get_device_bdf', - 'amdsmi_get_device_handle_from_bdf', 'amdsmi_get_device_handles', + 'amdsmi_get_processor_handle_from_bdf', 'amdsmi_get_processor_handles', 'amdsmi_get_device_type', 'amdsmi_get_device_uuid', 'amdsmi_get_driver_version', 'amdsmi_get_ecc_error_count', 'amdsmi_get_event_notification', 'amdsmi_get_func_iter_value', diff --git a/py-interface/rocm_smi_tool.py b/py-interface/rocm_smi_tool.py index 93c973f3fd..bcf5c8ce55 100644 --- a/py-interface/rocm_smi_tool.py +++ b/py-interface/rocm_smi_tool.py @@ -100,16 +100,16 @@ class CmdLineParser: return True return False - def _get_device_handle_from_id(self, gpu_id, vf_id=None): - devices = smi_api.amdsmi_get_device_handles() + def _get_processor_handle_from_id(self, gpu_id, vf_id=None): + devices = smi_api.amdsmi_get_processor_handles() self._check_range("gpu id", gpu_id, 0, len(devices) - 1) - device_handle = devices[gpu_id] + processor_handle = devices[gpu_id] if vf_id is not None: - partitions = smi_api.amdsmi_get_vf_partition_info(device_handle) + partitions = smi_api.amdsmi_get_vf_partition_info(processor_handle) self._check_range("vf id", vf_id, 0, len(partitions) - 1) - device_handle = smi_api.amdsmi_get_vf_handle_from_vf_index(device_handle, vf_id) - return device_handle + processor_handle = smi_api.amdsmi_get_vf_handle_from_vf_index(processor_handle, vf_id) + return processor_handle def _parse_vf_id_if_exists(self): gpu_id = None @@ -156,32 +156,32 @@ class CmdLineParser: return self.command_entry[0] - def get_device_handle(self): - device_handles = [] + def get_processor_handle(self): + processor_handles = [] - def parse_device_handle(position): - self._check_if_arg_exists("Device identifier", "device bdf or device id", position) + def parse_processor_handle(possition): + self._check_if_arg_exists("Device identifier", "device bdf or device id", possition) ids = self._parse_vf_id_if_exists() if ids["gpu_id"] is not None and ids["vf_id"] is not None: - device_handle = self._get_device_handle_from_id(ids["gpu_id"], ids["vf_id"]) + processor_handle = self._get_processor_handle_from_id(ids["gpu_id"], ids["vf_id"]) else: gpu_arg = self.cmd_args[position] if gpu_arg.isdigit(): - device_handle = self._get_device_handle_from_id(int(gpu_arg)) + processor_handle = self._get_processor_handle_from_id(int(gpu_arg)) else: self._check_bdf(gpu_arg) - device_handle = smi_api.amdsmi_get_device_handle_from_bdf(gpu_arg) - device_handles.append(device_handle) + processor_handle = smi_api.amdsmi_get_processor_handle_from_bdf(gpu_arg) + processor_handles.append(processor_handle) for i in range(len(self.command_entry)): if f"device_identifier{i + 1}" in self.command_entry[1]: - parse_device_handle(i + 2) + parse_processor_handle(i + 2) - if len(device_handles) == 0: + if len(processor_handles) == 0: return None - return device_handles + return processor_handles def get_command_args(self): offset = 2 + self.extra_args @@ -336,7 +336,7 @@ class Formatter: | """ + self.style.text("47 Get topo get link type. Api: amdsmi_topo_get_link_type ") + """ | | """ + self.style.text("48 Get is P2P accessible. Api: amdsmi_is_P2P_accessible ") + """ | | """ + self.style.text("49 Get asic info. Api: amdsmi_get_asic_info ") + """ | - | """ + self.style.text("50 Get device_handles. Api: amdsmi_get_device_handles ") + """ | + | """ + self.style.text("50 Get processor_handles. Api: amdsmi_get_processor_handles ") + """ | | """ + self.style.text("51 Get event notification. Api: amdsmi_get_event_notification ") + """ | | """ + self.style.text("52 Init event notification. Api: amdsmi_init_event_notification ") + """ | | """ + self.style.text("53 Set event notification mask. Api: amdsmi_set_event_notification_mask ") + """ | @@ -874,7 +874,7 @@ commands = { 49: [smi_api.amdsmi_get_asic_info, { "device_identifier1": [None, True] }], - 50: [smi_api.amdsmi_get_device_handles, {}], + 50: [smi_api.amdsmi_get_processor_handles, {}], 51: [amdsmi_tool_event_notification_get, { "device_identifier1": [None, True] }], @@ -994,22 +994,22 @@ if __name__ == "__main__": smi_api.amdsmi_init() command = parser.get_command_handle() - device_handles = parser.get_device_handle() + processor_handles = parser.get_processor_handle() command_args = parser.get_command_args() result = None - if not device_handles and not command_args: + if not processor_handles and not command_args: result = command() - elif not device_handles and command_args: + elif not processor_handles and command_args: result = command(command_args) - elif len(device_handles) == 1 and not command_args: - result = command(device_handles[0]) - elif len(device_handles) > 1 and not command_args: - result = command(device_handles) - elif len(device_handles) == 1 and command_args: - result = command(device_handles[0], command_args) + elif len(processor_handles) == 1 and not command_args: + result = command(processor_handles[0]) + elif len(processor_handles) > 1 and not command_args: + result = command(processor_handles) + elif len(processor_handles) == 1 and command_args: + result = command(processor_handles[0], command_args) else: - result = command(device_handles, command_args) + result = command(processor_handles, command_args) formatter.print_output(result) diff --git a/src/amd_smi/amd_smi.cc b/src/amd_smi/amd_smi.cc index ec9109c26e..1ce630123a 100644 --- a/src/amd_smi/amd_smi.cc +++ b/src/amd_smi/amd_smi.cc @@ -76,21 +76,21 @@ static bool initialized_lib = false; } \ } while (0) -static amdsmi_status_t get_gpu_device_from_handle(amdsmi_processor_handle device_handle, +static amdsmi_status_t get_gpu_device_from_handle(amdsmi_processor_handle processor_handle, amd::smi::AMDSmiGPUDevice** gpudevice) { AMDSMI_CHECK_INIT(); - if (device_handle == nullptr || gpudevice == nullptr) + if (processor_handle == nullptr || gpudevice == nullptr) return AMDSMI_STATUS_INVAL; amd::smi::AMDSmiProcessor* device = nullptr; amdsmi_status_t r = amd::smi::AMDSmiSystem::getInstance() - .handle_to_device(device_handle, &device); + .handle_to_device(processor_handle, &device); if (r != AMDSMI_STATUS_SUCCESS) return r; if (device->get_device_type() == AMD_GPU) { - *gpudevice = static_cast(device_handle); + *gpudevice = static_cast(processor_handle); return AMDSMI_STATUS_SUCCESS; } @@ -99,12 +99,12 @@ static amdsmi_status_t get_gpu_device_from_handle(amdsmi_processor_handle device template amdsmi_status_t rsmi_wrapper(F && f, - amdsmi_processor_handle device_handle, Args &&... args) { + amdsmi_processor_handle processor_handle, Args &&... args) { AMDSMI_CHECK_INIT(); amd::smi::AMDSmiGPUDevice* gpu_device = nullptr; - amdsmi_status_t r = get_gpu_device_from_handle(device_handle, &gpu_device); + amdsmi_status_t r = get_gpu_device_from_handle(processor_handle, &gpu_device); if (r != AMDSMI_STATUS_SUCCESS) return r; @@ -214,9 +214,9 @@ amdsmi_status_t amdsmi_get_socket_info( return AMDSMI_STATUS_SUCCESS; } -amdsmi_status_t amdsmi_get_device_handles(amdsmi_socket_handle socket_handle, +amdsmi_status_t amdsmi_get_processor_handles(amdsmi_socket_handle socket_handle, uint32_t* device_count, - amdsmi_processor_handle* device_handles) { + amdsmi_processor_handle* processor_handles) { AMDSMI_CHECK_INIT(); if (device_count == nullptr) { @@ -233,23 +233,23 @@ amdsmi_status_t amdsmi_get_device_handles(amdsmi_socket_handle socket_handle, std::vector& devices = socket->get_devices(); uint32_t device_size = static_cast(devices.size()); // Get the device count only - if (device_handles == nullptr) { + if (processor_handles == nullptr) { *device_count = device_size; return AMDSMI_STATUS_SUCCESS; } - // If the device_handles can hold all devices, return all of them. + // If the processor_handles can hold all devices, return all of them. *device_count = *device_count >= device_size ? device_size : *device_count; // Copy the device handles for (uint32_t i = 0; i < *device_count; i++) { - device_handles[i] = reinterpret_cast(devices[i]); + processor_handles[i] = reinterpret_cast(devices[i]); } return AMDSMI_STATUS_SUCCESS; } -amdsmi_status_t amdsmi_get_device_type(amdsmi_processor_handle device_handle , +amdsmi_status_t amdsmi_get_device_type(amdsmi_processor_handle processor_handle , device_type_t* device_type) { AMDSMI_CHECK_INIT(); @@ -259,7 +259,7 @@ amdsmi_status_t amdsmi_get_device_type(amdsmi_processor_handle device_handle , } amd::smi::AMDSmiProcessor* device = nullptr; amdsmi_status_t r = amd::smi::AMDSmiSystem::getInstance() - .handle_to_device(device_handle, &device); + .handle_to_device(processor_handle, &device); if (r != AMDSMI_STATUS_SUCCESS) return r; *device_type = device->get_device_type(); @@ -267,7 +267,7 @@ amdsmi_status_t amdsmi_get_device_type(amdsmi_processor_handle device_handle , } amdsmi_status_t -amdsmi_get_device_bdf(amdsmi_processor_handle device_handle, amdsmi_bdf_t *bdf) { +amdsmi_get_device_bdf(amdsmi_processor_handle processor_handle, amdsmi_bdf_t *bdf) { AMDSMI_CHECK_INIT(); @@ -276,7 +276,7 @@ amdsmi_get_device_bdf(amdsmi_processor_handle device_handle, amdsmi_bdf_t *bdf) } amd::smi::AMDSmiGPUDevice* gpu_device = nullptr; - amdsmi_status_t r = get_gpu_device_from_handle(device_handle, &gpu_device); + amdsmi_status_t r = get_gpu_device_from_handle(processor_handle, &gpu_device); if (r != AMDSMI_STATUS_SUCCESS) return r; @@ -286,7 +286,7 @@ amdsmi_get_device_bdf(amdsmi_processor_handle device_handle, amdsmi_bdf_t *bdf) return AMDSMI_STATUS_SUCCESS; } -amdsmi_status_t amdsmi_get_board_info(amdsmi_processor_handle device_handle, amdsmi_board_info_t *board_info) { +amdsmi_status_t amdsmi_get_board_info(amdsmi_processor_handle processor_handle, amdsmi_board_info_t *board_info) { AMDSMI_CHECK_INIT(); @@ -296,7 +296,7 @@ amdsmi_status_t amdsmi_get_board_info(amdsmi_processor_handle device_handle, amd amdsmi_status_t status; amd::smi::AMDSmiGPUDevice* gpu_device = nullptr; - amdsmi_status_t r = get_gpu_device_from_handle(device_handle, &gpu_device); + amdsmi_status_t r = get_gpu_device_from_handle(processor_handle, &gpu_device); if (r != AMDSMI_STATUS_SUCCESS) return r; @@ -307,11 +307,11 @@ amdsmi_status_t amdsmi_get_board_info(amdsmi_processor_handle device_handle, amd else { // ignore the errors so that it can populate as many fields as possible. // call rocm-smi which search multiple places for device name - status = rsmi_wrapper(rsmi_dev_name_get, device_handle, + status = rsmi_wrapper(rsmi_dev_name_get, processor_handle, board_info->product_name, AMDSMI_PRODUCT_NAME_LENGTH); if (board_info->product_serial[0] == '\0') { - status = rsmi_wrapper(rsmi_dev_serial_number_get, device_handle, + status = rsmi_wrapper(rsmi_dev_serial_number_get, processor_handle, board_info->product_serial, AMDSMI_NORMAL_STRING_LENGTH); } } @@ -319,7 +319,7 @@ amdsmi_status_t amdsmi_get_board_info(amdsmi_processor_handle device_handle, amd return AMDSMI_STATUS_SUCCESS; } -amdsmi_status_t amdsmi_dev_get_temp_metric(amdsmi_processor_handle device_handle, +amdsmi_status_t amdsmi_dev_get_temp_metric(amdsmi_processor_handle processor_handle, amdsmi_temperature_type_t sensor_type, amdsmi_temperature_metric_t metric, int64_t *temperature) { @@ -333,20 +333,20 @@ amdsmi_status_t amdsmi_dev_get_temp_metric(amdsmi_processor_handle device_handl if (sensor_type == TEMPERATURE_TYPE_PLX) { amdsmi_gpu_metrics_t metric_info; auto r_status = amdsmi_dev_get_gpu_metrics_info( - device_handle, &metric_info); + processor_handle, &metric_info); if (r_status != AMDSMI_STATUS_SUCCESS) return r_status; *temperature = metric_info.temperature_vrsoc; return r_status; } - amdsmi_status_t amdsmi_status = rsmi_wrapper(rsmi_dev_temp_metric_get, device_handle, + amdsmi_status_t amdsmi_status = rsmi_wrapper(rsmi_dev_temp_metric_get, processor_handle, static_cast(sensor_type), static_cast(metric), temperature); *temperature /= 1000; return amdsmi_status; } -amdsmi_status_t amdsmi_get_vram_usage(amdsmi_processor_handle device_handle, +amdsmi_status_t amdsmi_get_vram_usage(amdsmi_processor_handle processor_handle, amdsmi_vram_info_t *vram_info) { AMDSMI_CHECK_INIT(); @@ -357,7 +357,7 @@ amdsmi_status_t amdsmi_get_vram_usage(amdsmi_processor_handle device_handle, amd::smi::AMDSmiProcessor* device = nullptr; amdsmi_status_t ret = amd::smi::AMDSmiSystem::getInstance() - .handle_to_device(device_handle, &device); + .handle_to_device(processor_handle, &device); if (ret != AMDSMI_STATUS_SUCCESS) return ret; if (device->get_device_type() != AMD_GPU) { @@ -365,7 +365,7 @@ amdsmi_status_t amdsmi_get_vram_usage(amdsmi_processor_handle device_handle, } amd::smi::AMDSmiGPUDevice* gpu_device = nullptr; - amdsmi_status_t r = get_gpu_device_from_handle(device_handle, &gpu_device); + amdsmi_status_t r = get_gpu_device_from_handle(processor_handle, &gpu_device); if (r != AMDSMI_STATUS_SUCCESS) return r; @@ -388,7 +388,7 @@ amdsmi_status_t amdsmi_get_vram_usage(amdsmi_processor_handle device_handle, return AMDSMI_STATUS_SUCCESS; } -amdsmi_status_t amdsmi_get_caps_info(amdsmi_processor_handle device_handle, +amdsmi_status_t amdsmi_get_caps_info(amdsmi_processor_handle processor_handle, amdsmi_gpu_caps_t *info) { AMDSMI_CHECK_INIT(); @@ -399,14 +399,14 @@ amdsmi_status_t amdsmi_get_caps_info(amdsmi_processor_handle device_handle, amd::smi::AMDSmiProcessor* amd_device = nullptr; amdsmi_status_t ret = amd::smi::AMDSmiSystem::getInstance() - .handle_to_device(device_handle, &amd_device); + .handle_to_device(processor_handle, &amd_device); if (ret != AMDSMI_STATUS_SUCCESS) return ret; if (amd_device->get_device_type() != AMD_GPU) { return AMDSMI_STATUS_NOT_SUPPORTED; } amd::smi::AMDSmiGPUDevice* gpu_device = nullptr; - amdsmi_status_t r = get_gpu_device_from_handle(device_handle, &gpu_device); + amdsmi_status_t r = get_gpu_device_from_handle(processor_handle, &gpu_device); if (r != AMDSMI_STATUS_SUCCESS) return r; @@ -478,42 +478,42 @@ amdsmi_status_t amdsmi_get_caps_info(amdsmi_processor_handle device_handle, return AMDSMI_STATUS_SUCCESS; } -amdsmi_status_t amdsmi_dev_get_fan_rpms(amdsmi_processor_handle device_handle, +amdsmi_status_t amdsmi_dev_get_fan_rpms(amdsmi_processor_handle processor_handle, uint32_t sensor_ind, int64_t *speed) { - return rsmi_wrapper(rsmi_dev_fan_rpms_get, device_handle, sensor_ind, + return rsmi_wrapper(rsmi_dev_fan_rpms_get, processor_handle, sensor_ind, speed); } -amdsmi_status_t amdsmi_dev_get_fan_speed(amdsmi_processor_handle device_handle, +amdsmi_status_t amdsmi_dev_get_fan_speed(amdsmi_processor_handle processor_handle, uint32_t sensor_ind, int64_t *speed) { - return rsmi_wrapper(rsmi_dev_fan_speed_get, device_handle, + return rsmi_wrapper(rsmi_dev_fan_speed_get, processor_handle, sensor_ind, speed); } -amdsmi_status_t amdsmi_dev_get_fan_speed_max(amdsmi_processor_handle device_handle, +amdsmi_status_t amdsmi_dev_get_fan_speed_max(amdsmi_processor_handle processor_handle, uint32_t sensor_ind, uint64_t *max_speed) { - return rsmi_wrapper(rsmi_dev_fan_speed_max_get, device_handle, + return rsmi_wrapper(rsmi_dev_fan_speed_max_get, processor_handle, sensor_ind, max_speed); } -amdsmi_status_t amdsmi_dev_reset_fan(amdsmi_processor_handle device_handle, +amdsmi_status_t amdsmi_dev_reset_fan(amdsmi_processor_handle processor_handle, uint32_t sensor_ind) { - return rsmi_wrapper(rsmi_dev_fan_reset, device_handle, sensor_ind); + return rsmi_wrapper(rsmi_dev_fan_reset, processor_handle, sensor_ind); } -amdsmi_status_t amdsmi_dev_set_fan_speed(amdsmi_processor_handle device_handle, +amdsmi_status_t amdsmi_dev_set_fan_speed(amdsmi_processor_handle processor_handle, uint32_t sensor_ind, uint64_t speed) { - return rsmi_wrapper(rsmi_dev_fan_speed_set, device_handle, + return rsmi_wrapper(rsmi_dev_fan_speed_set, processor_handle, sensor_ind, speed); } -amdsmi_status_t amdsmi_dev_get_id(amdsmi_processor_handle device_handle, +amdsmi_status_t amdsmi_dev_get_id(amdsmi_processor_handle processor_handle, uint16_t *id) { - return rsmi_wrapper(rsmi_dev_id_get, device_handle, id); + return rsmi_wrapper(rsmi_dev_id_get, processor_handle, id); } // TODO(bliu) : add fw info from libdrm -amdsmi_status_t amdsmi_get_fw_info(amdsmi_processor_handle device_handle, +amdsmi_status_t amdsmi_get_fw_info(amdsmi_processor_handle processor_handle, amdsmi_fw_info_t *info) { const std::map fw_in_rsmi = { { FW_ID_ASD, RSMI_FW_BLOCK_ASD}, @@ -547,7 +547,7 @@ amdsmi_status_t amdsmi_get_fw_info(amdsmi_processor_handle device_handle, // collect all rsmi supported fw block for (auto ite = fw_in_rsmi.begin(); ite != fw_in_rsmi.end(); ite ++) { - auto status = rsmi_wrapper(rsmi_dev_firmware_version_get, device_handle, + auto status = rsmi_wrapper(rsmi_dev_firmware_version_get, processor_handle, (*ite).second, &(info->fw_info_list[info->num_fw_info].fw_version)); if (status == AMDSMI_STATUS_SUCCESS) { @@ -559,7 +559,7 @@ amdsmi_status_t amdsmi_get_fw_info(amdsmi_processor_handle device_handle, } amdsmi_status_t -amdsmi_get_asic_info(amdsmi_processor_handle device_handle, amdsmi_asic_info_t *info) { +amdsmi_get_asic_info(amdsmi_processor_handle processor_handle, amdsmi_asic_info_t *info) { AMDSMI_CHECK_INIT(); @@ -572,7 +572,7 @@ amdsmi_get_asic_info(amdsmi_processor_handle device_handle, amdsmi_asic_info_t * uint16_t subvendor_id = 0; amd::smi::AMDSmiGPUDevice* gpu_device = nullptr; - amdsmi_status_t r = get_gpu_device_from_handle(device_handle, &gpu_device); + amdsmi_status_t r = get_gpu_device_from_handle(processor_handle, &gpu_device); if (r != AMDSMI_STATUS_SUCCESS) return r; @@ -592,7 +592,7 @@ amdsmi_get_asic_info(amdsmi_processor_handle device_handle, amdsmi_asic_info_t * status = smi_amdgpu_get_market_name_from_dev_id(dev_info.device_id, info->market_name); if (status != AMDSMI_STATUS_SUCCESS) { - rsmi_wrapper(rsmi_dev_brand_get, device_handle, + rsmi_wrapper(rsmi_dev_brand_get, processor_handle, info->market_name, AMDSMI_NORMAL_STRING_LENGTH); } @@ -603,17 +603,17 @@ amdsmi_get_asic_info(amdsmi_processor_handle device_handle, amdsmi_asic_info_t * } // For other sysfs related information, get from rocm-smi else { - status = rsmi_wrapper(rsmi_dev_serial_number_get, device_handle, + status = rsmi_wrapper(rsmi_dev_serial_number_get, processor_handle, info->asic_serial, AMDSMI_NORMAL_STRING_LENGTH); - status = rsmi_wrapper(rsmi_dev_brand_get, device_handle, + status = rsmi_wrapper(rsmi_dev_brand_get, processor_handle, info->market_name, AMDSMI_NORMAL_STRING_LENGTH); - status = rsmi_wrapper(rsmi_dev_vendor_id_get, device_handle, + status = rsmi_wrapper(rsmi_dev_vendor_id_get, processor_handle, &vendor_id); if (status == AMDSMI_STATUS_SUCCESS) info->vendor_id = vendor_id; - status = rsmi_wrapper(rsmi_dev_subsystem_vendor_id_get, device_handle, + status = rsmi_wrapper(rsmi_dev_subsystem_vendor_id_get, processor_handle, &subvendor_id); if (status == AMDSMI_STATUS_SUCCESS) info->subvendor_id = subvendor_id; } @@ -622,36 +622,36 @@ amdsmi_get_asic_info(amdsmi_processor_handle device_handle, amdsmi_asic_info_t * } -amdsmi_status_t amdsmi_dev_get_subsystem_id(amdsmi_processor_handle device_handle, +amdsmi_status_t amdsmi_dev_get_subsystem_id(amdsmi_processor_handle processor_handle, uint16_t *id) { - return rsmi_wrapper(rsmi_dev_subsystem_id_get, device_handle, id); + return rsmi_wrapper(rsmi_dev_subsystem_id_get, processor_handle, id); } amdsmi_status_t amdsmi_dev_get_subsystem_name( - amdsmi_processor_handle device_handle, + amdsmi_processor_handle processor_handle, char *name, size_t len) { - return rsmi_wrapper(rsmi_dev_subsystem_name_get, device_handle, name, len); + return rsmi_wrapper(rsmi_dev_subsystem_name_get, processor_handle, name, len); } amdsmi_status_t amdsmi_dev_get_vendor_name( - amdsmi_processor_handle device_handle, char *name, size_t len) { - return rsmi_wrapper(rsmi_dev_vendor_name_get, device_handle, name, len); + amdsmi_processor_handle processor_handle, char *name, size_t len) { + return rsmi_wrapper(rsmi_dev_vendor_name_get, processor_handle, name, len); } -amdsmi_status_t amdsmi_dev_get_vram_vendor(amdsmi_processor_handle device_handle, +amdsmi_status_t amdsmi_dev_get_vram_vendor(amdsmi_processor_handle processor_handle, char *brand, uint32_t len) { - return rsmi_wrapper(rsmi_dev_vram_vendor_get, device_handle, brand, len); + return rsmi_wrapper(rsmi_dev_vram_vendor_get, processor_handle, brand, len); } amdsmi_status_t -amdsmi_init_event_notification(amdsmi_processor_handle device_handle) { - return rsmi_wrapper(rsmi_event_notification_init, device_handle); +amdsmi_init_event_notification(amdsmi_processor_handle processor_handle) { + return rsmi_wrapper(rsmi_event_notification_init, processor_handle); } amdsmi_status_t - amdsmi_set_event_notification_mask(amdsmi_processor_handle device_handle, + amdsmi_set_event_notification_mask(amdsmi_processor_handle processor_handle, uint64_t mask) { - return rsmi_wrapper(rsmi_event_notification_mask_set, device_handle, mask); + return rsmi_wrapper(rsmi_event_notification_mask_set, processor_handle, mask); } amdsmi_status_t @@ -678,7 +678,7 @@ amdsmi_status_t strncpy(data[i].message, rsmi_data.message, MAX_EVENT_NOTIFICATION_MSG_SIZE); amdsmi_status_t r = amd::smi::AMDSmiSystem::getInstance() - .gpu_index_to_handle(rsmi_data.dv_ind, &(data[i].device_handle)); + .gpu_index_to_handle(rsmi_data.dv_ind, &(data[i].processor_handle)); if (r != AMDSMI_STATUS_SUCCESS) return r; } @@ -686,19 +686,19 @@ amdsmi_status_t } amdsmi_status_t amdsmi_stop_event_notification( - amdsmi_processor_handle device_handle) { - return rsmi_wrapper(rsmi_event_notification_stop, device_handle); + amdsmi_processor_handle processor_handle) { + return rsmi_wrapper(rsmi_event_notification_stop, processor_handle); } amdsmi_status_t amdsmi_dev_counter_group_supported( - amdsmi_processor_handle device_handle, amdsmi_event_group_t group) { - return rsmi_wrapper(rsmi_dev_counter_group_supported, device_handle, + amdsmi_processor_handle processor_handle, amdsmi_event_group_t group) { + return rsmi_wrapper(rsmi_dev_counter_group_supported, processor_handle, static_cast(group)); } -amdsmi_status_t amdsmi_dev_create_counter(amdsmi_processor_handle device_handle, +amdsmi_status_t amdsmi_dev_create_counter(amdsmi_processor_handle processor_handle, amdsmi_event_type_t type, amdsmi_event_handle_t *evnt_handle) { - return rsmi_wrapper(rsmi_dev_counter_create, device_handle, + return rsmi_wrapper(rsmi_dev_counter_create, processor_handle, static_cast(type), static_cast(evnt_handle)); } @@ -727,29 +727,29 @@ amdsmi_read_counter(amdsmi_event_handle_t evt_handle, } amdsmi_status_t - amdsmi_counter_get_available_counters(amdsmi_processor_handle device_handle, + amdsmi_counter_get_available_counters(amdsmi_processor_handle processor_handle, amdsmi_event_group_t grp, uint32_t *available) { - return rsmi_wrapper(rsmi_counter_available_counters_get, device_handle, + return rsmi_wrapper(rsmi_counter_available_counters_get, processor_handle, static_cast(grp), available); } amdsmi_status_t -amdsmi_topo_get_numa_node_number(amdsmi_processor_handle device_handle, uint32_t *numa_node) { - return rsmi_wrapper(rsmi_topo_get_numa_node_number, device_handle, numa_node); +amdsmi_topo_get_numa_node_number(amdsmi_processor_handle processor_handle, uint32_t *numa_node) { + return rsmi_wrapper(rsmi_topo_get_numa_node_number, processor_handle, numa_node); } amdsmi_status_t -amdsmi_topo_get_link_weight(amdsmi_processor_handle device_handle_src, amdsmi_processor_handle device_handle_dst, +amdsmi_topo_get_link_weight(amdsmi_processor_handle processor_handle_src, amdsmi_processor_handle processor_handle_dst, uint64_t *weight) { AMDSMI_CHECK_INIT(); amd::smi::AMDSmiGPUDevice* src_device = nullptr; amd::smi::AMDSmiGPUDevice* dst_device = nullptr; - amdsmi_status_t r = get_gpu_device_from_handle(device_handle_src, &src_device); + amdsmi_status_t r = get_gpu_device_from_handle(processor_handle_src, &src_device); if (r != AMDSMI_STATUS_SUCCESS) return r; - r = get_gpu_device_from_handle(device_handle_dst, &dst_device); + r = get_gpu_device_from_handle(processor_handle_dst, &dst_device); if (r != AMDSMI_STATUS_SUCCESS) return r; auto rstatus = rsmi_topo_get_link_weight(src_device->get_gpu_id(), dst_device->get_gpu_id(), @@ -758,16 +758,16 @@ amdsmi_topo_get_link_weight(amdsmi_processor_handle device_handle_src, amdsmi_pr } amdsmi_status_t - amdsmi_get_minmax_bandwidth(amdsmi_processor_handle device_handle_src, amdsmi_processor_handle device_handle_dst, + amdsmi_get_minmax_bandwidth(amdsmi_processor_handle processor_handle_src, amdsmi_processor_handle processor_handle_dst, uint64_t *min_bandwidth, uint64_t *max_bandwidth) { AMDSMI_CHECK_INIT(); amd::smi::AMDSmiGPUDevice* src_device = nullptr; amd::smi::AMDSmiGPUDevice* dst_device = nullptr; - amdsmi_status_t r = get_gpu_device_from_handle(device_handle_src, &src_device); + amdsmi_status_t r = get_gpu_device_from_handle(processor_handle_src, &src_device); if (r != AMDSMI_STATUS_SUCCESS) return r; - r = get_gpu_device_from_handle(device_handle_dst, &dst_device); + r = get_gpu_device_from_handle(processor_handle_dst, &dst_device); if (r != AMDSMI_STATUS_SUCCESS) return r; auto rstatus = rsmi_minmax_bandwidth_get(src_device->get_gpu_id(), dst_device->get_gpu_id(), @@ -776,16 +776,16 @@ amdsmi_status_t } amdsmi_status_t -amdsmi_topo_get_link_type(amdsmi_processor_handle device_handle_src, amdsmi_processor_handle device_handle_dst, +amdsmi_topo_get_link_type(amdsmi_processor_handle processor_handle_src, amdsmi_processor_handle processor_handle_dst, uint64_t *hops, AMDSMI_IO_LINK_TYPE *type) { AMDSMI_CHECK_INIT(); amd::smi::AMDSmiGPUDevice* src_device = nullptr; amd::smi::AMDSmiGPUDevice* dst_device = nullptr; - amdsmi_status_t r = get_gpu_device_from_handle(device_handle_src, &src_device); + amdsmi_status_t r = get_gpu_device_from_handle(processor_handle_src, &src_device); if (r != AMDSMI_STATUS_SUCCESS) return r; - r = get_gpu_device_from_handle(device_handle_dst, &dst_device); + r = get_gpu_device_from_handle(processor_handle_dst, &dst_device); if (r != AMDSMI_STATUS_SUCCESS) return r; auto rstatus = rsmi_topo_get_link_type(src_device->get_gpu_id(), dst_device->get_gpu_id(), @@ -794,17 +794,17 @@ amdsmi_topo_get_link_type(amdsmi_processor_handle device_handle_src, amdsmi_proc } amdsmi_status_t -amdsmi_is_P2P_accessible(amdsmi_processor_handle device_handle_src, - amdsmi_processor_handle device_handle_dst, +amdsmi_is_P2P_accessible(amdsmi_processor_handle processor_handle_src, + amdsmi_processor_handle processor_handle_dst, bool *accessible) { AMDSMI_CHECK_INIT(); amd::smi::AMDSmiGPUDevice* src_device = nullptr; amd::smi::AMDSmiGPUDevice* dst_device = nullptr; - amdsmi_status_t r = get_gpu_device_from_handle(device_handle_src, &src_device); + amdsmi_status_t r = get_gpu_device_from_handle(processor_handle_src, &src_device); if (r != AMDSMI_STATUS_SUCCESS) return r; - r = get_gpu_device_from_handle(device_handle_dst, &dst_device); + r = get_gpu_device_from_handle(processor_handle_dst, &dst_device); if (r != AMDSMI_STATUS_SUCCESS) return r; auto rstatus = rsmi_is_P2P_accessible(src_device->get_gpu_id(), dst_device->get_gpu_id(), @@ -814,34 +814,34 @@ amdsmi_is_P2P_accessible(amdsmi_processor_handle device_handle_src, // TODO(bliu) : other xgmi related information amdsmi_status_t -amdsmi_get_xgmi_info(amdsmi_processor_handle device_handle, amdsmi_xgmi_info_t *info) { +amdsmi_get_xgmi_info(amdsmi_processor_handle processor_handle, amdsmi_xgmi_info_t *info) { AMDSMI_CHECK_INIT(); if (info == nullptr) return AMDSMI_STATUS_INVAL; - return rsmi_wrapper(rsmi_dev_xgmi_hive_id_get, device_handle, + return rsmi_wrapper(rsmi_dev_xgmi_hive_id_get, processor_handle, &(info->xgmi_hive_id)); } amdsmi_status_t -amdsmi_dev_xgmi_error_status(amdsmi_processor_handle device_handle, amdsmi_xgmi_status_t *status) { - return rsmi_wrapper(rsmi_dev_xgmi_error_status, device_handle, +amdsmi_dev_xgmi_error_status(amdsmi_processor_handle processor_handle, amdsmi_xgmi_status_t *status) { + return rsmi_wrapper(rsmi_dev_xgmi_error_status, processor_handle, reinterpret_cast(status)); } amdsmi_status_t -amdsmi_dev_reset_xgmi_error(amdsmi_processor_handle device_handle) { - return rsmi_wrapper(rsmi_dev_xgmi_error_reset, device_handle); +amdsmi_dev_reset_xgmi_error(amdsmi_processor_handle processor_handle) { + return rsmi_wrapper(rsmi_dev_xgmi_error_reset, processor_handle); } amdsmi_status_t -amdsmi_dev_open_supported_func_iterator(amdsmi_processor_handle device_handle, +amdsmi_dev_open_supported_func_iterator(amdsmi_processor_handle processor_handle, amdsmi_func_id_iter_handle_t *handle) { AMDSMI_CHECK_INIT(); if (handle == nullptr) return AMDSMI_STATUS_INVAL; - return rsmi_wrapper(rsmi_dev_supported_func_iterator_open, device_handle, + return rsmi_wrapper(rsmi_dev_supported_func_iterator_open, processor_handle, reinterpret_cast(handle)); } @@ -1008,60 +1008,60 @@ amdsmi_get_compute_process_gpus(uint32_t pid, uint32_t *dv_indices, return amd::smi::rsmi_to_amdsmi_status(r); } -amdsmi_status_t amdsmi_dev_get_ecc_count(amdsmi_processor_handle device_handle, +amdsmi_status_t amdsmi_dev_get_ecc_count(amdsmi_processor_handle processor_handle, amdsmi_gpu_block_t block, amdsmi_error_count_t *ec) { AMDSMI_CHECK_INIT(); if (ec == nullptr) return AMDSMI_STATUS_INVAL; - return rsmi_wrapper(rsmi_dev_ecc_count_get, device_handle, + return rsmi_wrapper(rsmi_dev_ecc_count_get, processor_handle, static_cast(block), reinterpret_cast(ec)); } -amdsmi_status_t amdsmi_dev_get_ecc_enabled(amdsmi_processor_handle device_handle, +amdsmi_status_t amdsmi_dev_get_ecc_enabled(amdsmi_processor_handle processor_handle, uint64_t *enabled_blocks) { AMDSMI_CHECK_INIT(); if (enabled_blocks == nullptr) return AMDSMI_STATUS_INVAL; - return rsmi_wrapper(rsmi_dev_ecc_enabled_get, device_handle, + return rsmi_wrapper(rsmi_dev_ecc_enabled_get, processor_handle, enabled_blocks); } -amdsmi_status_t amdsmi_dev_get_ecc_status(amdsmi_processor_handle device_handle, +amdsmi_status_t amdsmi_dev_get_ecc_status(amdsmi_processor_handle processor_handle, amdsmi_gpu_block_t block, amdsmi_ras_err_state_t *state) { AMDSMI_CHECK_INIT(); if (state == nullptr) return AMDSMI_STATUS_INVAL; - return rsmi_wrapper(rsmi_dev_ecc_status_get, device_handle, + return rsmi_wrapper(rsmi_dev_ecc_status_get, processor_handle, static_cast(block), reinterpret_cast(state)); } amdsmi_status_t -amdsmi_dev_get_busy_percent(amdsmi_processor_handle device_handle, +amdsmi_dev_get_busy_percent(amdsmi_processor_handle processor_handle, uint32_t *busy_percent) { AMDSMI_CHECK_INIT(); if (busy_percent == nullptr) return AMDSMI_STATUS_INVAL; - return rsmi_wrapper(rsmi_dev_busy_percent_get, device_handle, + return rsmi_wrapper(rsmi_dev_busy_percent_get, processor_handle, busy_percent); } amdsmi_status_t amdsmi_dev_get_gpu_metrics_info( - amdsmi_processor_handle device_handle, + amdsmi_processor_handle processor_handle, amdsmi_gpu_metrics_t *pgpu_metrics) { AMDSMI_CHECK_INIT(); if (pgpu_metrics == nullptr) return AMDSMI_STATUS_INVAL; - return rsmi_wrapper(rsmi_dev_gpu_metrics_info_get, device_handle, + return rsmi_wrapper(rsmi_dev_gpu_metrics_info_get, processor_handle, reinterpret_cast(pgpu_metrics)); } amdsmi_status_t -amdsmi_get_power_cap_info(amdsmi_processor_handle device_handle, +amdsmi_get_power_cap_info(amdsmi_processor_handle processor_handle, uint32_t sensor_ind, amdsmi_power_cap_info_t *info) { AMDSMI_CHECK_INIT(); @@ -1071,9 +1071,13 @@ amdsmi_get_power_cap_info(amdsmi_processor_handle device_handle, bool set_ret_success = false; amd::smi::AMDSmiGPUDevice* gpudevice = nullptr; + amdsmi_status_t r = get_gpu_device_from_handle(processor_handle, &gpudevice); + if (r != AMDSMI_STATUS_SUCCESS) + return r; + amdsmi_status_t status; - status = get_gpu_device_from_handle(device_handle, &gpudevice); + status = get_gpu_device_from_handle(processor_handle, &gpudevice); if (status != AMDSMI_STATUS_SUCCESS) { return status; @@ -1097,20 +1101,20 @@ amdsmi_get_power_cap_info(amdsmi_processor_handle device_handle, info->dpm_cap = dpm; } else { - status = rsmi_wrapper(rsmi_dev_power_cap_get, device_handle, + status = rsmi_wrapper(rsmi_dev_power_cap_get, processor_handle, sensor_ind, &(info->power_cap)); if ((status == AMDSMI_STATUS_SUCCESS) && !set_ret_success) set_ret_success = true; } // Get other information from rocm-smi - status = rsmi_wrapper(rsmi_dev_power_cap_default_get, device_handle, + status = rsmi_wrapper(rsmi_dev_power_cap_default_get, processor_handle, &(info->default_power_cap)); if ((status == AMDSMI_STATUS_SUCCESS) && !set_ret_success) set_ret_success = true; - status = rsmi_wrapper(rsmi_dev_power_cap_range_get, device_handle, sensor_ind, + status = rsmi_wrapper(rsmi_dev_power_cap_range_get, processor_handle, sensor_ind, &(info->max_power_cap), &(info->min_power_cap)); if ((status == AMDSMI_STATUS_SUCCESS) && !set_ret_success) @@ -1120,85 +1124,85 @@ amdsmi_get_power_cap_info(amdsmi_processor_handle device_handle, } amdsmi_status_t - amdsmi_dev_set_power_cap(amdsmi_processor_handle device_handle, + amdsmi_dev_set_power_cap(amdsmi_processor_handle processor_handle, uint32_t sensor_ind, uint64_t cap) { - return rsmi_wrapper(rsmi_dev_power_cap_set, device_handle, + return rsmi_wrapper(rsmi_dev_power_cap_set, processor_handle, sensor_ind, cap); } amdsmi_status_t -amdsmi_dev_get_power_ave(amdsmi_processor_handle device_handle, +amdsmi_dev_get_power_ave(amdsmi_processor_handle processor_handle, uint32_t sensor_ind, uint64_t *power) { AMDSMI_CHECK_INIT(); if (power == nullptr) return AMDSMI_STATUS_INVAL; - return rsmi_wrapper(rsmi_dev_power_ave_get, device_handle, + return rsmi_wrapper(rsmi_dev_power_ave_get, processor_handle, sensor_ind, power); } amdsmi_status_t - amdsmi_dev_get_power_profile_presets(amdsmi_processor_handle device_handle, + amdsmi_dev_get_power_profile_presets(amdsmi_processor_handle processor_handle, uint32_t sensor_ind, amdsmi_power_profile_status_t *status) { AMDSMI_CHECK_INIT(); if (status == nullptr) return AMDSMI_STATUS_INVAL; - return rsmi_wrapper(rsmi_dev_power_profile_presets_get, device_handle, + return rsmi_wrapper(rsmi_dev_power_profile_presets_get, processor_handle, sensor_ind, reinterpret_cast(status)); } amdsmi_status_t amdsmi_set_perf_determinism_mode( - amdsmi_processor_handle device_handle, uint64_t clkvalue) { - return rsmi_wrapper(rsmi_perf_determinism_mode_set, device_handle, + amdsmi_processor_handle processor_handle, uint64_t clkvalue) { + return rsmi_wrapper(rsmi_perf_determinism_mode_set, processor_handle, clkvalue); } amdsmi_status_t - amdsmi_dev_set_power_profile(amdsmi_processor_handle device_handle, + amdsmi_dev_set_power_profile(amdsmi_processor_handle processor_handle, uint32_t reserved, amdsmi_power_profile_preset_masks_t profile) { - return rsmi_wrapper(rsmi_dev_power_profile_set, device_handle, + return rsmi_wrapper(rsmi_dev_power_profile_set, processor_handle, reserved, static_cast(profile)); } -amdsmi_status_t amdsmi_dev_get_perf_level(amdsmi_processor_handle device_handle, +amdsmi_status_t amdsmi_dev_get_perf_level(amdsmi_processor_handle processor_handle, amdsmi_dev_perf_level_t *perf) { AMDSMI_CHECK_INIT(); if (perf == nullptr) return AMDSMI_STATUS_INVAL; - return rsmi_wrapper(rsmi_dev_perf_level_get, device_handle, + return rsmi_wrapper(rsmi_dev_perf_level_get, processor_handle, reinterpret_cast(perf)); } amdsmi_status_t - amdsmi_dev_set_perf_level(amdsmi_processor_handle device_handle, + amdsmi_dev_set_perf_level(amdsmi_processor_handle processor_handle, amdsmi_dev_perf_level_t perf_lvl) { - return rsmi_wrapper(rsmi_dev_perf_level_set, device_handle, + return rsmi_wrapper(rsmi_dev_perf_level_set, processor_handle, static_cast(perf_lvl)); } amdsmi_status_t - amdsmi_dev_set_perf_level_v1(amdsmi_processor_handle device_handle, + amdsmi_dev_set_perf_level_v1(amdsmi_processor_handle processor_handle, amdsmi_dev_perf_level_t perf_lvl) { - return rsmi_wrapper(rsmi_dev_perf_level_set_v1, device_handle, + return rsmi_wrapper(rsmi_dev_perf_level_set_v1, processor_handle, static_cast(perf_lvl)); } -amdsmi_status_t amdsmi_dev_set_pci_bandwidth(amdsmi_processor_handle device_handle, +amdsmi_status_t amdsmi_dev_set_pci_bandwidth(amdsmi_processor_handle processor_handle, uint64_t bw_bitmask) { - return rsmi_wrapper(rsmi_dev_pci_bandwidth_set, device_handle, + return rsmi_wrapper(rsmi_dev_pci_bandwidth_set, processor_handle, bw_bitmask); } -amdsmi_status_t amdsmi_dev_get_pci_bandwidth(amdsmi_processor_handle device_handle, +amdsmi_status_t amdsmi_dev_get_pci_bandwidth(amdsmi_processor_handle processor_handle, amdsmi_pcie_bandwidth_t *bandwidth) { - return rsmi_wrapper(rsmi_dev_pci_bandwidth_get, device_handle, + return rsmi_wrapper(rsmi_dev_pci_bandwidth_get, processor_handle, reinterpret_cast(bandwidth)); } // TODO(bliu): other frequencies in amdsmi_clk_type_t -amdsmi_status_t amdsmi_dev_get_gpu_clk_freq(amdsmi_processor_handle device_handle, +amdsmi_status_t amdsmi_dev_get_gpu_clk_freq(amdsmi_processor_handle processor_handle, amdsmi_clk_type_t clk_type, amdsmi_frequencies_t *f) { AMDSMI_CHECK_INIT(); @@ -1212,7 +1216,7 @@ amdsmi_status_t amdsmi_dev_get_gpu_clk_freq(amdsmi_processor_handle device_hand clk_type == CLK_TYPE_DCLK1 ) { amdsmi_gpu_metrics_t metric_info; auto r_status = amdsmi_dev_get_gpu_metrics_info( - device_handle, &metric_info); + processor_handle, &metric_info); if (r_status != AMDSMI_STATUS_SUCCESS) return r_status; @@ -1237,12 +1241,12 @@ amdsmi_status_t amdsmi_dev_get_gpu_clk_freq(amdsmi_processor_handle device_hand return r_status; } - return rsmi_wrapper(rsmi_dev_gpu_clk_freq_get, device_handle, + return rsmi_wrapper(rsmi_dev_gpu_clk_freq_get, processor_handle, static_cast(clk_type), reinterpret_cast(f)); } -amdsmi_status_t amdsmi_dev_set_clk_freq(amdsmi_processor_handle device_handle, +amdsmi_status_t amdsmi_dev_set_clk_freq(amdsmi_processor_handle processor_handle, amdsmi_clk_type_t clk_type, uint64_t freq_bitmask) { AMDSMI_CHECK_INIT(); @@ -1254,142 +1258,142 @@ amdsmi_status_t amdsmi_dev_set_clk_freq(amdsmi_processor_handle device_handle, return AMDSMI_STATUS_NOT_SUPPORTED; } - return rsmi_wrapper(rsmi_dev_gpu_clk_freq_set, device_handle, + return rsmi_wrapper(rsmi_dev_gpu_clk_freq_set, processor_handle, static_cast(clk_type), freq_bitmask); } amdsmi_status_t -amdsmi_dev_get_memory_reserved_pages(amdsmi_processor_handle device_handle, +amdsmi_dev_get_memory_reserved_pages(amdsmi_processor_handle processor_handle, uint32_t *num_pages, amdsmi_retired_page_record_t *records) { - return rsmi_wrapper(rsmi_dev_memory_reserved_pages_get, device_handle, + return rsmi_wrapper(rsmi_dev_memory_reserved_pages_get, processor_handle, num_pages, reinterpret_cast(records)); } -amdsmi_status_t amdsmi_dev_get_memory_total(amdsmi_processor_handle device_handle, +amdsmi_status_t amdsmi_dev_get_memory_total(amdsmi_processor_handle processor_handle, amdsmi_memory_type_t mem_type, uint64_t *total) { - return rsmi_wrapper(rsmi_dev_memory_total_get, device_handle, + return rsmi_wrapper(rsmi_dev_memory_total_get, processor_handle, static_cast(mem_type), total); } -amdsmi_status_t amdsmi_dev_get_memory_usage(amdsmi_processor_handle device_handle, +amdsmi_status_t amdsmi_dev_get_memory_usage(amdsmi_processor_handle processor_handle, amdsmi_memory_type_t mem_type, uint64_t *used) { - return rsmi_wrapper(rsmi_dev_memory_usage_get, device_handle, + return rsmi_wrapper(rsmi_dev_memory_usage_get, processor_handle, static_cast(mem_type), used); } amdsmi_status_t amdsmi_dev_get_overdrive_level( - amdsmi_processor_handle device_handle, + amdsmi_processor_handle processor_handle, uint32_t *od) { - return rsmi_wrapper(rsmi_dev_overdrive_level_get, device_handle, od); + return rsmi_wrapper(rsmi_dev_overdrive_level_get, processor_handle, od); } amdsmi_status_t amdsmi_dev_set_overdrive_level( - amdsmi_processor_handle device_handle, uint32_t od) { - return rsmi_wrapper(rsmi_dev_overdrive_level_set, device_handle, od); + amdsmi_processor_handle processor_handle, uint32_t od) { + return rsmi_wrapper(rsmi_dev_overdrive_level_set, processor_handle, od); } amdsmi_status_t amdsmi_dev_get_pci_replay_counter( - amdsmi_processor_handle device_handle, uint64_t *counter) { + amdsmi_processor_handle processor_handle, uint64_t *counter) { return rsmi_wrapper(rsmi_dev_pci_replay_counter_get, - device_handle, counter); + processor_handle, counter); } amdsmi_status_t amdsmi_dev_get_pci_throughput( - amdsmi_processor_handle device_handle, + amdsmi_processor_handle processor_handle, uint64_t *sent, uint64_t *received, uint64_t *max_pkt_sz) { - return rsmi_wrapper(rsmi_dev_pci_throughput_get, device_handle, + return rsmi_wrapper(rsmi_dev_pci_throughput_get, processor_handle, sent, received, max_pkt_sz); } -amdsmi_status_t amdsmi_dev_get_od_volt_info(amdsmi_processor_handle device_handle, +amdsmi_status_t amdsmi_dev_get_od_volt_info(amdsmi_processor_handle processor_handle, amdsmi_od_volt_freq_data_t *odv) { - return rsmi_wrapper(rsmi_dev_od_volt_info_get, device_handle, + return rsmi_wrapper(rsmi_dev_od_volt_info_get, processor_handle, reinterpret_cast(odv)); } amdsmi_status_t amdsmi_dev_get_od_volt_curve_regions( - amdsmi_processor_handle device_handle, + amdsmi_processor_handle processor_handle, uint32_t *num_regions, amdsmi_freq_volt_region_t *buffer) { - return rsmi_wrapper(rsmi_dev_od_volt_curve_regions_get, device_handle, + return rsmi_wrapper(rsmi_dev_od_volt_curve_regions_get, processor_handle, num_regions, reinterpret_cast(buffer)); } -amdsmi_status_t amdsmi_dev_get_volt_metric(amdsmi_processor_handle device_handle, +amdsmi_status_t amdsmi_dev_get_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, device_handle, + return rsmi_wrapper(rsmi_dev_volt_metric_get, processor_handle, static_cast(sensor_type), static_cast(metric), voltage); } -amdsmi_status_t amdsmi_dev_set_od_clk_info(amdsmi_processor_handle device_handle, +amdsmi_status_t amdsmi_dev_set_od_clk_info(amdsmi_processor_handle processor_handle, amdsmi_freq_ind_t level, uint64_t clkvalue, amdsmi_clk_type_t clkType) { - return rsmi_wrapper(rsmi_dev_od_clk_info_set, device_handle, + return rsmi_wrapper(rsmi_dev_od_clk_info_set, processor_handle, static_cast(level), clkvalue, static_cast(clkType)); } -amdsmi_status_t amdsmi_dev_set_od_volt_info(amdsmi_processor_handle device_handle, +amdsmi_status_t amdsmi_dev_set_od_volt_info(amdsmi_processor_handle processor_handle, uint32_t vpoint, uint64_t clkvalue, uint64_t voltvalue) { - return rsmi_wrapper(rsmi_dev_od_volt_info_set, device_handle, + return rsmi_wrapper(rsmi_dev_od_volt_info_set, processor_handle, vpoint, clkvalue, voltvalue); } -amdsmi_status_t amdsmi_dev_set_clk_range(amdsmi_processor_handle device_handle, +amdsmi_status_t amdsmi_dev_set_clk_range(amdsmi_processor_handle processor_handle, uint64_t minclkvalue, uint64_t maxclkvalue, amdsmi_clk_type_t clkType) { - return rsmi_wrapper(rsmi_dev_clk_range_set, device_handle, + return rsmi_wrapper(rsmi_dev_clk_range_set, processor_handle, minclkvalue, maxclkvalue, static_cast(clkType)); } amdsmi_status_t amdsmi_dev_set_overdrive_level_v1( - amdsmi_processor_handle device_handle, + amdsmi_processor_handle processor_handle, uint32_t od) { - return rsmi_wrapper(rsmi_dev_overdrive_level_set_v1, device_handle, + return rsmi_wrapper(rsmi_dev_overdrive_level_set_v1, processor_handle, od); } -amdsmi_status_t amdsmi_dev_reset_gpu(amdsmi_processor_handle device_handle) { - return rsmi_wrapper(rsmi_dev_gpu_reset, device_handle); +amdsmi_status_t amdsmi_dev_reset_gpu(amdsmi_processor_handle processor_handle) { + return rsmi_wrapper(rsmi_dev_gpu_reset, processor_handle); } -amdsmi_status_t amdsmi_get_utilization_count(amdsmi_processor_handle device_handle, +amdsmi_status_t amdsmi_get_utilization_count(amdsmi_processor_handle processor_handle, amdsmi_utilization_counter_t utilization_counters[], uint32_t count, uint64_t *timestamp) { - return rsmi_wrapper(rsmi_utilization_count_get, device_handle, + return rsmi_wrapper(rsmi_utilization_count_get, processor_handle, reinterpret_cast(utilization_counters), count, timestamp); } amdsmi_status_t amdsmi_dev_get_memory_busy_percent( - amdsmi_processor_handle device_handle, + amdsmi_processor_handle processor_handle, uint32_t *busy_percent) { - return rsmi_wrapper(rsmi_dev_memory_busy_percent_get, device_handle, + return rsmi_wrapper(rsmi_dev_memory_busy_percent_get, processor_handle, busy_percent); } -amdsmi_status_t amdsmi_dev_get_energy_count(amdsmi_processor_handle device_handle, +amdsmi_status_t amdsmi_dev_get_energy_count(amdsmi_processor_handle processor_handle, uint64_t *power, float *counter_resolution, uint64_t *timestamp) { - return rsmi_wrapper(rsmi_dev_energy_count_get, device_handle, + return rsmi_wrapper(rsmi_dev_energy_count_get, processor_handle, power, counter_resolution, timestamp); } amdsmi_status_t amdsmi_dev_get_drm_render_minor( - amdsmi_processor_handle device_handle, uint32_t *minor) { - return rsmi_wrapper(rsmi_dev_drm_render_minor_get, device_handle, + amdsmi_processor_handle processor_handle, uint32_t *minor) { + return rsmi_wrapper(rsmi_dev_drm_render_minor_get, processor_handle, minor); } amdsmi_status_t amdsmi_dev_get_pci_id( - amdsmi_processor_handle device_handle, uint64_t *bdfid) { - return rsmi_wrapper(rsmi_dev_pci_id_get, device_handle, + amdsmi_processor_handle processor_handle, uint64_t *bdfid) { + return rsmi_wrapper(rsmi_dev_pci_id_get, processor_handle, bdfid); } amdsmi_status_t amdsmi_topo_get_numa_affinity( - amdsmi_processor_handle device_handle, uint32_t *numa_node) { - return rsmi_wrapper(rsmi_topo_numa_affinity_get, device_handle, + amdsmi_processor_handle processor_handle, uint32_t *numa_node) { + return rsmi_wrapper(rsmi_topo_numa_affinity_get, processor_handle, numa_node); } @@ -1418,7 +1422,7 @@ amdsmi_status_t amdsmi_get_version_str(amdsmi_sw_component_t component, } amdsmi_status_t -amdsmi_get_vbios_info(amdsmi_processor_handle device_handle, amdsmi_vbios_info_t *info) { +amdsmi_get_vbios_info(amdsmi_processor_handle processor_handle, amdsmi_vbios_info_t *info) { AMDSMI_CHECK_INIT(); if (info == nullptr) { @@ -1429,7 +1433,7 @@ amdsmi_get_vbios_info(amdsmi_processor_handle device_handle, amdsmi_vbios_info_t amdsmi_status_t status; amd::smi::AMDSmiGPUDevice* gpu_device = nullptr; - amdsmi_status_t r = get_gpu_device_from_handle(device_handle, &gpu_device); + amdsmi_status_t r = get_gpu_device_from_handle(processor_handle, &gpu_device); if (r != AMDSMI_STATUS_SUCCESS) return r; @@ -1448,7 +1452,7 @@ amdsmi_get_vbios_info(amdsmi_processor_handle device_handle, amdsmi_vbios_info_t else { // get vbios version string from rocm_smi char vbios_version[AMDSMI_NORMAL_STRING_LENGTH]; - status = rsmi_wrapper(rsmi_dev_vbios_version_get, device_handle, + status = rsmi_wrapper(rsmi_dev_vbios_version_get, processor_handle, vbios_version, AMDSMI_NORMAL_STRING_LENGTH); @@ -1463,7 +1467,7 @@ amdsmi_get_vbios_info(amdsmi_processor_handle device_handle, amdsmi_vbios_info_t } amdsmi_status_t -amdsmi_get_gpu_activity(amdsmi_processor_handle device_handle, amdsmi_engine_usage_t *info) { +amdsmi_get_gpu_activity(amdsmi_processor_handle processor_handle, amdsmi_engine_usage_t *info) { AMDSMI_CHECK_INIT(); if (info == nullptr) { @@ -1472,11 +1476,11 @@ amdsmi_get_gpu_activity(amdsmi_processor_handle device_handle, amdsmi_engine_usa amdsmi_gpu_metrics_t metrics = {}; amd::smi::AMDSmiGPUDevice* gpu_device = nullptr; - amdsmi_status_t r = get_gpu_device_from_handle(device_handle, &gpu_device); + amdsmi_status_t r = get_gpu_device_from_handle(processor_handle, &gpu_device); if (r != AMDSMI_STATUS_SUCCESS) return r; amdsmi_status_t status; - status = amdsmi_dev_get_gpu_metrics_info(device_handle, &metrics); + status = amdsmi_dev_get_gpu_metrics_info(processor_handle, &metrics); if (status != AMDSMI_STATUS_SUCCESS) { return status; } @@ -1488,7 +1492,7 @@ amdsmi_get_gpu_activity(amdsmi_processor_handle device_handle, amdsmi_engine_usa } amdsmi_status_t -amdsmi_get_clock_measure(amdsmi_processor_handle device_handle, amdsmi_clk_type_t clk_type, amdsmi_clk_measure_t *info) { +amdsmi_get_clock_measure(amdsmi_processor_handle processor_handle, amdsmi_clk_type_t clk_type, amdsmi_clk_measure_t *info) { AMDSMI_CHECK_INIT(); if (info == nullptr) { @@ -1501,12 +1505,12 @@ amdsmi_get_clock_measure(amdsmi_processor_handle device_handle, amdsmi_clk_type_ amdsmi_gpu_metrics_t metrics = {}; amd::smi::AMDSmiGPUDevice* gpu_device = nullptr; - amdsmi_status_t r = get_gpu_device_from_handle(device_handle, &gpu_device); + amdsmi_status_t r = get_gpu_device_from_handle(processor_handle, &gpu_device); if (r != AMDSMI_STATUS_SUCCESS) return r; amdsmi_status_t status; - status = amdsmi_dev_get_gpu_metrics_info(device_handle, &metrics); + status = amdsmi_dev_get_gpu_metrics_info(processor_handle, &metrics); if (status != AMDSMI_STATUS_SUCCESS) { return status; } @@ -1543,7 +1547,7 @@ amdsmi_get_clock_measure(amdsmi_processor_handle device_handle, amdsmi_clk_type_ } amdsmi_status_t -amdsmi_get_ras_block_features_enabled(amdsmi_processor_handle device_handle, amdsmi_gpu_block_t block, amdsmi_ras_err_state_t *state) { +amdsmi_get_ras_block_features_enabled(amdsmi_processor_handle processor_handle, amdsmi_gpu_block_t block, amdsmi_ras_err_state_t *state) { AMDSMI_CHECK_INIT(); if (state == nullptr || block > AMDSMI_GPU_BLOCK_LAST) { @@ -1552,7 +1556,7 @@ amdsmi_get_ras_block_features_enabled(amdsmi_processor_handle device_handle, amd uint64_t features_mask = 0; amd::smi::AMDSmiGPUDevice* gpu_device = nullptr; - amdsmi_status_t r = get_gpu_device_from_handle(device_handle, &gpu_device); + amdsmi_status_t r = get_gpu_device_from_handle(processor_handle, &gpu_device); if (r != AMDSMI_STATUS_SUCCESS) return r; @@ -1567,7 +1571,7 @@ amdsmi_get_ras_block_features_enabled(amdsmi_processor_handle device_handle, amd } amdsmi_status_t -amdsmi_get_bad_page_info(amdsmi_processor_handle device_handle, uint32_t *num_pages, amdsmi_retired_page_record_t *info) { +amdsmi_get_bad_page_info(amdsmi_processor_handle processor_handle, uint32_t *num_pages, amdsmi_retired_page_record_t *info) { AMDSMI_CHECK_INIT(); if (num_pages == nullptr) { @@ -1575,7 +1579,7 @@ amdsmi_get_bad_page_info(amdsmi_processor_handle device_handle, uint32_t *num_pa } amd::smi::AMDSmiGPUDevice* gpu_device = nullptr; - amdsmi_status_t r = get_gpu_device_from_handle(device_handle, &gpu_device); + amdsmi_status_t r = get_gpu_device_from_handle(processor_handle, &gpu_device); if (r != AMDSMI_STATUS_SUCCESS) return r; @@ -1594,7 +1598,7 @@ amdsmi_get_bad_page_info(amdsmi_processor_handle device_handle, uint32_t *num_pa } amdsmi_status_t -amdsmi_get_ecc_error_count(amdsmi_processor_handle device_handle, amdsmi_error_count_t *ec) { +amdsmi_get_ecc_error_count(amdsmi_processor_handle processor_handle, amdsmi_error_count_t *ec) { AMDSMI_CHECK_INIT(); if (ec == nullptr) { @@ -1602,7 +1606,7 @@ amdsmi_get_ecc_error_count(amdsmi_processor_handle device_handle, amdsmi_error_c } amd::smi::AMDSmiGPUDevice* gpu_device = nullptr; - amdsmi_status_t r = get_gpu_device_from_handle(device_handle, &gpu_device); + amdsmi_status_t r = get_gpu_device_from_handle(processor_handle, &gpu_device); if (r != AMDSMI_STATUS_SUCCESS) return r; @@ -1621,7 +1625,7 @@ amdsmi_get_ecc_error_count(amdsmi_processor_handle device_handle, amdsmi_error_c } amdsmi_status_t -amdsmi_get_process_list(amdsmi_processor_handle device_handle, amdsmi_process_handle *list, uint32_t *max_processes) { +amdsmi_get_process_list(amdsmi_processor_handle processor_handle, amdsmi_process_handle *list, uint32_t *max_processes) { AMDSMI_CHECK_INIT(); if (max_processes == nullptr) { @@ -1633,7 +1637,7 @@ amdsmi_get_process_list(amdsmi_processor_handle device_handle, amdsmi_process_ha uint64_t size = 0; amdsmi_status_t status; amd::smi::AMDSmiGPUDevice* gpu_device = nullptr; - amdsmi_status_t r = get_gpu_device_from_handle(device_handle, &gpu_device); + amdsmi_status_t r = get_gpu_device_from_handle(processor_handle, &gpu_device); if (r != AMDSMI_STATUS_SUCCESS) return r; @@ -1669,7 +1673,7 @@ amdsmi_get_process_list(amdsmi_processor_handle device_handle, amdsmi_process_ha } amdsmi_status_t -amdsmi_get_process_info(amdsmi_processor_handle device_handle, amdsmi_process_handle process, amdsmi_proc_info_t *info) { +amdsmi_get_process_info(amdsmi_processor_handle processor_handle, amdsmi_process_handle process, amdsmi_proc_info_t *info) { AMDSMI_CHECK_INIT(); if (info == nullptr) { @@ -1677,7 +1681,7 @@ amdsmi_get_process_info(amdsmi_processor_handle device_handle, amdsmi_process_ha } amd::smi::AMDSmiGPUDevice* gpu_device = nullptr; - amdsmi_status_t r = get_gpu_device_from_handle(device_handle, &gpu_device); + amdsmi_status_t r = get_gpu_device_from_handle(processor_handle, &gpu_device); if (r != AMDSMI_STATUS_SUCCESS) return r; @@ -1694,7 +1698,7 @@ amdsmi_get_process_info(amdsmi_processor_handle device_handle, amdsmi_process_ha } amdsmi_status_t -amdsmi_get_power_measure(amdsmi_processor_handle device_handle, amdsmi_power_measure_t *info) { +amdsmi_get_power_measure(amdsmi_processor_handle processor_handle, amdsmi_power_measure_t *info) { AMDSMI_CHECK_INIT(); if (info == nullptr) { @@ -1703,20 +1707,20 @@ amdsmi_get_power_measure(amdsmi_processor_handle device_handle, amdsmi_power_mea amdsmi_gpu_metrics_t metrics = {}; amd::smi::AMDSmiGPUDevice* gpu_device = nullptr; - amdsmi_status_t r = get_gpu_device_from_handle(device_handle, &gpu_device); + amdsmi_status_t r = get_gpu_device_from_handle(processor_handle, &gpu_device); if (r != AMDSMI_STATUS_SUCCESS) return r; amdsmi_status_t status; - status = amdsmi_dev_get_gpu_metrics_info(device_handle, &metrics); + status = amdsmi_dev_get_gpu_metrics_info(processor_handle, &metrics); if (status != AMDSMI_STATUS_SUCCESS) { return status; } int64_t voltage_read = 0; - status = amdsmi_dev_get_volt_metric(device_handle, AMDSMI_VOLT_TYPE_VDDGFX, AMDSMI_VOLT_CURRENT, &voltage_read); + status = amdsmi_dev_get_volt_metric(processor_handle, AMDSMI_VOLT_TYPE_VDDGFX, AMDSMI_VOLT_CURRENT, &voltage_read); if (status != AMDSMI_STATUS_SUCCESS) { return status; } @@ -1737,7 +1741,7 @@ amdsmi_get_power_measure(amdsmi_processor_handle device_handle, amdsmi_power_mea } amdsmi_status_t -amdsmi_get_target_frequency_range(amdsmi_processor_handle device_handle, amdsmi_clk_type_t clk_type, amdsmi_frequency_range_t *range) { +amdsmi_get_target_frequency_range(amdsmi_processor_handle processor_handle, amdsmi_clk_type_t clk_type, amdsmi_frequency_range_t *range) { AMDSMI_CHECK_INIT(); if (range == nullptr || clk_type > CLK_TYPE__MAX) { @@ -1746,14 +1750,14 @@ amdsmi_get_target_frequency_range(amdsmi_processor_handle device_handle, amdsmi_ amdsmi_gpu_metrics_t metrics = {}; amd::smi::AMDSmiGPUDevice* gpu_device = nullptr; - amdsmi_status_t r = get_gpu_device_from_handle(device_handle, &gpu_device); + amdsmi_status_t r = get_gpu_device_from_handle(processor_handle, &gpu_device); if (r != AMDSMI_STATUS_SUCCESS) return r; amdsmi_status_t status; int min = 0, max = 0; - status = amdsmi_dev_get_gpu_metrics_info(device_handle, &metrics); + status = amdsmi_dev_get_gpu_metrics_info(processor_handle, &metrics); if (status != AMDSMI_STATUS_SUCCESS) { return status; } @@ -1788,7 +1792,7 @@ amdsmi_get_target_frequency_range(amdsmi_processor_handle device_handle, amdsmi_ } amdsmi_status_t -amdsmi_get_driver_version(amdsmi_processor_handle device_handle, int *length, char *version) { +amdsmi_get_driver_version(amdsmi_processor_handle processor_handle, int *length, char *version) { AMDSMI_CHECK_INIT(); if (length == nullptr || version == nullptr) { @@ -1796,7 +1800,7 @@ amdsmi_get_driver_version(amdsmi_processor_handle device_handle, int *length, ch } amdsmi_status_t status = AMDSMI_STATUS_SUCCESS; amd::smi::AMDSmiGPUDevice* gpu_device = nullptr; - amdsmi_status_t r = get_gpu_device_from_handle(device_handle, &gpu_device); + amdsmi_status_t r = get_gpu_device_from_handle(processor_handle, &gpu_device); if (r != AMDSMI_STATUS_SUCCESS) return r; @@ -1806,7 +1810,7 @@ amdsmi_get_driver_version(amdsmi_processor_handle device_handle, int *length, ch } amdsmi_status_t -amdsmi_get_device_uuid(amdsmi_processor_handle device_handle, unsigned int *uuid_length, char *uuid) { +amdsmi_get_device_uuid(amdsmi_processor_handle processor_handle, unsigned int *uuid_length, char *uuid) { AMDSMI_CHECK_INIT(); if (uuid_length == nullptr || uuid == nullptr) { @@ -1814,7 +1818,7 @@ amdsmi_get_device_uuid(amdsmi_processor_handle device_handle, unsigned int *uuid } amd::smi::AMDSmiGPUDevice* gpu_device = nullptr; - amdsmi_status_t r = get_gpu_device_from_handle(device_handle, &gpu_device); + amdsmi_status_t r = get_gpu_device_from_handle(processor_handle, &gpu_device); if (r != AMDSMI_STATUS_SUCCESS) return r; @@ -1828,7 +1832,7 @@ amdsmi_get_device_uuid(amdsmi_processor_handle device_handle, unsigned int *uuid const uint8_t fcn = 0xff; std::string path = "/sys/class/drm/" + gpu_device->get_gpu_path() + "/device/uuid_info"; - status = amdsmi_get_asic_info(device_handle, &asic_info); + status = amdsmi_get_asic_info(processor_handle, &asic_info); if (status != AMDSMI_STATUS_SUCCESS) { printf("Getting asic info failed. Return code: %d", status); return status; @@ -1854,7 +1858,7 @@ amdsmi_get_device_uuid(amdsmi_processor_handle device_handle, unsigned int *uuid } amdsmi_status_t -amdsmi_get_pcie_link_status(amdsmi_processor_handle device_handle, amdsmi_pcie_info_t *info){ +amdsmi_get_pcie_link_status(amdsmi_processor_handle processor_handle, amdsmi_pcie_info_t *info){ AMDSMI_CHECK_INIT(); if (info == nullptr) { @@ -1863,7 +1867,7 @@ amdsmi_get_pcie_link_status(amdsmi_processor_handle device_handle, amdsmi_pcie_i amdsmi_status_t status = AMDSMI_STATUS_SUCCESS; amdsmi_gpu_metrics_t metric_info = {}; status = amdsmi_dev_get_gpu_metrics_info( - device_handle, &metric_info); + processor_handle, &metric_info); if (status != AMDSMI_STATUS_SUCCESS) return status; @@ -1873,7 +1877,7 @@ amdsmi_get_pcie_link_status(amdsmi_processor_handle device_handle, amdsmi_pcie_i return status; } -amdsmi_status_t amdsmi_get_pcie_link_caps(amdsmi_processor_handle device_handle, amdsmi_pcie_info_t *info) { +amdsmi_status_t amdsmi_get_pcie_link_caps(amdsmi_processor_handle processor_handle, amdsmi_pcie_info_t *info) { AMDSMI_CHECK_INIT(); if (info == nullptr) { @@ -1882,7 +1886,7 @@ amdsmi_status_t amdsmi_get_pcie_link_caps(amdsmi_processor_handle device_handle, amdsmi_status_t status = AMDSMI_STATUS_SUCCESS; amd::smi::AMDSmiGPUDevice* gpu_device = nullptr; - amdsmi_status_t r = get_gpu_device_from_handle(device_handle, &gpu_device); + amdsmi_status_t r = get_gpu_device_from_handle(processor_handle, &gpu_device); if (r != AMDSMI_STATUS_SUCCESS) return r; @@ -1919,7 +1923,7 @@ amdsmi_status_t amdsmi_get_pcie_link_caps(amdsmi_processor_handle device_handle, return AMDSMI_STATUS_API_FAILED; } - status = amdsmi_get_asic_info(device_handle, &asic_info); + status = amdsmi_get_asic_info(processor_handle, &asic_info); if (status != AMDSMI_STATUS_SUCCESS) return status; @@ -1931,8 +1935,8 @@ amdsmi_status_t amdsmi_get_pcie_link_caps(amdsmi_processor_handle device_handle, return status; } -amdsmi_status_t amdsmi_get_device_handle_from_bdf(amdsmi_bdf_t bdf, - amdsmi_processor_handle* device_handle) +amdsmi_status_t amdsmi_get_processor_handle_from_bdf(amdsmi_bdf_t bdf, + amdsmi_processor_handle* processor_handle) { amdsmi_status_t status; uint32_t socket_count = 0; @@ -1942,7 +1946,7 @@ amdsmi_status_t amdsmi_get_device_handle_from_bdf(amdsmi_bdf_t bdf, AMDSMI_CHECK_INIT(); - if (device_handle == nullptr) { + if (processor_handle == nullptr) { return AMDSMI_STATUS_INVAL; } @@ -1959,7 +1963,7 @@ amdsmi_status_t amdsmi_get_device_handle_from_bdf(amdsmi_bdf_t bdf, } for (unsigned int i = 0; i < socket_count; i++) { - status = amdsmi_get_device_handles(sockets[i], &device_count, devs); + status = amdsmi_get_processor_handles(sockets[i], &device_count, devs); if (status != AMDSMI_STATUS_SUCCESS) { return status; } @@ -1975,7 +1979,7 @@ amdsmi_status_t amdsmi_get_device_handle_from_bdf(amdsmi_bdf_t bdf, bdf.device_number == found_bdf.device_number && bdf.domain_number == found_bdf.domain_number && bdf.function_number == found_bdf.function_number) { - *device_handle = devs[idx]; + *processor_handle = devs[idx]; return AMDSMI_STATUS_SUCCESS; } } diff --git a/src/amd_smi/amd_smi_system.cc b/src/amd_smi/amd_smi_system.cc index d81dfb0c00..19c9c51292 100644 --- a/src/amd_smi/amd_smi_system.cc +++ b/src/amd_smi/amd_smi_system.cc @@ -165,12 +165,12 @@ amdsmi_status_t AMDSmiSystem::handle_to_socket( } amdsmi_status_t AMDSmiSystem::handle_to_device( - amdsmi_processor_handle device_handle, + amdsmi_processor_handle processor_handle, AMDSmiProcessor** device) { - if (device_handle == nullptr || device == nullptr) { + if (processor_handle == nullptr || device == nullptr) { return AMDSMI_STATUS_INVAL; } - *device = static_cast(device_handle); + *device = static_cast(processor_handle); // double check handlers is here if (std::find(devices_.begin(), devices_.end(), *device) @@ -181,8 +181,8 @@ amdsmi_status_t AMDSmiSystem::handle_to_device( } amdsmi_status_t AMDSmiSystem::gpu_index_to_handle(uint32_t gpu_index, - amdsmi_processor_handle* device_handle) { - if (device_handle == nullptr) + amdsmi_processor_handle* processor_handle) { + if (processor_handle == nullptr) return AMDSMI_STATUS_INVAL; auto iter = devices_.begin(); @@ -194,7 +194,7 @@ amdsmi_status_t AMDSmiSystem::gpu_index_to_handle(uint32_t gpu_index, static_cast(cur_device); uint32_t cur_gpu_index = gpu_device->get_gpu_id(); if (gpu_index == cur_gpu_index) { - *device_handle = cur_device; + *processor_handle = cur_device; return AMDSMI_STATUS_SUCCESS; } } diff --git a/tests/amd_smi_test/functional/api_support_read.cc b/tests/amd_smi_test/functional/api_support_read.cc index 5856ea1b91..d7de667630 100755 --- a/tests/amd_smi_test/functional/api_support_read.cc +++ b/tests/amd_smi_test/functional/api_support_read.cc @@ -102,11 +102,11 @@ void TestAPISupportRead::Run(void) { for (uint32_t x = 0; x < num_iterations(); ++x) { for (uint32_t i = 0; i < num_monitor_devs(); ++i) { IF_VERB(STANDARD) { - PrintDeviceHeader(device_handles_[i]); + PrintDeviceHeader(processor_handles_[i]); std::cout << "Supported AMDSMI Functions:" << std::endl; std::cout << "\tVariants (Monitors)" << std::endl; } - err = amdsmi_dev_open_supported_func_iterator(device_handles_[i], &iter_handle); + err = amdsmi_dev_open_supported_func_iterator(processor_handles_[i], &iter_handle); CHK_ERR_ASRT(err) while (1) { diff --git a/tests/amd_smi_test/functional/err_cnt_read.cc b/tests/amd_smi_test/functional/err_cnt_read.cc index ca57be0c24..db8dc6ba09 100755 --- a/tests/amd_smi_test/functional/err_cnt_read.cc +++ b/tests/amd_smi_test/functional/err_cnt_read.cc @@ -98,9 +98,9 @@ void TestErrCntRead::Run(void) { for (uint32_t x = 0; x < num_iterations(); ++x) { for (uint32_t i = 0; i < num_monitor_devs(); ++i) { - PrintDeviceHeader(device_handles_[i]); + PrintDeviceHeader(processor_handles_[i]); - err = amdsmi_dev_get_ecc_enabled(device_handles_[i], &enabled_mask); + err = amdsmi_dev_get_ecc_enabled(processor_handles_[i], &enabled_mask); if (err == AMDSMI_STATUS_NOT_SUPPORTED) { IF_VERB(STANDARD) { std::cout << @@ -108,7 +108,7 @@ void TestErrCntRead::Run(void) { << std::endl; } // Verify api support checking functionality is working - err = amdsmi_dev_get_ecc_enabled(device_handles_[i], nullptr); + err = amdsmi_dev_get_ecc_enabled(processor_handles_[i], nullptr); ASSERT_EQ(err, AMDSMI_STATUS_INVAL); continue; @@ -116,7 +116,7 @@ void TestErrCntRead::Run(void) { CHK_ERR_ASRT(err) // Verify api support checking functionality is working - err = amdsmi_dev_get_ecc_enabled(device_handles_[i], nullptr); + err = amdsmi_dev_get_ecc_enabled(processor_handles_[i], nullptr); ASSERT_EQ(err, AMDSMI_STATUS_INVAL); IF_VERB(STANDARD) { @@ -126,7 +126,7 @@ void TestErrCntRead::Run(void) { } for (uint32_t b = AMDSMI_GPU_BLOCK_FIRST; b <= AMDSMI_GPU_BLOCK_LAST; b = b*2) { - err = amdsmi_dev_get_ecc_status(device_handles_[i], static_cast(b), + err = amdsmi_dev_get_ecc_status(processor_handles_[i], static_cast(b), &err_state); CHK_ERR_ASRT(err) IF_VERB(STANDARD) { @@ -135,11 +135,11 @@ void TestErrCntRead::Run(void) { " block: " << GetErrStateNameStr(err_state) << std::endl; } // Verify api support checking functionality is working - err = amdsmi_dev_get_ecc_status(device_handles_[i], static_cast(b), + err = amdsmi_dev_get_ecc_status(processor_handles_[i], static_cast(b), nullptr); ASSERT_EQ(err, AMDSMI_STATUS_INVAL); - err = amdsmi_dev_get_ecc_count(device_handles_[i], static_cast(b), &ec); + err = amdsmi_dev_get_ecc_count(processor_handles_[i], static_cast(b), &ec); if (err == AMDSMI_STATUS_NOT_SUPPORTED) { IF_VERB(STANDARD) { @@ -148,7 +148,7 @@ void TestErrCntRead::Run(void) { ": Not supported for this device" << std::endl; } // Verify api support checking functionality is working - err = amdsmi_dev_get_ecc_count(device_handles_[i], static_cast(b), + err = amdsmi_dev_get_ecc_count(processor_handles_[i], static_cast(b), nullptr); ASSERT_EQ(err, AMDSMI_STATUS_INVAL); @@ -164,7 +164,7 @@ void TestErrCntRead::Run(void) { << std::endl; } // Verify api support checking functionality is working - err = amdsmi_dev_get_ecc_count(device_handles_[i], static_cast(b), + err = amdsmi_dev_get_ecc_count(processor_handles_[i], static_cast(b), nullptr); ASSERT_EQ(err, AMDSMI_STATUS_INVAL); } diff --git a/tests/amd_smi_test/functional/evt_notif_read_write.cc b/tests/amd_smi_test/functional/evt_notif_read_write.cc index e7f820b1b5..9a7505611b 100755 --- a/tests/amd_smi_test/functional/evt_notif_read_write.cc +++ b/tests/amd_smi_test/functional/evt_notif_read_write.cc @@ -109,7 +109,7 @@ void TestEvtNotifReadWrite::Run(void) { } for (dv_ind = 0; dv_ind < num_monitor_devs(); ++dv_ind) { - ret = amdsmi_init_event_notification(device_handles_[dv_ind]); + ret = amdsmi_init_event_notification(processor_handles_[dv_ind]); if (ret == AMDSMI_STATUS_NOT_SUPPORTED) { IF_VERB(STANDARD) { std::cout << @@ -119,7 +119,7 @@ void TestEvtNotifReadWrite::Run(void) { return; } ASSERT_EQ(ret, AMDSMI_STATUS_SUCCESS); - ret = amdsmi_set_event_notification_mask(device_handles_[dv_ind], mask); + ret = amdsmi_set_event_notification_mask(processor_handles_[dv_ind], mask); ASSERT_EQ(ret, AMDSMI_STATUS_SUCCESS); } @@ -133,7 +133,7 @@ void TestEvtNotifReadWrite::Run(void) { "Expected the number of elements found to be <= buffer size (10)"; IF_VERB(STANDARD) { for (uint32_t i = 0; i < num_elem; ++i) { - std::cout << "\tdv_handle=" << data[i].device_handle << + std::cout << "\tdv_handle=" << data[i].processor_handle << " Type: " << NameFromEvtNotifType(data[i].event) << " Mesg: " << data[i].message << std::endl; if (data[i].event == AMDSMI_EVT_NOTIF_GPU_PRE_RESET) { @@ -167,7 +167,7 @@ void TestEvtNotifReadWrite::Run(void) { "Expected the number of elements found to be <= buffer size (10)"; IF_VERB(STANDARD) { for (uint32_t i = 0; i < num_elem; ++i) { - std::cout << "\tdv_handle=" << data[i].device_handle << + std::cout << "\tdv_handle=" << data[i].processor_handle << " Type: " << NameFromEvtNotifType(data[i].event) << " Mesg: " << data[i].message << std::endl; } @@ -191,7 +191,7 @@ void TestEvtNotifReadWrite::Run(void) { } for (uint32_t dv_ind = 0; dv_ind < num_monitor_devs(); ++dv_ind) { - ret = amdsmi_stop_event_notification(device_handles_[dv_ind]); + ret = amdsmi_stop_event_notification(processor_handles_[dv_ind]); ASSERT_EQ(ret, AMDSMI_STATUS_SUCCESS); } } diff --git a/tests/amd_smi_test/functional/fan_read.cc b/tests/amd_smi_test/functional/fan_read.cc index 53ce8322b2..d8fb52265f 100755 --- a/tests/amd_smi_test/functional/fan_read.cc +++ b/tests/amd_smi_test/functional/fan_read.cc @@ -96,12 +96,12 @@ void TestFanRead::Run(void) { } for (uint32_t x = 0; x < num_iterations(); ++x) { for (uint32_t i = 0; i < num_monitor_devs(); ++i) { - PrintDeviceHeader(device_handles_[i]); + PrintDeviceHeader(processor_handles_[i]); IF_VERB(STANDARD) { std::cout << "\t**Current Fan Speed: "; } - err = amdsmi_dev_get_fan_speed(device_handles_[i], 0, &val_i64); + err = amdsmi_dev_get_fan_speed(processor_handles_[i], 0, &val_i64); if (err == AMDSMI_STATUS_NOT_SUPPORTED) { IF_VERB(STANDARD) { std::cout << "\t**" << ": " << @@ -114,30 +114,30 @@ void TestFanRead::Run(void) { // Verify api support checking functionality is working - err = amdsmi_dev_get_fan_speed(device_handles_[i], 0, nullptr); + err = amdsmi_dev_get_fan_speed(processor_handles_[i], 0, nullptr); ASSERT_EQ(err, AMDSMI_STATUS_INVAL); - err = amdsmi_dev_get_fan_speed_max(device_handles_[i], 0, &val_ui64); + err = amdsmi_dev_get_fan_speed_max(processor_handles_[i], 0, &val_ui64); CHK_ERR_ASRT(err) IF_VERB(STANDARD) { std::cout << val_i64/static_cast(val_ui64)*100; std::cout << "% ("<< val_i64 << "/" << val_ui64 << ")" << std::endl; } // Verify api support checking functionality is working - err = amdsmi_dev_get_fan_speed_max(device_handles_[i], 0, nullptr); + err = amdsmi_dev_get_fan_speed_max(processor_handles_[i], 0, nullptr); ASSERT_EQ(err, AMDSMI_STATUS_INVAL); IF_VERB(STANDARD) { std::cout << "\t**Current fan RPMs: "; } - err = amdsmi_dev_get_fan_rpms(device_handles_[i], 0, &val_i64); + err = amdsmi_dev_get_fan_rpms(processor_handles_[i], 0, &val_i64); CHK_ERR_ASRT(err) IF_VERB(STANDARD) { std::cout << val_i64 << std::endl; } // Verify api support checking functionality is working - err = amdsmi_dev_get_fan_rpms(device_handles_[i], 0, nullptr); + err = amdsmi_dev_get_fan_rpms(processor_handles_[i], 0, nullptr); ASSERT_EQ(err, AMDSMI_STATUS_INVAL); } } diff --git a/tests/amd_smi_test/functional/fan_read_write.cc b/tests/amd_smi_test/functional/fan_read_write.cc index ade6fdd04a..a62b8d40ed 100755 --- a/tests/amd_smi_test/functional/fan_read_write.cc +++ b/tests/amd_smi_test/functional/fan_read_write.cc @@ -98,9 +98,9 @@ void TestFanReadWrite::Run(void) { } for (uint32_t dv_ind = 0; dv_ind < num_monitor_devs(); ++dv_ind) { - PrintDeviceHeader(device_handles_[dv_ind]); + PrintDeviceHeader(processor_handles_[dv_ind]); - ret = amdsmi_dev_get_fan_speed(device_handles_[dv_ind], 0, &orig_speed); + ret = amdsmi_dev_get_fan_speed(processor_handles_[dv_ind], 0, &orig_speed); if (ret == AMDSMI_STATUS_NOT_SUPPORTED) { IF_VERB(STANDARD) { std::cout << "\t**" << ": " << @@ -120,7 +120,7 @@ void TestFanReadWrite::Run(void) { return; } - ret = amdsmi_dev_get_fan_speed_max(device_handles_[dv_ind], 0, &max_speed); + ret = amdsmi_dev_get_fan_speed_max(processor_handles_[dv_ind], 0, &max_speed); CHK_ERR_ASRT(ret) new_speed = 1.1 * orig_speed; @@ -136,12 +136,12 @@ void TestFanReadWrite::Run(void) { std::cout << "Setting fan speed to " << new_speed << std::endl; } - ret = amdsmi_dev_set_fan_speed(device_handles_[dv_ind], 0, new_speed); + ret = amdsmi_dev_set_fan_speed(processor_handles_[dv_ind], 0, new_speed); CHK_ERR_ASRT(ret) sleep(4); - ret = amdsmi_dev_get_fan_speed(device_handles_[dv_ind], 0, &cur_speed); + ret = amdsmi_dev_get_fan_speed(processor_handles_[dv_ind], 0, &cur_speed); CHK_ERR_ASRT(ret) IF_VERB(STANDARD) { @@ -163,12 +163,12 @@ void TestFanReadWrite::Run(void) { std::cout << "Resetting fan control to auto..." << std::endl; } - ret = amdsmi_dev_reset_fan(device_handles_[dv_ind], 0); + ret = amdsmi_dev_reset_fan(processor_handles_[dv_ind], 0); CHK_ERR_ASRT(ret) sleep(3); - ret = amdsmi_dev_get_fan_speed(device_handles_[dv_ind], 0, &cur_speed); + ret = amdsmi_dev_get_fan_speed(processor_handles_[dv_ind], 0, &cur_speed); CHK_ERR_ASRT(ret) IF_VERB(STANDARD) { diff --git a/tests/amd_smi_test/functional/frequencies_read.cc b/tests/amd_smi_test/functional/frequencies_read.cc index 3f4e7e727f..dd05912dc7 100755 --- a/tests/amd_smi_test/functional/frequencies_read.cc +++ b/tests/amd_smi_test/functional/frequencies_read.cc @@ -116,12 +116,12 @@ void TestFrequenciesRead::Run(void) { for (uint32_t x = 0; x < num_iterations(); ++x) { for (uint32_t i = 0; i < num_monitor_devs(); ++i) { auto freq_output = [&](amdsmi_clk_type_t t, const char *name) { - err = amdsmi_dev_get_gpu_clk_freq(device_handles_[i], t, &f); + err = amdsmi_dev_get_gpu_clk_freq(processor_handles_[i], t, &f); if (err == AMDSMI_STATUS_NOT_SUPPORTED) { std::cout << "\t**Get " << name << ": Not supported on this machine" << std::endl; // Verify api support checking functionality is working - err = amdsmi_dev_get_gpu_clk_freq(device_handles_[i], t, nullptr); + err = amdsmi_dev_get_gpu_clk_freq(processor_handles_[i], t, nullptr); ASSERT_EQ(err, AMDSMI_STATUS_INVAL); } else if (err == AMDSMI_STATUS_NOT_YET_IMPLEMENTED) { std::cout << "\t**Get " << name << @@ -133,13 +133,13 @@ void TestFrequenciesRead::Run(void) { std::cout << f.num_supported << std::endl; print_frequencies(&f); // Verify api support checking functionality is working - err = amdsmi_dev_get_gpu_clk_freq(device_handles_[i], t, nullptr); + err = amdsmi_dev_get_gpu_clk_freq(processor_handles_[i], t, nullptr); ASSERT_EQ(err, AMDSMI_STATUS_INVAL); } } }; - PrintDeviceHeader(device_handles_[i]); + PrintDeviceHeader(processor_handles_[i]); freq_output(CLK_TYPE_MEM, "Supported GPU Memory"); freq_output(CLK_TYPE_SYS, "Supported GPU"); @@ -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(device_handles_[i], &b); + err = amdsmi_dev_get_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(device_handles_[i], nullptr); + err = amdsmi_dev_get_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(device_handles_[i], nullptr); + err = amdsmi_dev_get_pci_bandwidth(processor_handles_[i], nullptr); ASSERT_EQ(err, AMDSMI_STATUS_INVAL); } } diff --git a/tests/amd_smi_test/functional/frequencies_read_write.cc b/tests/amd_smi_test/functional/frequencies_read_write.cc index 818662683c..af7b3cb36b 100755 --- a/tests/amd_smi_test/functional/frequencies_read_write.cc +++ b/tests/amd_smi_test/functional/frequencies_read_write.cc @@ -102,7 +102,7 @@ void TestFrequenciesReadWrite::Run(void) { } for (uint32_t dv_ind = 0; dv_ind < num_monitor_devs(); ++dv_ind) { - PrintDeviceHeader(device_handles_[dv_ind]); + PrintDeviceHeader(processor_handles_[dv_ind]); for (uint32_t clk = (uint32_t)CLK_TYPE_FIRST; clk <= CLK_TYPE__MAX; ++clk) { @@ -113,7 +113,7 @@ void TestFrequenciesReadWrite::Run(void) { std::cout << amdsmi_clk << std::endl; if (amdsmi_clk == CLK_TYPE_PCIE) return false; - ret = amdsmi_dev_get_gpu_clk_freq(device_handles_[dv_ind], amdsmi_clk, &f); + ret = amdsmi_dev_get_gpu_clk_freq(processor_handles_[dv_ind], amdsmi_clk, &f); std::cout << ret << std::endl; if (ret == AMDSMI_STATUS_NOT_SUPPORTED || @@ -151,7 +151,7 @@ void TestFrequenciesReadWrite::Run(void) { FreqEnumToStr(amdsmi_clk) << " to 0b" << freq_bm_str << " ..." << std::endl; } - ret = amdsmi_dev_set_clk_freq(device_handles_[dv_ind], amdsmi_clk, freq_bitmask); + ret = amdsmi_dev_set_clk_freq(processor_handles_[dv_ind], amdsmi_clk, freq_bitmask); //Certain ASICs does not allow to set particular clocks. If set function for a clock returns //permission error despite root access, manually set ret value to success and return if (ret == AMDSMI_STATUS_NO_PERM && geteuid() == 0) { @@ -166,7 +166,7 @@ void TestFrequenciesReadWrite::Run(void) { return; } CHK_ERR_ASRT(ret) - ret = amdsmi_dev_get_gpu_clk_freq(device_handles_[dv_ind], amdsmi_clk, &f); + ret = amdsmi_dev_get_gpu_clk_freq(processor_handles_[dv_ind], amdsmi_clk, &f); if (ret != AMDSMI_STATUS_SUCCESS) { return; } @@ -175,12 +175,12 @@ void TestFrequenciesReadWrite::Run(void) { std::cout << "Frequency is now index " << f.current << std::endl; std::cout << "Resetting mask to all frequencies." << std::endl; } - ret = amdsmi_dev_set_clk_freq(device_handles_[dv_ind], amdsmi_clk, 0xFFFFFFFF); + ret = amdsmi_dev_set_clk_freq(processor_handles_[dv_ind], amdsmi_clk, 0xFFFFFFFF); if (ret != AMDSMI_STATUS_SUCCESS) { return; } - ret = amdsmi_dev_set_perf_level(device_handles_[dv_ind], AMDSMI_DEV_PERF_LEVEL_AUTO); + ret = amdsmi_dev_set_perf_level(processor_handles_[dv_ind], AMDSMI_DEV_PERF_LEVEL_AUTO); if (ret != AMDSMI_STATUS_SUCCESS) { return; } diff --git a/tests/amd_smi_test/functional/gpu_busy_read.cc b/tests/amd_smi_test/functional/gpu_busy_read.cc index 66dda12b44..2ad6058ba9 100755 --- a/tests/amd_smi_test/functional/gpu_busy_read.cc +++ b/tests/amd_smi_test/functional/gpu_busy_read.cc @@ -97,9 +97,9 @@ void TestGPUBusyRead::Run(void) { for (uint32_t x = 0; x < num_iterations(); ++x) { for (uint32_t i = 0; i < num_monitor_devs(); ++i) { - PrintDeviceHeader(device_handles_[i]); + PrintDeviceHeader(processor_handles_[i]); - err = amdsmi_dev_get_busy_percent(device_handles_[i], &val_ui32); + err = amdsmi_dev_get_busy_percent(processor_handles_[i], &val_ui32); if (err != AMDSMI_STATUS_SUCCESS) { if (err == AMDSMI_STATUS_FILE_ERROR) { IF_VERB(STANDARD) { diff --git a/tests/amd_smi_test/functional/gpu_metrics_read.cc b/tests/amd_smi_test/functional/gpu_metrics_read.cc index 4f81758626..0f485ff910 100644 --- a/tests/amd_smi_test/functional/gpu_metrics_read.cc +++ b/tests/amd_smi_test/functional/gpu_metrics_read.cc @@ -97,13 +97,13 @@ void TestGpuMetricsRead::Run(void) { } for (uint32_t i = 0; i < num_monitor_devs(); ++i) { - PrintDeviceHeader(device_handles_[i]); + PrintDeviceHeader(processor_handles_[i]); IF_VERB(STANDARD) { std::cout << "\t**GPU METRICS:\n"; } amdsmi_gpu_metrics_t smu; - err = amdsmi_dev_get_gpu_metrics_info(device_handles_[i], &smu); + err = amdsmi_dev_get_gpu_metrics_info(processor_handles_[i], &smu); if (err != AMDSMI_STATUS_SUCCESS) { if (err == AMDSMI_STATUS_NOT_SUPPORTED) { IF_VERB(STANDARD) { @@ -188,7 +188,7 @@ void TestGpuMetricsRead::Run(void) { } // Verify api support checking functionality is working - err = amdsmi_dev_get_gpu_metrics_info(device_handles_[i], nullptr); + err = amdsmi_dev_get_gpu_metrics_info(processor_handles_[i], nullptr); ASSERT_EQ(err, AMDSMI_STATUS_INVAL); } } diff --git a/tests/amd_smi_test/functional/hw_topology_read.cc b/tests/amd_smi_test/functional/hw_topology_read.cc index f46c33627d..68204afb7f 100755 --- a/tests/amd_smi_test/functional/hw_topology_read.cc +++ b/tests/amd_smi_test/functional/hw_topology_read.cc @@ -113,7 +113,7 @@ void TestHWTopologyRead::Run(void) { std::vector numa_numbers(num_devices); for (uint32_t dv_ind = 0; dv_ind < num_devices; ++dv_ind) { - amdsmi_processor_handle dev_handle = device_handles_[dv_ind]; + amdsmi_processor_handle dev_handle = processor_handles_[dv_ind]; err = amdsmi_topo_get_numa_node_number(dev_handle, &numa_numbers[dv_ind]); if (err != AMDSMI_STATUS_SUCCESS) { if (err == AMDSMI_STATUS_NOT_SUPPORTED) { @@ -138,8 +138,8 @@ void TestHWTopologyRead::Run(void) { gpu_links[dv_ind_src][dv_ind_dst].accessible = true; } else { AMDSMI_IO_LINK_TYPE type; - err = amdsmi_topo_get_link_type(device_handles_[dv_ind_src], - device_handles_[dv_ind_dst], + err = amdsmi_topo_get_link_type(processor_handles_[dv_ind_src], + processor_handles_[dv_ind_dst], &gpu_links[dv_ind_src][dv_ind_dst].hops, &type); if (err != AMDSMI_STATUS_SUCCESS) { if (err == AMDSMI_STATUS_NOT_SUPPORTED) { @@ -170,8 +170,8 @@ void TestHWTopologyRead::Run(void) { } } } - err = amdsmi_topo_get_link_weight(device_handles_[dv_ind_src], - device_handles_[dv_ind_dst], + err = amdsmi_topo_get_link_weight(processor_handles_[dv_ind_src], + processor_handles_[dv_ind_dst], &gpu_links[dv_ind_src][dv_ind_dst].weight); if (err != AMDSMI_STATUS_SUCCESS) { if (err == AMDSMI_STATUS_NOT_SUPPORTED) { @@ -185,8 +185,8 @@ void TestHWTopologyRead::Run(void) { CHK_ERR_ASRT(err) } } - err = amdsmi_is_P2P_accessible(device_handles_[dv_ind_src], - device_handles_[dv_ind_dst], + err = amdsmi_is_P2P_accessible(processor_handles_[dv_ind_src], + processor_handles_[dv_ind_dst], &gpu_links[dv_ind_src][dv_ind_dst].accessible); if (err != AMDSMI_STATUS_SUCCESS) { if (err == AMDSMI_STATUS_NOT_SUPPORTED) { diff --git a/tests/amd_smi_test/functional/id_info_read.cc b/tests/amd_smi_test/functional/id_info_read.cc index bcdb428324..414d9b3dcd 100755 --- a/tests/amd_smi_test/functional/id_info_read.cc +++ b/tests/amd_smi_test/functional/id_info_read.cc @@ -105,11 +105,11 @@ void TestIdInfoRead::Run(void) { } // Get the device ID, name, vendor ID and vendor name for the device - err = amdsmi_dev_get_id(device_handles_[i], &id); + err = amdsmi_dev_get_id(processor_handles_[i], &id); if (err == AMDSMI_STATUS_NOT_SUPPORTED) { amdsmi_status_t ret; // Verify api support checking functionality is working - ret = amdsmi_dev_get_id(device_handles_[i], nullptr); + ret = amdsmi_dev_get_id(processor_handles_[i], nullptr); ASSERT_EQ(ret, AMDSMI_STATUS_NOT_SUPPORTED); } else { CHK_ERR_ASRT(err) @@ -118,25 +118,25 @@ void TestIdInfoRead::Run(void) { std::cout << "\t**Device ID: 0x" << std::hex << id << std::endl; } // Verify api support checking functionality is working - err = amdsmi_dev_get_id(device_handles_[i], nullptr); + err = amdsmi_dev_get_id(processor_handles_[i], nullptr); ASSERT_EQ(err, AMDSMI_STATUS_INVAL); } // vendor_id, unique_id amdsmi_asic_info_t asci_info; - err = amdsmi_get_asic_info(device_handles_[0], &asci_info); + err = amdsmi_get_asic_info(processor_handles_[0], &asci_info); CHK_ERR_ASRT(err) // device name, brand, serial_number amdsmi_board_info_t board_info; - err = amdsmi_get_board_info(device_handles_[0], &board_info); + err = amdsmi_get_board_info(processor_handles_[0], &board_info); CHK_ERR_ASRT(err) - err = amdsmi_dev_get_vram_vendor(device_handles_[i], buffer, kBufferLen); + err = amdsmi_dev_get_vram_vendor(processor_handles_[i], buffer, kBufferLen); if (err == AMDSMI_STATUS_NOT_SUPPORTED) { std::cout << "\t**Vram Vendor string not supported on this system." << std::endl; - err = amdsmi_dev_get_vram_vendor(device_handles_[i], nullptr, kBufferLen); + err = amdsmi_dev_get_vram_vendor(processor_handles_[i], nullptr, kBufferLen); ASSERT_EQ(err, AMDSMI_STATUS_NOT_SUPPORTED); } else { CHK_ERR_ASRT(err) @@ -145,10 +145,10 @@ void TestIdInfoRead::Run(void) { } } - err = amdsmi_dev_get_drm_render_minor(device_handles_[i], &drm_render_minor); + err = amdsmi_dev_get_drm_render_minor(processor_handles_[i], &drm_render_minor); if (err == AMDSMI_STATUS_NOT_SUPPORTED) { // Verify api support checking functionality is working - err = amdsmi_dev_get_drm_render_minor(device_handles_[i], nullptr); + err = amdsmi_dev_get_drm_render_minor(processor_handles_[i], nullptr); ASSERT_EQ(err, AMDSMI_STATUS_NOT_SUPPORTED); } else { CHK_ERR_ASRT(err) @@ -156,15 +156,15 @@ void TestIdInfoRead::Run(void) { std::cout << "\t**DRM Render Minor: " << drm_render_minor << std::endl; } // Verify api support checking functionality is working - err = amdsmi_dev_get_drm_render_minor(device_handles_[i], nullptr); + err = amdsmi_dev_get_drm_render_minor(processor_handles_[i], nullptr); ASSERT_EQ(err, AMDSMI_STATUS_INVAL); } - err = amdsmi_dev_get_vendor_name(device_handles_[i], buffer, kBufferLen); + err = amdsmi_dev_get_vendor_name(processor_handles_[i], buffer, kBufferLen); if (err == AMDSMI_STATUS_NOT_SUPPORTED) { std::cout << "\t**Device Vendor name string not found on this system." << std::endl; // Verify api support checking functionality is working - err = amdsmi_dev_get_vendor_name(device_handles_[i], nullptr, kBufferLen); + err = amdsmi_dev_get_vendor_name(processor_handles_[i], nullptr, kBufferLen); ASSERT_EQ(err, AMDSMI_STATUS_NOT_SUPPORTED); } else { CHK_ERR_ASRT(err) @@ -172,15 +172,15 @@ void TestIdInfoRead::Run(void) { std::cout << "\t**Device Vendor name: " << buffer << std::endl; } // Verify api support checking functionality is working - err = amdsmi_dev_get_vendor_name(device_handles_[i], nullptr, kBufferLen); + err = amdsmi_dev_get_vendor_name(processor_handles_[i], nullptr, kBufferLen); ASSERT_EQ(err, AMDSMI_STATUS_INVAL); } // Get the device ID, name, vendor ID and vendor name for the sub-device - err = amdsmi_dev_get_subsystem_id(device_handles_[i], &id); + err = amdsmi_dev_get_subsystem_id(processor_handles_[i], &id); if (err == AMDSMI_STATUS_NOT_SUPPORTED) { // Verify api support checking functionality is working - err = amdsmi_dev_get_subsystem_id(device_handles_[i], nullptr); + err = amdsmi_dev_get_subsystem_id(processor_handles_[i], nullptr); ASSERT_EQ(err, AMDSMI_STATUS_NOT_SUPPORTED); } else { CHK_ERR_ASRT(err) @@ -188,15 +188,15 @@ void TestIdInfoRead::Run(void) { std::cout << "\t**Subsystem ID: 0x" << std::hex << id << std::endl; } // Verify api support checking functionality is working - err = amdsmi_dev_get_subsystem_id(device_handles_[i], nullptr); + err = amdsmi_dev_get_subsystem_id(processor_handles_[i], nullptr); ASSERT_EQ(err, AMDSMI_STATUS_INVAL); } - err = amdsmi_dev_get_subsystem_name(device_handles_[i], buffer, kBufferLen); + err = amdsmi_dev_get_subsystem_name(processor_handles_[i], buffer, kBufferLen); if (err == AMDSMI_STATUS_NOT_SUPPORTED) { std::cout << "\t**Subsystem name string not found on this system." << std::endl; // Verify api support checking functionality is working - err = amdsmi_dev_get_subsystem_name(device_handles_[i], nullptr, kBufferLen); + err = amdsmi_dev_get_subsystem_name(processor_handles_[i], nullptr, kBufferLen); ASSERT_EQ(err, AMDSMI_STATUS_NOT_SUPPORTED); } else { CHK_ERR_ASRT(err) @@ -204,7 +204,7 @@ void TestIdInfoRead::Run(void) { std::cout << "\t**Subsystem name: " << buffer << std::endl; } // Verify api support checking functionality is working - err = amdsmi_dev_get_subsystem_name(device_handles_[i], nullptr, kBufferLen); + err = amdsmi_dev_get_subsystem_name(processor_handles_[i], nullptr, kBufferLen); ASSERT_EQ(err, AMDSMI_STATUS_INVAL); } @@ -213,13 +213,13 @@ void TestIdInfoRead::Run(void) { asci_info.subvendor_id << std::endl; } - err = amdsmi_dev_get_vendor_name(device_handles_[i], buffer, kBufferLen); + err = amdsmi_dev_get_vendor_name(processor_handles_[i], buffer, kBufferLen); if (err == AMDSMI_STATUS_NOT_SUPPORTED) { std::cout << "\t**Subsystem Vendor name string not found on this system." << std::endl; // Verify api support checking functionality is working - err = amdsmi_dev_get_vendor_name(device_handles_[i], nullptr, kBufferLen); + err = amdsmi_dev_get_vendor_name(processor_handles_[i], nullptr, kBufferLen); ASSERT_EQ(err, AMDSMI_STATUS_NOT_SUPPORTED); } else { CHK_ERR_ASRT(err) @@ -227,11 +227,11 @@ void TestIdInfoRead::Run(void) { std::cout << "\t**Subsystem Vendor name: " << buffer << std::endl; } // Verify api support checking functionality is working - err = amdsmi_dev_get_vendor_name(device_handles_[i], nullptr, kBufferLen); + err = amdsmi_dev_get_vendor_name(processor_handles_[i], nullptr, kBufferLen); ASSERT_EQ(err, AMDSMI_STATUS_INVAL); } - err = amdsmi_dev_get_pci_id(device_handles_[i], &val_ui64); + err = amdsmi_dev_get_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(device_handles_[i], nullptr); + err = amdsmi_dev_get_pci_id(processor_handles_[i], nullptr); ASSERT_EQ(err, AMDSMI_STATUS_INVAL); } } diff --git a/tests/amd_smi_test/functional/mem_page_info_read.cc b/tests/amd_smi_test/functional/mem_page_info_read.cc index c662726722..7a9f5d9626 100755 --- a/tests/amd_smi_test/functional/mem_page_info_read.cc +++ b/tests/amd_smi_test/functional/mem_page_info_read.cc @@ -94,9 +94,9 @@ void TestMemPageInfoRead::Run(void) { } for (uint32_t i = 0; i < num_monitor_devs(); ++i) { - PrintDeviceHeader(device_handles_[i]); + PrintDeviceHeader(processor_handles_[i]); - err = amdsmi_dev_get_memory_reserved_pages(device_handles_[i], &num_pages, nullptr); + err = amdsmi_dev_get_memory_reserved_pages(processor_handles_[i], &num_pages, nullptr); if (err == AMDSMI_STATUS_NOT_SUPPORTED) { std::cout << @@ -104,7 +104,7 @@ void TestMemPageInfoRead::Run(void) { << std::endl; // Verify api support checking functionality is working - err = amdsmi_dev_get_memory_reserved_pages(device_handles_[i], nullptr, nullptr); + err = amdsmi_dev_get_memory_reserved_pages(processor_handles_[i], nullptr, nullptr); ASSERT_EQ(err, AMDSMI_STATUS_NOT_SUPPORTED); continue; @@ -115,7 +115,7 @@ void TestMemPageInfoRead::Run(void) { std::endl; } // Verify api support checking functionality is working - err = amdsmi_dev_get_memory_reserved_pages(device_handles_[i], nullptr, nullptr); + err = amdsmi_dev_get_memory_reserved_pages(processor_handles_[i], nullptr, nullptr); ASSERT_EQ(err, AMDSMI_STATUS_INVAL); } @@ -124,7 +124,7 @@ void TestMemPageInfoRead::Run(void) { assert(records != nullptr); - err = amdsmi_dev_get_memory_reserved_pages(device_handles_[i], &num_pages, records); + err = amdsmi_dev_get_memory_reserved_pages(processor_handles_[i], &num_pages, records); if (err == AMDSMI_STATUS_NOT_SUPPORTED) { std::cout << "\t**Getting Memory Page Retirement Status not " "supported for this device" << std::endl; diff --git a/tests/amd_smi_test/functional/mem_util_read.cc b/tests/amd_smi_test/functional/mem_util_read.cc index f9a1bac7d1..3f12b77c94 100755 --- a/tests/amd_smi_test/functional/mem_util_read.cc +++ b/tests/amd_smi_test/functional/mem_util_read.cc @@ -116,7 +116,7 @@ void TestMemUtilRead::Run(void) { for (uint32_t x = 0; x < num_iterations(); ++x) { for (uint32_t i = 0; i < num_monitor_devs(); ++i) { - PrintDeviceHeader(device_handles_[i]); + PrintDeviceHeader(processor_handles_[i]); #if 0 err = amdsmi_dev_get_memory_busy_percent(i, &mem_busy_percent); @@ -131,14 +131,14 @@ void TestMemUtilRead::Run(void) { #endif for (uint32_t mem_type = AMDSMI_MEM_TYPE_FIRST; mem_type <= AMDSMI_MEM_TYPE_LAST; ++mem_type) { - err = amdsmi_dev_get_memory_total(device_handles_[i], + err = amdsmi_dev_get_memory_total(processor_handles_[i], static_cast(mem_type), &total); err_chk("amdsmi_dev_get_memory_total()"); if (err != AMDSMI_STATUS_SUCCESS) { return; } - err = amdsmi_dev_get_memory_usage(device_handles_[i], + err = amdsmi_dev_get_memory_usage(processor_handles_[i], static_cast(mem_type), &usage); err_chk("amdsmi_dev_get_memory_usage()"); if (err != AMDSMI_STATUS_SUCCESS) { diff --git a/tests/amd_smi_test/functional/metrics_counter_read.cc b/tests/amd_smi_test/functional/metrics_counter_read.cc index 0bb6cf4510..657bb30137 100644 --- a/tests/amd_smi_test/functional/metrics_counter_read.cc +++ b/tests/amd_smi_test/functional/metrics_counter_read.cc @@ -97,7 +97,7 @@ void TestMetricsCounterRead::Run(void) { } for (uint32_t i = 0; i < num_monitor_devs(); ++i) { - PrintDeviceHeader(device_handles_[i]); + PrintDeviceHeader(processor_handles_[i]); IF_VERB(STANDARD) { std::cout << "\t**GPU METRICS ENERGY COUNTER:\n"; @@ -106,7 +106,7 @@ void TestMetricsCounterRead::Run(void) { uint64_t power; uint64_t timestamp; float counter_resolution; - err = amdsmi_dev_get_energy_count(device_handles_[i], &power, &counter_resolution, ×tamp); + err = amdsmi_dev_get_energy_count(processor_handles_[i], &power, &counter_resolution, ×tamp); if (err != AMDSMI_STATUS_SUCCESS) { if (err == AMDSMI_STATUS_NOT_SUPPORTED) { IF_VERB(STANDARD) { @@ -128,14 +128,14 @@ void TestMetricsCounterRead::Run(void) { } // Verify api support checking functionality is working - err = amdsmi_dev_get_energy_count(device_handles_[i], nullptr, nullptr, nullptr); + err = amdsmi_dev_get_energy_count(processor_handles_[i], nullptr, nullptr, nullptr); ASSERT_EQ(err, AMDSMI_STATUS_INVAL); // Coarse Grain counters amdsmi_utilization_counter_t utilization_counters[2]; utilization_counters[0].type = AMDSMI_COARSE_GRAIN_GFX_ACTIVITY; utilization_counters[1].type = AMDSMI_COARSE_GRAIN_MEM_ACTIVITY; - err = amdsmi_get_utilization_count(device_handles_[i], utilization_counters, + err = amdsmi_get_utilization_count(processor_handles_[i], utilization_counters, 2, ×tamp); if (err != AMDSMI_STATUS_SUCCESS) { if (err == AMDSMI_STATUS_NOT_SUPPORTED) { @@ -158,7 +158,7 @@ void TestMetricsCounterRead::Run(void) { } // Verify api support checking functionality is working - err = amdsmi_get_utilization_count(device_handles_[i], nullptr, + err = amdsmi_get_utilization_count(processor_handles_[i], nullptr, 1 , nullptr); ASSERT_EQ(err, AMDSMI_STATUS_INVAL); } // end for diff --git a/tests/amd_smi_test/functional/mutual_exclusion.cc b/tests/amd_smi_test/functional/mutual_exclusion.cc index 0f5b92f81b..20df77b272 100755 --- a/tests/amd_smi_test/functional/mutual_exclusion.cc +++ b/tests/amd_smi_test/functional/mutual_exclusion.cc @@ -197,63 +197,63 @@ void TestMutualExclusion::Run(void) { std::cout << "at " << __FILE__ << ":" << __LINE__ << std::endl; \ } \ } - ret = amdsmi_dev_get_id(device_handles_[0], &dmy_ui16); + ret = amdsmi_dev_get_id(processor_handles_[0], &dmy_ui16); // vendor_id, unique_id amdsmi_asic_info_t asci_info; - ret = amdsmi_get_asic_info(device_handles_[0], &asci_info); + ret = amdsmi_get_asic_info(processor_handles_[0], &asci_info); CHECK_RET(ret, AMDSMI_STATUS_BUSY); // device name, brand, serial_number amdsmi_board_info_t board_info; - ret = amdsmi_get_board_info(device_handles_[0], &board_info); + ret = amdsmi_get_board_info(processor_handles_[0], &board_info); CHECK_RET(ret, AMDSMI_STATUS_BUSY); - ret = amdsmi_dev_get_vendor_name(device_handles_[0], dmy_str, 10); + ret = amdsmi_dev_get_vendor_name(processor_handles_[0], dmy_str, 10); CHECK_RET(ret, AMDSMI_STATUS_BUSY); - ret = amdsmi_dev_get_vram_vendor(device_handles_[0], dmy_str, 10); + ret = amdsmi_dev_get_vram_vendor(processor_handles_[0], dmy_str, 10); CHECK_RET(ret, AMDSMI_STATUS_BUSY); - ret = amdsmi_dev_get_subsystem_id(device_handles_[0], &dmy_ui16); + ret = amdsmi_dev_get_subsystem_id(processor_handles_[0], &dmy_ui16); CHECK_RET(ret, AMDSMI_STATUS_BUSY); - ret = amdsmi_dev_get_pci_id(device_handles_[0], &dmy_ui64); + ret = amdsmi_dev_get_pci_id(processor_handles_[0], &dmy_ui64); CHECK_RET(ret, AMDSMI_STATUS_BUSY); - ret = amdsmi_dev_get_pci_throughput(device_handles_[0], &dmy_ui64, &dmy_ui64, &dmy_ui64); + ret = amdsmi_dev_get_pci_throughput(processor_handles_[0], &dmy_ui64, &dmy_ui64, &dmy_ui64); CHECK_RET(ret, AMDSMI_STATUS_BUSY); - ret = amdsmi_dev_get_pci_replay_counter(device_handles_[0], &dmy_ui64); + ret = amdsmi_dev_get_pci_replay_counter(processor_handles_[0], &dmy_ui64); CHECK_RET(ret, AMDSMI_STATUS_BUSY); - ret = amdsmi_dev_set_pci_bandwidth(device_handles_[0], 0); + ret = amdsmi_dev_set_pci_bandwidth(processor_handles_[0], 0); CHECK_RET(ret, AMDSMI_STATUS_BUSY); - ret = amdsmi_dev_get_fan_rpms(device_handles_[0], dmy_ui32, &dmy_i64); + ret = amdsmi_dev_get_fan_rpms(processor_handles_[0], dmy_ui32, &dmy_i64); CHECK_RET(ret, AMDSMI_STATUS_BUSY); - ret = amdsmi_dev_get_fan_speed(device_handles_[0], 0, &dmy_i64); + ret = amdsmi_dev_get_fan_speed(processor_handles_[0], 0, &dmy_i64); CHECK_RET(ret, AMDSMI_STATUS_BUSY); - ret = amdsmi_dev_get_fan_speed_max(device_handles_[0], 0, &dmy_ui64); + ret = amdsmi_dev_get_fan_speed_max(processor_handles_[0], 0, &dmy_ui64); CHECK_RET(ret, AMDSMI_STATUS_BUSY); - ret = amdsmi_dev_get_temp_metric(device_handles_[0], TEMPERATURE_TYPE_EDGE, AMDSMI_TEMP_CURRENT, &dmy_i64); + ret = amdsmi_dev_get_temp_metric(processor_handles_[0], TEMPERATURE_TYPE_EDGE, AMDSMI_TEMP_CURRENT, &dmy_i64); CHECK_RET(ret, AMDSMI_STATUS_BUSY); - ret = amdsmi_dev_reset_fan(device_handles_[0], 0); + ret = amdsmi_dev_reset_fan(processor_handles_[0], 0); CHECK_RET(ret, AMDSMI_STATUS_BUSY); - ret = amdsmi_dev_set_fan_speed(device_handles_[0], dmy_ui32, 0); + ret = amdsmi_dev_set_fan_speed(processor_handles_[0], dmy_ui32, 0); CHECK_RET(ret, AMDSMI_STATUS_BUSY); - ret = amdsmi_dev_get_perf_level(device_handles_[0], &dmy_perf_lvl); + ret = amdsmi_dev_get_perf_level(processor_handles_[0], &dmy_perf_lvl); CHECK_RET(ret, AMDSMI_STATUS_BUSY); - ret = amdsmi_dev_get_overdrive_level(device_handles_[0], &dmy_ui32); + ret = amdsmi_dev_get_overdrive_level(processor_handles_[0], &dmy_ui32); CHECK_RET(ret, AMDSMI_STATUS_BUSY); - ret = amdsmi_dev_get_gpu_clk_freq(device_handles_[0], CLK_TYPE_SYS, &dmy_freqs); + ret = amdsmi_dev_get_gpu_clk_freq(processor_handles_[0], CLK_TYPE_SYS, &dmy_freqs); CHECK_RET(ret, AMDSMI_STATUS_BUSY); - ret = amdsmi_dev_get_od_volt_info(device_handles_[0], &dmy_od_volt); + ret = amdsmi_dev_get_od_volt_info(processor_handles_[0], &dmy_od_volt); CHECK_RET(ret, AMDSMI_STATUS_BUSY); - ret = amdsmi_dev_get_od_volt_curve_regions(device_handles_[0], &dmy_ui32, &dmy_vlt_reg); + ret = amdsmi_dev_get_od_volt_curve_regions(processor_handles_[0], &dmy_ui32, &dmy_vlt_reg); CHECK_RET(ret, AMDSMI_STATUS_BUSY); - ret = amdsmi_dev_set_overdrive_level_v1(device_handles_[0], dmy_i32); + ret = amdsmi_dev_set_overdrive_level_v1(processor_handles_[0], dmy_i32); CHECK_RET(ret, AMDSMI_STATUS_BUSY); - ret = amdsmi_dev_set_clk_freq(device_handles_[0], CLK_TYPE_SYS, 0); + ret = amdsmi_dev_set_clk_freq(processor_handles_[0], CLK_TYPE_SYS, 0); CHECK_RET(ret, AMDSMI_STATUS_BUSY); - ret = amdsmi_dev_get_ecc_count(device_handles_[0], AMDSMI_GPU_BLOCK_UMC, &dmy_err_cnt); + ret = amdsmi_dev_get_ecc_count(processor_handles_[0], AMDSMI_GPU_BLOCK_UMC, &dmy_err_cnt); CHECK_RET(ret, AMDSMI_STATUS_BUSY); - ret = amdsmi_dev_get_ecc_enabled(device_handles_[0], &dmy_ui64); + ret = amdsmi_dev_get_ecc_enabled(processor_handles_[0], &dmy_ui64); CHECK_RET(ret, AMDSMI_STATUS_BUSY); - ret = amdsmi_dev_get_ecc_status(device_handles_[0], AMDSMI_GPU_BLOCK_UMC, &dmy_ras_err_st); + ret = amdsmi_dev_get_ecc_status(processor_handles_[0], AMDSMI_GPU_BLOCK_UMC, &dmy_ras_err_st); CHECK_RET(ret, AMDSMI_STATUS_BUSY); /* Other functions holding device mutexes. Listed for reference. diff --git a/tests/amd_smi_test/functional/overdrive_read.cc b/tests/amd_smi_test/functional/overdrive_read.cc index 025e919a37..2aa7e45e39 100755 --- a/tests/amd_smi_test/functional/overdrive_read.cc +++ b/tests/amd_smi_test/functional/overdrive_read.cc @@ -96,14 +96,14 @@ void TestOverdriveRead::Run(void) { } for (uint32_t i = 0; i < num_monitor_devs(); ++i) { - PrintDeviceHeader(device_handles_[i]); + PrintDeviceHeader(processor_handles_[i]); - err = amdsmi_dev_get_overdrive_level(device_handles_[i], &val_ui32); + err = amdsmi_dev_get_overdrive_level(processor_handles_[i], &val_ui32); CHK_ERR_ASRT(err) IF_VERB(STANDARD) { std::cout << "\t**OverDrive Level:" << val_ui32 << std::endl; // Verify api support checking functionality is working - err = amdsmi_dev_get_overdrive_level(device_handles_[i], nullptr); + err = amdsmi_dev_get_overdrive_level(processor_handles_[i], nullptr); ASSERT_EQ(err, AMDSMI_STATUS_INVAL); } } diff --git a/tests/amd_smi_test/functional/overdrive_read_write.cc b/tests/amd_smi_test/functional/overdrive_read_write.cc index 030ece5e55..08f700ec2a 100755 --- a/tests/amd_smi_test/functional/overdrive_read_write.cc +++ b/tests/amd_smi_test/functional/overdrive_read_write.cc @@ -95,27 +95,27 @@ void TestOverdriveReadWrite::Run(void) { } for (uint32_t dv_ind = 0; dv_ind < num_monitor_devs(); ++dv_ind) { - PrintDeviceHeader(device_handles_[dv_ind]); + PrintDeviceHeader(processor_handles_[dv_ind]); IF_VERB(STANDARD) { std::cout << "Set Overdrive level to 0%..." << std::endl; } - ret = amdsmi_dev_set_overdrive_level(device_handles_[dv_ind], 0); + ret = amdsmi_dev_set_overdrive_level(processor_handles_[dv_ind], 0); CHK_ERR_ASRT(ret) IF_VERB(STANDARD) { std::cout << "Set Overdrive level to 10%..." << std::endl; } - ret = amdsmi_dev_set_overdrive_level(device_handles_[dv_ind], 10); + ret = amdsmi_dev_set_overdrive_level(processor_handles_[dv_ind], 10); CHK_ERR_ASRT(ret) - ret = amdsmi_dev_get_overdrive_level(device_handles_[dv_ind], &val); + ret = amdsmi_dev_get_overdrive_level(processor_handles_[dv_ind], &val); CHK_ERR_ASRT(ret) IF_VERB(STANDARD) { std::cout << "\t**New OverDrive Level:" << val << std::endl; std::cout << "Reset Overdrive level to 0%..." << std::endl; } - ret = amdsmi_dev_set_overdrive_level(device_handles_[dv_ind], 0); + ret = amdsmi_dev_set_overdrive_level(processor_handles_[dv_ind], 0); CHK_ERR_ASRT(ret) - ret = amdsmi_dev_get_overdrive_level(device_handles_[dv_ind], &val); + ret = amdsmi_dev_get_overdrive_level(processor_handles_[dv_ind], &val); CHK_ERR_ASRT(ret) IF_VERB(STANDARD) { std::cout << "\t**New OverDrive Level:" << val << std::endl; diff --git a/tests/amd_smi_test/functional/pci_read_write.cc b/tests/amd_smi_test/functional/pci_read_write.cc index e0e5ec663d..2811e1777e 100755 --- a/tests/amd_smi_test/functional/pci_read_write.cc +++ b/tests/amd_smi_test/functional/pci_read_write.cc @@ -98,9 +98,9 @@ void TestPciReadWrite::Run(void) { } for (uint32_t dv_ind = 0; dv_ind < num_monitor_devs(); ++dv_ind) { - PrintDeviceHeader(device_handles_[dv_ind]); + PrintDeviceHeader(processor_handles_[dv_ind]); - ret = amdsmi_dev_get_pci_replay_counter(device_handles_[dv_ind], &u64int); + ret = amdsmi_dev_get_pci_replay_counter(processor_handles_[dv_ind], &u64int); if (ret == AMDSMI_STATUS_NOT_SUPPORTED) { std::cout << @@ -108,7 +108,7 @@ void TestPciReadWrite::Run(void) { " on this machine" << std::endl; // Verify api support checking functionality is working - ret = amdsmi_dev_get_pci_replay_counter(device_handles_[dv_ind], nullptr); + ret = amdsmi_dev_get_pci_replay_counter(processor_handles_[dv_ind], nullptr); ASSERT_EQ(ret, AMDSMI_STATUS_NOT_SUPPORTED); } else { CHK_ERR_ASRT(ret) @@ -116,11 +116,11 @@ void TestPciReadWrite::Run(void) { std::cout << "\tPCIe Replay Counter: " << u64int << std::endl; } // Verify api support checking functionality is working - ret = amdsmi_dev_get_pci_replay_counter(device_handles_[dv_ind], nullptr); + ret = amdsmi_dev_get_pci_replay_counter(processor_handles_[dv_ind], nullptr); ASSERT_EQ(ret, AMDSMI_STATUS_INVAL); } - ret = amdsmi_dev_get_pci_throughput(device_handles_[dv_ind], &sent, &received, &max_pkt_sz); + ret = amdsmi_dev_get_pci_throughput(processor_handles_[dv_ind], &sent, &received, &max_pkt_sz); if (ret == AMDSMI_STATUS_NOT_SUPPORTED) { std::cout << "TEST FAILURE: Current PCIe throughput is not detected. " "This is likely because it is not indicated in the pcie_bw sysfs " @@ -141,14 +141,14 @@ void TestPciReadWrite::Run(void) { std::cout << std::endl; } - ret = amdsmi_dev_get_pci_bandwidth(device_handles_[dv_ind], &bw); + ret = amdsmi_dev_get_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(device_handles_[dv_ind], nullptr); + ret = amdsmi_dev_get_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(device_handles_[dv_ind], nullptr); + ret = amdsmi_dev_get_pci_bandwidth(processor_handles_[dv_ind], nullptr); ASSERT_EQ(ret, AMDSMI_STATUS_INVAL); // First set the bitmask to all supported bandwidths @@ -182,10 +182,10 @@ void TestPciReadWrite::Run(void) { std::cout << "\tSetting bandwidth mask to " << "0b" << freq_bm_str << " ..." << std::endl; } - ret = amdsmi_dev_set_pci_bandwidth(device_handles_[dv_ind], freq_bitmask); + ret = amdsmi_dev_set_pci_bandwidth(processor_handles_[dv_ind], freq_bitmask); CHK_ERR_ASRT(ret) - ret = amdsmi_dev_get_pci_bandwidth(device_handles_[dv_ind], &bw); + ret = amdsmi_dev_get_pci_bandwidth(processor_handles_[dv_ind], &bw); CHK_ERR_ASRT(ret) IF_VERB(STANDARD) { @@ -193,10 +193,10 @@ void TestPciReadWrite::Run(void) { std::endl; std::cout << "\tResetting mask to all bandwidths." << std::endl; } - ret = amdsmi_dev_set_pci_bandwidth(device_handles_[dv_ind], 0xFFFFFFFF); + ret = amdsmi_dev_set_pci_bandwidth(processor_handles_[dv_ind], 0xFFFFFFFF); CHK_ERR_ASRT(ret) - ret = amdsmi_dev_set_perf_level(device_handles_[dv_ind], AMDSMI_DEV_PERF_LEVEL_AUTO); + ret = amdsmi_dev_set_perf_level(processor_handles_[dv_ind], AMDSMI_DEV_PERF_LEVEL_AUTO); CHK_ERR_ASRT(ret) } } diff --git a/tests/amd_smi_test/functional/perf_cntr_read_write.cc b/tests/amd_smi_test/functional/perf_cntr_read_write.cc index a37ff24027..ca27023d67 100755 --- a/tests/amd_smi_test/functional/perf_cntr_read_write.cc +++ b/tests/amd_smi_test/functional/perf_cntr_read_write.cc @@ -352,7 +352,7 @@ void TestPerfCntrReadWrite::Run(void) { } for (uint32_t dv_ind = 0; dv_ind < num_monitor_devs(); ++dv_ind) { - amdsmi_processor_handle dev_handle = device_handles_[dv_ind]; + amdsmi_processor_handle dev_handle = processor_handles_[dv_ind]; PrintDeviceHeader(dev_handle); try { testEventsIndividually(dev_handle); diff --git a/tests/amd_smi_test/functional/perf_determinism.cc b/tests/amd_smi_test/functional/perf_determinism.cc index c931b61308..77c45ae5ca 100644 --- a/tests/amd_smi_test/functional/perf_determinism.cc +++ b/tests/amd_smi_test/functional/perf_determinism.cc @@ -102,8 +102,8 @@ void TestPerfDeterminism::Run(void) { } for (uint32_t i = 0; i < num_monitor_devs(); ++i) { - PrintDeviceHeader(device_handles_[i]); - err = amdsmi_dev_get_od_volt_info(device_handles_[i], &odv); + PrintDeviceHeader(processor_handles_[i]); + err = amdsmi_dev_get_od_volt_info(processor_handles_[i], &odv); if (err == AMDSMI_STATUS_NOT_SUPPORTED) { IF_VERB(STANDARD) { std::cout << "\t** Not supported on this machine" << std::endl; @@ -114,14 +114,14 @@ void TestPerfDeterminism::Run(void) { clkvalue = (odv.curr_sclk_range.lower_bound/1000000) + 50; } - err = amdsmi_set_perf_determinism_mode(device_handles_[i], clkvalue); + err = amdsmi_set_perf_determinism_mode(processor_handles_[i], clkvalue); if (err == AMDSMI_STATUS_NOT_SUPPORTED) { IF_VERB(STANDARD) { std::cout << "\t**Not supported on this machine" << std::endl; } return; } else { - ret = amdsmi_dev_get_perf_level(device_handles_[i], &pfl); + ret = amdsmi_dev_get_perf_level(processor_handles_[i], &pfl); CHK_ERR_ASRT(ret) IF_VERB(STANDARD) { std::cout << "\t**New Perf Level:" << GetPerfLevelStr(pfl) << @@ -130,9 +130,9 @@ void TestPerfDeterminism::Run(void) { } std::cout << "\t**Resetting performance determinism" << std::endl; - err = amdsmi_dev_set_perf_level(device_handles_[i], AMDSMI_DEV_PERF_LEVEL_AUTO);; + err = amdsmi_dev_set_perf_level(processor_handles_[i], AMDSMI_DEV_PERF_LEVEL_AUTO);; CHK_ERR_ASRT(err) - ret = amdsmi_dev_get_perf_level(device_handles_[i], &pfl); + ret = amdsmi_dev_get_perf_level(processor_handles_[i], &pfl); CHK_ERR_ASRT(ret) IF_VERB(STANDARD) { std::cout << "\t**New Perf Level:" << GetPerfLevelStr(pfl) << diff --git a/tests/amd_smi_test/functional/perf_level_read.cc b/tests/amd_smi_test/functional/perf_level_read.cc index 490dfc8e4c..0b27f421c7 100755 --- a/tests/amd_smi_test/functional/perf_level_read.cc +++ b/tests/amd_smi_test/functional/perf_level_read.cc @@ -96,16 +96,16 @@ void TestPerfLevelRead::Run(void) { } for (uint32_t i = 0; i < num_monitor_devs(); ++i) { - PrintDeviceHeader(device_handles_[i]); + PrintDeviceHeader(processor_handles_[i]); - err = amdsmi_dev_get_perf_level(device_handles_[i], &pfl); + err = amdsmi_dev_get_perf_level(processor_handles_[i], &pfl); CHK_ERR_ASRT(err) IF_VERB(STANDARD) { std::cout << "\t**Performance Level:" << std::dec << (uint32_t)pfl << std::endl; } // Verify api support checking functionality is working - err = amdsmi_dev_get_perf_level(device_handles_[i], nullptr); + err = amdsmi_dev_get_perf_level(processor_handles_[i], nullptr); ASSERT_EQ(err, AMDSMI_STATUS_INVAL); } } diff --git a/tests/amd_smi_test/functional/perf_level_read_write.cc b/tests/amd_smi_test/functional/perf_level_read_write.cc index 16d73191ec..71ff372b89 100755 --- a/tests/amd_smi_test/functional/perf_level_read_write.cc +++ b/tests/amd_smi_test/functional/perf_level_read_write.cc @@ -99,9 +99,9 @@ void TestPerfLevelReadWrite::Run(void) { } for (uint32_t dv_ind = 0; dv_ind < num_monitor_devs(); ++dv_ind) { - PrintDeviceHeader(device_handles_[dv_ind]); + PrintDeviceHeader(processor_handles_[dv_ind]); - ret = amdsmi_dev_get_perf_level(device_handles_[dv_ind], &orig_pfl); + ret = amdsmi_dev_get_perf_level(processor_handles_[dv_ind], &orig_pfl); CHK_ERR_ASRT(ret) IF_VERB(STANDARD) { @@ -120,14 +120,14 @@ void TestPerfLevelReadWrite::Run(void) { GetPerfLevelStr(static_cast(pfl_i)) << " ..." << std::endl; } - ret = amdsmi_dev_set_perf_level(device_handles_[dv_ind], + ret = amdsmi_dev_set_perf_level(processor_handles_[dv_ind], static_cast(pfl_i)); if (ret == AMDSMI_STATUS_NOT_SUPPORTED) { std::cout << "\t**" << GetPerfLevelStr(static_cast(pfl_i)) << " returned AMDSMI_STATUS_NOT_SUPPORTED" << std::endl; } else { CHK_ERR_ASRT(ret) - ret = amdsmi_dev_get_perf_level(device_handles_[dv_ind], &pfl); + ret = amdsmi_dev_get_perf_level(processor_handles_[dv_ind], &pfl); CHK_ERR_ASRT(ret) IF_VERB(STANDARD) { std::cout << "\t**New Perf Level:" << GetPerfLevelStr(pfl) << @@ -139,9 +139,9 @@ void TestPerfLevelReadWrite::Run(void) { std::cout << "Reset Perf level to " << GetPerfLevelStr(orig_pfl) << " ..." << std::endl; } - ret = amdsmi_dev_set_perf_level(device_handles_[dv_ind], orig_pfl); + ret = amdsmi_dev_set_perf_level(processor_handles_[dv_ind], orig_pfl); CHK_ERR_ASRT(ret) - ret = amdsmi_dev_get_perf_level(device_handles_[dv_ind], &pfl); + ret = amdsmi_dev_get_perf_level(processor_handles_[dv_ind], &pfl); CHK_ERR_ASRT(ret) IF_VERB(STANDARD) { diff --git a/tests/amd_smi_test/functional/power_cap_read_write.cc b/tests/amd_smi_test/functional/power_cap_read_write.cc index 9c87cd1b91..f26a736d6a 100755 --- a/tests/amd_smi_test/functional/power_cap_read_write.cc +++ b/tests/amd_smi_test/functional/power_cap_read_write.cc @@ -100,13 +100,13 @@ void TestPowerCapReadWrite::Run(void) { } for (uint32_t dv_ind = 0; dv_ind < num_monitor_devs(); ++dv_ind) { - PrintDeviceHeader(device_handles_[dv_ind]); + PrintDeviceHeader(processor_handles_[dv_ind]); amdsmi_power_cap_info_t info; - ret = amdsmi_get_power_cap_info(device_handles_[dv_ind], 0, &info); + ret = amdsmi_get_power_cap_info(processor_handles_[dv_ind], 0, &info); CHK_ERR_ASRT(ret) // Verify api support checking functionality is working - ret = amdsmi_get_power_cap_info(device_handles_[dv_ind], 0, nullptr); + ret = amdsmi_get_power_cap_info(processor_handles_[dv_ind], 0, nullptr); ASSERT_EQ(ret, AMDSMI_STATUS_INVAL); min = info.min_power_cap; max = info.max_power_cap; @@ -121,13 +121,13 @@ void TestPowerCapReadWrite::Run(void) { std::cout << "Setting new cap to " << new_cap << "..." << std::endl; } start = clock(); - ret = amdsmi_dev_set_power_cap(device_handles_[dv_ind], 0, new_cap); + ret = amdsmi_dev_set_power_cap(processor_handles_[dv_ind], 0, new_cap); end = clock(); cpu_time_used = ((double) (end - start)) * 1000000UL / CLOCKS_PER_SEC; CHK_ERR_ASRT(ret) - ret = amdsmi_get_power_cap_info(device_handles_[dv_ind], 0, &info); + ret = amdsmi_get_power_cap_info(processor_handles_[dv_ind], 0, &info); CHK_ERR_ASRT(ret) new_cap = info.default_power_cap; @@ -139,10 +139,10 @@ void TestPowerCapReadWrite::Run(void) { std::cout << "Resetting cap to " << orig << "..." << std::endl; } - ret = amdsmi_dev_set_power_cap(device_handles_[dv_ind], 0, orig); + ret = amdsmi_dev_set_power_cap(processor_handles_[dv_ind], 0, orig); CHK_ERR_ASRT(ret) - ret = amdsmi_get_power_cap_info(device_handles_[dv_ind], 0, &info); + ret = amdsmi_get_power_cap_info(processor_handles_[dv_ind], 0, &info); CHK_ERR_ASRT(ret) new_cap = info.default_power_cap; diff --git a/tests/amd_smi_test/functional/power_read.cc b/tests/amd_smi_test/functional/power_read.cc index 6d69e708bc..bad4ab6f1f 100755 --- a/tests/amd_smi_test/functional/power_read.cc +++ b/tests/amd_smi_test/functional/power_read.cc @@ -97,10 +97,10 @@ void TestPowerRead::Run(void) { for (uint32_t x = 0; x < num_iterations(); ++x) { for (uint32_t i = 0; i < num_monitor_devs(); ++i) { - PrintDeviceHeader(device_handles_[i]); + PrintDeviceHeader(processor_handles_[i]); amdsmi_power_cap_info_t info; - err = amdsmi_get_power_cap_info(device_handles_[i], 0, &info); + err = amdsmi_get_power_cap_info(processor_handles_[i], 0, &info); CHK_ERR_ASRT(err) IF_VERB(STANDARD) { std::cout << "\t**Current Power Cap: " << info.power_cap << "uW" <(val_ui64)/1000 << " mW" << std::endl; } // Verify api support checking functionality is working - err = amdsmi_dev_get_power_ave(device_handles_[i], 0, nullptr); + err = amdsmi_dev_get_power_ave(processor_handles_[i], 0, nullptr); ASSERT_EQ(err, AMDSMI_STATUS_INVAL); } } diff --git a/tests/amd_smi_test/functional/power_read_write.cc b/tests/amd_smi_test/functional/power_read_write.cc index fa45c9c11f..c6325dedd1 100755 --- a/tests/amd_smi_test/functional/power_read_write.cc +++ b/tests/amd_smi_test/functional/power_read_write.cc @@ -120,9 +120,9 @@ void TestPowerReadWrite::Run(void) { } for (uint32_t dv_ind = 0; dv_ind < num_monitor_devs(); ++dv_ind) { - PrintDeviceHeader(device_handles_[dv_ind]); + PrintDeviceHeader(processor_handles_[dv_ind]); - ret = amdsmi_dev_get_power_profile_presets(device_handles_[dv_ind], 0, &status); + ret = amdsmi_dev_get_power_profile_presets(processor_handles_[dv_ind], 0, &status); if (ret == AMDSMI_STATUS_NOT_SUPPORTED) { std::cout << "The power profile presets settings is not supported. " << std::endl; @@ -131,7 +131,7 @@ void TestPowerReadWrite::Run(void) { CHK_ERR_ASRT(ret) // Verify api support checking functionality is working - ret = amdsmi_dev_get_power_profile_presets(device_handles_[dv_ind], 0, nullptr); + ret = amdsmi_dev_get_power_profile_presets(processor_handles_[dv_ind], 0, nullptr); ASSERT_EQ(ret, AMDSMI_STATUS_INVAL); IF_VERB(STANDARD) { @@ -172,27 +172,27 @@ void TestPowerReadWrite::Run(void) { return; } - ret = amdsmi_dev_set_power_profile(device_handles_[dv_ind], 0, new_prof); + ret = amdsmi_dev_set_power_profile(processor_handles_[dv_ind], 0, new_prof); CHK_ERR_ASRT(ret) amdsmi_dev_perf_level_t pfl; - ret = amdsmi_dev_get_perf_level(device_handles_[dv_ind], &pfl); + ret = amdsmi_dev_get_perf_level(processor_handles_[dv_ind], &pfl); CHK_ERR_ASRT(ret) ASSERT_EQ(pfl, AMDSMI_DEV_PERF_LEVEL_MANUAL); - ret = amdsmi_dev_get_power_profile_presets(device_handles_[dv_ind], 0, &status); + ret = amdsmi_dev_get_power_profile_presets(processor_handles_[dv_ind], 0, &status); CHK_ERR_ASRT(ret) ASSERT_EQ(status.current, new_prof); - ret = amdsmi_dev_set_perf_level(device_handles_[dv_ind], AMDSMI_DEV_PERF_LEVEL_AUTO); + ret = amdsmi_dev_set_perf_level(processor_handles_[dv_ind], AMDSMI_DEV_PERF_LEVEL_AUTO); CHK_ERR_ASRT(ret) - ret = amdsmi_dev_get_perf_level(device_handles_[dv_ind], &pfl); + ret = amdsmi_dev_get_perf_level(processor_handles_[dv_ind], &pfl); CHK_ERR_ASRT(ret) ASSERT_EQ(pfl, AMDSMI_DEV_PERF_LEVEL_AUTO); - ret = amdsmi_dev_get_power_profile_presets(device_handles_[dv_ind], 0, &status); + ret = amdsmi_dev_get_power_profile_presets(processor_handles_[dv_ind], 0, &status); CHK_ERR_ASRT(ret) ASSERT_EQ(status.current, orig_profile); diff --git a/tests/amd_smi_test/functional/sys_info_read.cc b/tests/amd_smi_test/functional/sys_info_read.cc index 3bc9be8c7b..e28422a70a 100755 --- a/tests/amd_smi_test/functional/sys_info_read.cc +++ b/tests/amd_smi_test/functional/sys_info_read.cc @@ -100,10 +100,10 @@ void TestSysInfoRead::Run(void) { } for (uint32_t i = 0; i < num_monitor_devs(); ++i) { - PrintDeviceHeader(device_handles_[i]); + PrintDeviceHeader(processor_handles_[i]); amdsmi_vbios_info_t info; - err = amdsmi_get_vbios_info(device_handles_[i], &info); + err = amdsmi_get_vbios_info(processor_handles_[i], &info); if (err != AMDSMI_STATUS_SUCCESS) { if (err == AMDSMI_STATUS_FILE_ERROR) { @@ -112,11 +112,11 @@ void TestSysInfoRead::Run(void) { << std::endl; } // Verify api support checking functionality is working - err = amdsmi_get_vbios_info(device_handles_[i], nullptr); + err = amdsmi_get_vbios_info(processor_handles_[i], nullptr); ASSERT_EQ(err, AMDSMI_STATUS_NOT_SUPPORTED); } else { // Verify api support checking functionality is working - err = amdsmi_get_vbios_info(device_handles_[i], nullptr); + err = amdsmi_get_vbios_info(processor_handles_[i], nullptr); ASSERT_EQ(err, AMDSMI_STATUS_INVAL); CHK_ERR_ASRT(err) @@ -128,36 +128,36 @@ void TestSysInfoRead::Run(void) { } } - err = amdsmi_dev_get_pci_id(device_handles_[i], &val_ui64); + err = amdsmi_dev_get_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(device_handles_[i], nullptr); + err = amdsmi_dev_get_pci_id(processor_handles_[i], nullptr); ASSERT_EQ(err, AMDSMI_STATUS_INVAL); - err = amdsmi_topo_get_numa_affinity(device_handles_[i], &val_ui32); + err = amdsmi_topo_get_numa_affinity(processor_handles_[i], &val_ui32); CHK_ERR_ASRT(err) IF_VERB(STANDARD) { std::cout << "\t**NUMA NODE: 0x" << std::hex << val_ui32; std::cout << " (" << std::dec << val_ui32 << ")" << std::endl; } // Verify api support checking functionality is working - err = amdsmi_topo_get_numa_affinity(device_handles_[i], nullptr); + err = amdsmi_topo_get_numa_affinity(processor_handles_[i], nullptr); ASSERT_EQ(err, AMDSMI_STATUS_INVAL); // vendor_id, unique_id amdsmi_asic_info_t asci_info; - err = amdsmi_get_asic_info(device_handles_[0], &asci_info); + err = amdsmi_get_asic_info(processor_handles_[0], &asci_info); if (err == AMDSMI_STATUS_NOT_SUPPORTED) { std::cout << "\t**amdsmi_dev_unique_id() is not supported" " on this machine" << std::endl; // Verify api support checking functionality is working - err = amdsmi_get_asic_info(device_handles_[i], nullptr); + err = amdsmi_get_asic_info(processor_handles_[i], nullptr); ASSERT_EQ(err, AMDSMI_STATUS_NOT_SUPPORTED); } else { if (err == AMDSMI_STATUS_SUCCESS) { @@ -169,7 +169,7 @@ void TestSysInfoRead::Run(void) { */ } // Verify api support checking functionality is working - err = amdsmi_get_asic_info(device_handles_[i], nullptr); + err = amdsmi_get_asic_info(processor_handles_[i], nullptr); ASSERT_EQ(err, AMDSMI_STATUS_INVAL); } else { std::cout << "amdsmi_dev_unique_id_get() failed with error " << @@ -190,11 +190,11 @@ void TestSysInfoRead::Run(void) { std::cout << std::setbase(10); amdsmi_fw_info_t fw_info; - err = amdsmi_get_fw_info(device_handles_[i], &fw_info); + err = amdsmi_get_fw_info(processor_handles_[i], &fw_info); if (err == AMDSMI_STATUS_NOT_SUPPORTED) { std::cout << "\t**No FW " << " available on this system" << std::endl; - err = amdsmi_get_fw_info(device_handles_[i], nullptr); + err = amdsmi_get_fw_info(processor_handles_[i], nullptr); ASSERT_EQ(err, AMDSMI_STATUS_NOT_SUPPORTED); } else { CHK_ERR_ASRT(err) diff --git a/tests/amd_smi_test/functional/temp_read.cc b/tests/amd_smi_test/functional/temp_read.cc index 7ddd429c71..de32dc0c54 100755 --- a/tests/amd_smi_test/functional/temp_read.cc +++ b/tests/amd_smi_test/functional/temp_read.cc @@ -110,11 +110,11 @@ void TestTempRead::Run(void) { uint32_t type; for (uint32_t x = 0; x < num_iterations(); ++x) { for (uint32_t i = 0; i < num_monitor_devs(); ++i) { - PrintDeviceHeader(device_handles_[i]); + PrintDeviceHeader(processor_handles_[i]); auto print_temp_metric = [&](amdsmi_temperature_metric_t met, std::string label) { - err = amdsmi_dev_get_temp_metric(device_handles_[i], static_cast(type), met, &val_i64); + err = amdsmi_dev_get_temp_metric(processor_handles_[i], static_cast(type), met, &val_i64); if (err != AMDSMI_STATUS_SUCCESS) { if (err == AMDSMI_STATUS_NOT_SUPPORTED) { @@ -124,7 +124,7 @@ void TestTempRead::Run(void) { } // Verify api support checking functionality is working - err = amdsmi_dev_get_temp_metric(device_handles_[i], static_cast(type), met, nullptr); + err = amdsmi_dev_get_temp_metric(processor_handles_[i], static_cast(type), met, nullptr); ASSERT_EQ(err, AMDSMI_STATUS_INVAL); return; } else { @@ -132,7 +132,7 @@ void TestTempRead::Run(void) { } } // Verify api support checking functionality is working - err = amdsmi_dev_get_temp_metric(device_handles_[i], static_cast(type), met, nullptr); + err = amdsmi_dev_get_temp_metric(processor_handles_[i], static_cast(type), met, nullptr); ASSERT_EQ(err, AMDSMI_STATUS_INVAL); IF_VERB(STANDARD) { diff --git a/tests/amd_smi_test/functional/volt_freq_curv_read.cc b/tests/amd_smi_test/functional/volt_freq_curv_read.cc index a0c18ee7ba..484c9964c7 100755 --- a/tests/amd_smi_test/functional/volt_freq_curv_read.cc +++ b/tests/amd_smi_test/functional/volt_freq_curv_read.cc @@ -155,9 +155,9 @@ void TestVoltCurvRead::Run(void) { } for (uint32_t i = 0; i < num_monitor_devs(); ++i) { - PrintDeviceHeader(device_handles_[i]); + PrintDeviceHeader(processor_handles_[i]); - err = amdsmi_dev_get_od_volt_info(device_handles_[i], &odv); + err = amdsmi_dev_get_od_volt_info(processor_handles_[i], &odv); if (err == AMDSMI_STATUS_NOT_SUPPORTED) { IF_VERB(STANDARD) { std::cout << @@ -165,12 +165,12 @@ void TestVoltCurvRead::Run(void) { << std::endl; } // Verify api support checking functionality is working - err = amdsmi_dev_get_od_volt_info(device_handles_[i], nullptr); + err = amdsmi_dev_get_od_volt_info(processor_handles_[i], nullptr); ASSERT_EQ(err, AMDSMI_STATUS_NOT_SUPPORTED); } else { CHK_ERR_ASRT(err) // Verify api support checking functionality is working - err = amdsmi_dev_get_od_volt_info(device_handles_[i], nullptr); + err = amdsmi_dev_get_od_volt_info(processor_handles_[i], nullptr); ASSERT_EQ(err, AMDSMI_STATUS_INVAL); } @@ -184,7 +184,7 @@ void TestVoltCurvRead::Run(void) { ASSERT_TRUE(regions != nullptr); num_regions = odv.num_regions; - err = amdsmi_dev_get_od_volt_curve_regions(device_handles_[i], &num_regions, regions); + err = amdsmi_dev_get_od_volt_curve_regions(processor_handles_[i], &num_regions, regions); CHK_ERR_ASRT(err) ASSERT_TRUE(num_regions == odv.num_regions); diff --git a/tests/amd_smi_test/functional/volt_read.cc b/tests/amd_smi_test/functional/volt_read.cc index 961115d816..6dc1f507e8 100644 --- a/tests/amd_smi_test/functional/volt_read.cc +++ b/tests/amd_smi_test/functional/volt_read.cc @@ -100,11 +100,11 @@ void TestVoltRead::Run(void) { amdsmi_voltage_type_t type = AMDSMI_VOLT_TYPE_VDDGFX; for (uint32_t i = 0; i < num_monitor_devs(); ++i) { - PrintDeviceHeader(device_handles_[i]); + PrintDeviceHeader(processor_handles_[i]); auto print_volt_metric = [&](amdsmi_voltage_metric_t met, std::string label) { - err = amdsmi_dev_get_volt_metric(device_handles_[i], type, met, &val_i64); + err = amdsmi_dev_get_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(device_handles_[i], type, met, nullptr); + err = amdsmi_dev_get_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(device_handles_[i], type, met, nullptr); + err = amdsmi_dev_get_volt_metric(processor_handles_[i], type, met, nullptr); ASSERT_EQ(err, AMDSMI_STATUS_INVAL); IF_VERB(STANDARD) { diff --git a/tests/amd_smi_test/functional/xgmi_read_write.cc b/tests/amd_smi_test/functional/xgmi_read_write.cc index 2a8f391e35..6312b5e7c2 100755 --- a/tests/amd_smi_test/functional/xgmi_read_write.cc +++ b/tests/amd_smi_test/functional/xgmi_read_write.cc @@ -98,7 +98,7 @@ void TestXGMIReadWrite::Run(void) { } for (uint32_t dv_ind = 0; dv_ind < num_monitor_devs(); ++dv_ind) { - auto device = device_handles_[dv_ind]; + auto device = processor_handles_[dv_ind]; PrintDeviceHeader(device); amdsmi_xgmi_info_t info; diff --git a/tests/amd_smi_test/test_base.cc b/tests/amd_smi_test/test_base.cc index 3b4d93c9fd..7f458c1ff8 100644 --- a/tests/amd_smi_test/test_base.cc +++ b/tests/amd_smi_test/test_base.cc @@ -124,16 +124,16 @@ void TestBase::SetUp(uint64_t init_flags) { for (uint32_t i=0; i < socket_count_; i++) { // Get all devices of the socket uint32_t device_count = 0; - err = amdsmi_get_device_handles(sockets_[i], + err = amdsmi_get_processor_handles(sockets_[i], &device_count, nullptr); if (err != AMDSMI_STATUS_SUCCESS) { setup_failed_ = true; } ASSERT_EQ(err, AMDSMI_STATUS_SUCCESS); - std::vector device_handles(device_count); - err = amdsmi_get_device_handles(sockets_[i], - &device_count, &device_handles[0]); + std::vector processor_handles(device_count); + err = amdsmi_get_processor_handles(sockets_[i], + &device_count, &processor_handles[0]); if (err != AMDSMI_STATUS_SUCCESS) { setup_failed_ = true; } @@ -144,7 +144,7 @@ void TestBase::SetUp(uint64_t init_flags) { setup_failed_ = true; ASSERT_EQ(AMDSMI_STATUS_INPUT_OUT_OF_BOUNDS, AMDSMI_STATUS_SUCCESS); } - device_handles_[num_monitor_devs_] = device_handles[j]; + processor_handles_[num_monitor_devs_] = processor_handles[j]; num_monitor_devs_++; } } diff --git a/tests/amd_smi_test/test_base.h b/tests/amd_smi_test/test_base.h index 935e265239..104e450db4 100644 --- a/tests/amd_smi_test/test_base.h +++ b/tests/amd_smi_test/test_base.h @@ -125,7 +125,7 @@ class TestBase { bool setup_failed_; ///< Record that setup failed to return ierr in Run uint32_t num_monitor_devs_; ///< Number of monitor devices found ///< device handles - amdsmi_processor_handle device_handles_[MAX_MONITOR_DEVICES]; + amdsmi_processor_handle processor_handles_[MAX_MONITOR_DEVICES]; uint32_t socket_count_; ///< socket count std::vector sockets_; ///< sockets