From 1ec3a2182e43768b9b80d434552d7b8acc7dbdc8 Mon Sep 17 00:00:00 2001 From: "Bill(Shuzhou) Liu" Date: Fri, 9 Sep 2022 15:18:08 -0400 Subject: [PATCH] Support rocm-smi related device information A few fields are added to board_info and asic_info for rocm-smi device information. Implement rocm-smi related fw block in amdsmi_get_fw_info(). Change-Id: I825d3e5c7feaa07a6e05386d4f1a59ebf528dfc0 --- amd_smi/docs/amd_smi_doxygen.cfg | 2 + amd_smi/example/amd_smi_example.cc | 14 +- amd_smi/include/amd_smi.h | 306 ++++++++++-------- amd_smi/src/amd_smi.cc | 236 ++++++++++---- .../functional/frequencies_read_write.cc | 7 +- tests/amd_smi_test/functional/id_info_read.cc | 17 +- .../functional/mutual_exclusion.cc | 2 - tests/amd_smi_test/test_base.cc | 22 +- 8 files changed, 390 insertions(+), 216 deletions(-) diff --git a/amd_smi/docs/amd_smi_doxygen.cfg b/amd_smi/docs/amd_smi_doxygen.cfg index d04cae07c3..8d54af8e84 100644 --- a/amd_smi/docs/amd_smi_doxygen.cfg +++ b/amd_smi/docs/amd_smi_doxygen.cfg @@ -2418,3 +2418,5 @@ GENERATE_LEGEND = YES # This tag requires that the tag HAVE_DOT is set to YES. DOT_CLEANUP = YES + +ALIASES += usecase{1}="\xrefitem usecase \"Use cases\" \"Use cases\" \1" diff --git a/amd_smi/example/amd_smi_example.cc b/amd_smi/example/amd_smi_example.cc index bf87edf1ef..8c9e04269e 100644 --- a/amd_smi/example/amd_smi_example.cc +++ b/amd_smi/example/amd_smi_example.cc @@ -76,7 +76,7 @@ int main() { std::cout << "Total Socket: " << socket_count << std::endl; // For each socket, get identifier and devices - for (uint32_t i=0; i < socket_count; i++) { + for (uint32_t i = 0; i < socket_count; i++) { // Get Socket info char socket_name[128]; ret = amdsmi_get_socket_info(sockets[i], socket_name, 128); @@ -87,11 +87,11 @@ int main() { uint32_t device_count = 0; amdsmi_device_handle* device_handles = nullptr; ret = amdsmi_get_device_handles(sockets[i], - &device_count, &device_handles); + &device_count, &device_handles); CHK_AMDSMI_RET(ret) // For each device of the socket, get name and temperature. - for (uint32_t j=0; j < device_count; j++) { + for (uint32_t j = 0; j < device_count; j++) { // Get device type. Since the amdsmi is initialized with // AMDSMI_INIT_AMD_GPUS, the device_type must be AMD_GPU. device_type_t device_type; @@ -103,16 +103,16 @@ int main() { } // Get device name - amdsmi_board_info board_info; + amdsmi_board_info board_info; ret = amdsmi_get_board_info(device_handles[j], &board_info); CHK_AMDSMI_RET(ret) std::cout << "\tdevice " - << j <<"\n\t\tName:" << board_info.product_name << std::endl; + << j << "\n\t\tName:" << board_info.product_name << std::endl; // Get temperature int64_t val_i64 = 0; ret = amdsmi_dev_temp_metric_get(device_handles[j], 0, - AMDSMI_TEMP_CURRENT, &val_i64); + AMDSMI_TEMP_CURRENT, &val_i64); CHK_AMDSMI_RET(ret) std::cout << "\t\tTemperature: " << val_i64/1000 << "C" << std::endl; @@ -121,7 +121,7 @@ int main() { ret = amdsmi_get_vram_usage(device_handles[j], &vram_usage); CHK_AMDSMI_RET(ret) std::cout << "\t\tFrame buffer usage (MB): " << vram_usage.vram_used << "/" - << vram_usage.vram_total << std::endl; + << vram_usage.vram_total << std::endl; // Get Cap info amdsmi_gpu_caps_t caps_info = {}; diff --git a/amd_smi/include/amd_smi.h b/amd_smi/include/amd_smi.h index a9004587c8..c1366a92d7 100644 --- a/amd_smi/include/amd_smi.h +++ b/amd_smi/include/amd_smi.h @@ -228,6 +228,7 @@ typedef enum amdsmi_fw_block { FW_ID_RLC_SRLG, FW_ID_RLC_SRLS, FW_ID_SMC, + FW_ID_DMCU, FW_ID__MAX } amdsmi_fw_block_t; @@ -309,7 +310,7 @@ typedef struct amdsmi_fw_info { uint8_t num_fw_info; struct { amdsmi_fw_block_t fw_id; - uint32_t fw_version; + uint64_t fw_version; } fw_info_list[FW_ID__MAX]; } amdsmi_fw_info_t; @@ -317,10 +318,10 @@ typedef struct amdsmi_asic_info { char market_name[AMDSMI_MAX_STRING_LENGTH]; uint32_t family; /**< Has zero value */ uint32_t vendor_id; //< Use 32 bit to be compatible with other platform. - uint32_t subvendor_id; - uint32_t device_id; + uint32_t subvendor_id; //< The subsystem vendor id + uint64_t device_id; //< The unique id of a GPU uint32_t rev_id; - uint64_t asic_serial; + char asic_serial[AMDSMI_NORMAL_STRING_LENGTH]; } amdsmi_asic_info_t; typedef struct amdsmi_board_info { @@ -1129,11 +1130,17 @@ typedef union amd_id { * @{ */ /** - * @brief Initialize AMD SMI. - * + * @brief Initialize AMD SMI. + * * @details When called, this initializes internal data structures, * including those corresponding to sources of information that SMI provides. * + * The @p init_flags decides which type of device + * can be discovered by ::amdsmi_get_socket_handles(). AMDSMI_INIT_AMD_GPUS returns + * sockets with AMD GPUS, and AMDSMI_INIT_AMD_GPUS | AMDSMI_INIT_AMD_CPUS returns + * sockets with either AMD GPUS or CPUS. + * Currently, only AMDSMI_INIT_AMD_GPUS is supported. + * * @param[in] init_flags Bit flags that tell SMI how to initialze. Values of * ::amdsmi_init_flags_t may be OR'd together and passed through @p init_flags * to modify how AMDSMI initializes. @@ -1153,24 +1160,91 @@ amdsmi_status_t amdsmi_shut_down(void); /*****************************************************************************/ /** @defgroup Discovery Queries - * These functions provide discovery of the sockets. + * These functions provide discovery of the sockets. * @{ */ +/** + * @brief Get the list of socket handles in the system. + * + * @details Depends on what flag is pass to ::amdsmi_init(flags). AMDSMI_INIT_AMD_GPUS + * returns sockets with AMD GPUS, and AMDSMI_INIT_AMD_GPUS | AMDSMI_INIT_AMD_CPUS returns + * sockets with either AMD GPUS or CPUS. + * The socket handles can be used to query the device handles in that socket, which + * will be used in other APIs to get device detail information or telemtries. + * + * @param[out] socket_count The total count of sockets found in the system. + * + * @param[out] socket_handles a list of socket handles in the system. + * + * @retval ::AMDSMI_STATUS_SUCCESS call was successful + * @retval ::AMDSMI_STATUS_INVAL the provided arguments are not valid + * + */ amdsmi_status_t amdsmi_get_socket_handles(uint32_t *socket_count, amdsmi_socket_handle* socket_handles[]); + +/** + * @brief Get the socket information + * + * @details Given a socket handle @p socket_handle, this function will get + * the socket id of the socket. + * + * @param[in] socket_handle a socket handle + * + * @param[out] name The id of the socket. + * + * @param[in] len the length of the caller provided buffer @p name. + * + * @retval ::AMDSMI_STATUS_SUCCESS call was successful + * @retval ::AMDSMI_STATUS_INVAL the provided arguments are not valid + * + */ amdsmi_status_t amdsmi_get_socket_info( amdsmi_socket_handle socket_handle, char *name, size_t len); +/** + * @brief Get the list of the device handles of a socket. + * + * @details Given a socket handle @p socket_handle, this function will get + * the device handles on this socket. One socket may have mulitple different + * type devices: An APU on a socket have both CPUs and GPUs. + * Currently, only AMD GPUs are supported. + * + * @param[in] socket_handle The socket to query + * + * @param[out] device_count The total count of devices on the socket. + * + * @param[out] device_handles a list of devices handles on the socket. + * + * @retval ::AMDSMI_STATUS_SUCCESS call was successful + * @retval ::AMDSMI_STATUS_INVAL the provided arguments are not valid + * + * + */ amdsmi_status_t amdsmi_get_device_handles(amdsmi_socket_handle socket_handle, uint32_t *device_count, amdsmi_device_handle* device_handles[]); +/** + * @brief Get the device type + * + * @details Given a device handle @p device_handle, this function will get + * its device type. + * + * @param[in] device_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 + * ::AMDSMI_STATUS_INVAL. + * + * @retval ::AMDSMI_STATUS_SUCCESS call was successful + * @retval ::AMDSMI_STATUS_INVAL the provided arguments are not valid + * + */ amdsmi_status_t amdsmi_get_device_type(amdsmi_device_handle device_handle, device_type_t* device_type); - - /** @} */ // end of Discovery @@ -1198,14 +1272,14 @@ amdsmi_status_t amdsmi_get_device_type(amdsmi_device_handle device_handle, * @param[inout] id a pointer to uint64_t to which the device id will be * written * If this parameter is nullptr, this function will return - * ::AMDSMI_STATUS_INVALID_ARGS if the function is supported with the provided, + * ::AMDSMI_STATUS_INVAL if the function is supported with the provided, * arguments and ::AMDSMI_STATUS_NOT_SUPPORTED if it is not supported with the * provided arguments. * * @retval ::AMDSMI_STATUS_SUCCESS call was successful * @retval ::AMDSMI_STATUS_NOT_SUPPORTED installed software or hardware does not * support this function with the given arguments - * @retval ::AMDSMI_STATUS_INVALID_ARGS the provided arguments are not valid + * @retval ::AMDSMI_STATUS_INVAL the provided arguments are not valid * */ amdsmi_status_t amdsmi_dev_id_get(amdsmi_device_handle device_handle, uint16_t *id); @@ -1229,7 +1303,7 @@ amdsmi_status_t amdsmi_dev_id_get(amdsmi_device_handle device_handle, uint16_t * * @param[inout] name a pointer to a caller provided char buffer to which the * name will be written * If this parameter is nullptr, this function will return - * ::AMDSMI_STATUS_INVALID_ARGS if the function is supported with the provided, + * ::AMDSMI_STATUS_INVAL if the function is supported with the provided, * arguments and ::AMDSMI_STATUS_NOT_SUPPORTED if it is not supported with the * provided arguments. * @@ -1238,7 +1312,7 @@ amdsmi_status_t amdsmi_dev_id_get(amdsmi_device_handle device_handle, uint16_t * * @retval ::AMDSMI_STATUS_SUCCESS call was successful * @retval ::AMDSMI_STATUS_NOT_SUPPORTED installed software or hardware does not * support this function with the given arguments - * @retval ::AMDSMI_STATUS_INVALID_ARGS the provided arguments are not valid + * @retval ::AMDSMI_STATUS_INVAL the provided arguments are not valid * @retval ::AMDSMI_STATUS_INSUFFICIENT_SIZE is returned if @p len bytes is not * large enough to hold the entire name. In this case, only @p len bytes will * be written. @@ -1285,14 +1359,14 @@ amdsmi_status_t amdsmi_dev_vram_vendor_get(amdsmi_device_handle device_handle, c * @param[inout] id a pointer to uint64_t to which the subsystem device id * will be written * If this parameter is nullptr, this function will return - * ::AMDSMI_STATUS_INVALID_ARGS if the function is supported with the provided, + * ::AMDSMI_STATUS_INVAL if the function is supported with the provided, * arguments and ::AMDSMI_STATUS_NOT_SUPPORTED if it is not supported with the * provided arguments. * * @retval ::AMDSMI_STATUS_SUCCESS call was successful * @retval ::AMDSMI_STATUS_NOT_SUPPORTED installed software or hardware does not * support this function with the given arguments - * @retval ::AMDSMI_STATUS_INVALID_ARGS the provided arguments are not valid + * @retval ::AMDSMI_STATUS_INVAL the provided arguments are not valid * */ amdsmi_status_t amdsmi_dev_subsystem_id_get(amdsmi_device_handle device_handle, uint16_t *id); @@ -1316,7 +1390,7 @@ amdsmi_status_t amdsmi_dev_subsystem_id_get(amdsmi_device_handle device_handle, * @param[inout] name a pointer to a caller provided char buffer to which the * name will be written * If this parameter is nullptr, this function will return - * ::AMDSMI_STATUS_INVALID_ARGS if the function is supported with the provided, + * ::AMDSMI_STATUS_INVAL if the function is supported with the provided, * arguments and ::AMDSMI_STATUS_NOT_SUPPORTED if it is not supported with the * provided arguments. @@ -1325,7 +1399,7 @@ amdsmi_status_t amdsmi_dev_subsystem_id_get(amdsmi_device_handle device_handle, * @retval ::AMDSMI_STATUS_SUCCESS call was successful * @retval ::AMDSMI_STATUS_NOT_SUPPORTED installed software or hardware does not * support this function with the given arguments - * @retval ::AMDSMI_STATUS_INVALID_ARGS the provided arguments are not valid + * @retval ::AMDSMI_STATUS_INVAL the provided arguments are not valid * @retval ::AMDSMI_STATUS_INSUFFICIENT_SIZE is returned if @p len bytes is not * large enough to hold the entire name. In this case, only @p len bytes will * be written. @@ -1348,36 +1422,12 @@ amdsmi_dev_subsystem_name_get(amdsmi_device_handle device_handle, char *name, si * @retval ::AMDSMI_STATUS_SUCCESS is returned upon successful call. * @retval ::AMDSMI_STATUS_INIT_ERROR if failed to get minor number during * initialization. - * @retval ::AMDSMI_STATUS_INVALID_ARGS the provided arguments are not valid + * @retval ::AMDSMI_STATUS_INVAL the provided arguments are not valid * */ amdsmi_status_t amdsmi_dev_drm_render_minor_get(amdsmi_device_handle device_handle, uint32_t *minor); -/** - * @brief Get the device subsystem vendor 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, - * this function will write the device subsystem vendor id value to the - * uint64_t pointed to by @p id. - * - * @param[in] device_handle a device handle - * - * @param[inout] id a pointer to uint64_t to which the device subsystem vendor - * id will be written - * If this parameter is nullptr, this function will return - * ::AMDSMI_STATUS_INVALID_ARGS if the function is supported with the provided, - * arguments and ::AMDSMI_STATUS_NOT_SUPPORTED if it is not supported with the - * provided arguments. - * - * @retval ::AMDSMI_STATUS_SUCCESS call was successful - * @retval ::AMDSMI_STATUS_NOT_SUPPORTED installed software or hardware does not - * support this function with the given arguments - * @retval ::AMDSMI_STATUS_INVALID_ARGS the provided arguments are not valid - */ -amdsmi_status_t amdsmi_dev_subsystem_vendor_id_get(amdsmi_device_handle device_handle, uint16_t *id); - /** @} */ // end of IDQuer /*****************************************************************************/ @@ -1431,14 +1481,14 @@ amdsmi_dev_pci_bandwidth_get(amdsmi_device_handle device_handle, amdsmi_pcie_ban * @param[inout] bdfid a pointer to uint64_t to which the device bdfid value * will be written * If this parameter is nullptr, this function will return - * ::AMDSMI_STATUS_INVALID_ARGS if the function is supported with the provided, + * ::AMDSMI_STATUS_INVAL if the function is supported with the provided, * arguments and ::AMDSMI_STATUS_NOT_SUPPORTED if it is not supported with the * provided arguments. * * @retval ::AMDSMI_STATUS_SUCCESS call was successful * @retval ::AMDSMI_STATUS_NOT_SUPPORTED installed software or hardware does not * support this function with the given arguments - * @retval ::AMDSMI_STATUS_INVALID_ARGS the provided arguments are not valid + * @retval ::AMDSMI_STATUS_INVAL the provided arguments are not valid */ amdsmi_status_t amdsmi_dev_pci_id_get(amdsmi_device_handle device_handle, uint64_t *bdfid); @@ -1455,14 +1505,14 @@ amdsmi_status_t amdsmi_dev_pci_id_get(amdsmi_device_handle device_handle, uint64 * @param[inout] numa_node pointer to location where NUMA node value will * be written. * If this parameter is nullptr, this function will return - * ::AMDSMI_STATUS_INVALID_ARGS if the function is supported with the provided, + * ::AMDSMI_STATUS_INVAL if the function is supported with the provided, * arguments and ::AMDSMI_STATUS_NOT_SUPPORTED if it is not supported with the * provided arguments. * * @retval ::AMDSMI_STATUS_SUCCESS call was successful * @retval ::AMDSMI_STATUS_NOT_SUPPORTED installed software or hardware does not * support this function with the given arguments - * @retval ::AMDSMI_STATUS_INVALID_ARGS the provided arguments are not valid + * @retval ::AMDSMI_STATUS_INVAL the provided arguments are not valid */ amdsmi_status_t amdsmi_topo_numa_affinity_get(amdsmi_device_handle device_handle, uint32_t *numa_node); @@ -1506,14 +1556,14 @@ amdsmi_status_t amdsmi_dev_pci_throughput_get(amdsmi_device_handle device_handle * @param[inout] counter a pointer to uint64_t to which the sum of the NAK's * received and generated by the GPU is written * If this parameter is nullptr, this function will return - * ::AMDSMI_STATUS_INVALID_ARGS if the function is supported with the provided, + * ::AMDSMI_STATUS_INVAL if the function is supported with the provided, * arguments and ::AMDSMI_STATUS_NOT_SUPPORTED if it is not supported with the * provided arguments. * * @retval ::AMDSMI_STATUS_SUCCESS call was successful * @retval ::AMDSMI_STATUS_NOT_SUPPORTED installed software or hardware does not * support this function with the given arguments - * @retval ::AMDSMI_STATUS_INVALID_ARGS the provided arguments are not valid + * @retval ::AMDSMI_STATUS_INVAL the provided arguments are not valid */ amdsmi_status_t amdsmi_dev_pci_replay_counter_get(amdsmi_device_handle device_handle, uint64_t *counter); @@ -1579,14 +1629,14 @@ amdsmi_status_t amdsmi_dev_pci_bandwidth_set(amdsmi_device_handle device_handle, * @param[inout] power a pointer to uint64_t to which the average power * consumption will be written * If this parameter is nullptr, this function will return - * ::AMDSMI_STATUS_INVALID_ARGS if the function is supported with the provided, + * ::AMDSMI_STATUS_INVAL if the function is supported with the provided, * arguments and ::AMDSMI_STATUS_NOT_SUPPORTED if it is not supported with the * provided arguments. * * @retval ::AMDSMI_STATUS_SUCCESS call was successful * @retval ::AMDSMI_STATUS_NOT_SUPPORTED installed software or hardware does not * support this function with the given arguments - * @retval ::AMDSMI_STATUS_INVALID_ARGS the provided arguments are not valid + * @retval ::AMDSMI_STATUS_INVAL the provided arguments are not valid */ amdsmi_status_t amdsmi_dev_power_ave_get(amdsmi_device_handle device_handle, uint32_t sensor_ind, uint64_t *power); @@ -1609,7 +1659,7 @@ amdsmi_dev_power_ave_get(amdsmi_device_handle device_handle, uint32_t sensor_ind * @param[inout] power a pointer to uint64_t to which the energy * counter will be written * If this parameter is nullptr, this function will return - * ::AMDSMI_STATUS_INVALID_ARGS if the function is supported with the provided, + * ::AMDSMI_STATUS_INVAL if the function is supported with the provided, * and ::AMDSMI_STATUS_NOT_SUPPORTED if it is not supported with the * provided arguments. * @@ -1619,7 +1669,7 @@ amdsmi_dev_power_ave_get(amdsmi_device_handle device_handle, uint32_t sensor_ind * @retval ::AMDSMI_STATUS_SUCCESS call was successful * @retval ::AMDSMI_STATUS_NOT_SUPPORTED installed software or hardware does not * support this function with the given arguments - * @retval ::AMDSMI_STATUS_INVALID_ARGS the provided arguments are not valid + * @retval ::AMDSMI_STATUS_INVAL the provided arguments are not valid */ amdsmi_status_t amdsmi_dev_energy_count_get(amdsmi_device_handle device_handle, uint64_t *power, @@ -1648,7 +1698,7 @@ amdsmi_dev_energy_count_get(amdsmi_device_handle device_handle, uint64_t *power, * microwatts * * @retval ::AMDSMI_STATUS_SUCCESS is returned upon successful call. - * @retval ::AMDSMI_STATUS_INVALID_ARGS the provided arguments are not valid + * @retval ::AMDSMI_STATUS_INVAL the provided arguments are not valid * @retval ::AMDSMI_STATUS_PERMISSION function requires root access * */ @@ -1703,14 +1753,14 @@ amdsmi_dev_power_profile_set(amdsmi_device_handle device_handle, uint32_t reserv * @param[inout] total a pointer to uint64_t to which the total amount of * memory will be written * If this parameter is nullptr, this function will return - * ::AMDSMI_STATUS_INVALID_ARGS if the function is supported with the provided, + * ::AMDSMI_STATUS_INVAL if the function is supported with the provided, * arguments and ::AMDSMI_STATUS_NOT_SUPPORTED if it is not supported with the * provided arguments. * * @retval ::AMDSMI_STATUS_SUCCESS call was successful * @retval ::AMDSMI_STATUS_NOT_SUPPORTED installed software or hardware does not * support this function with the given arguments - * @retval ::AMDSMI_STATUS_INVALID_ARGS the provided arguments are not valid + * @retval ::AMDSMI_STATUS_INVAL the provided arguments are not valid * */ amdsmi_status_t @@ -1733,14 +1783,14 @@ amdsmi_dev_memory_total_get(amdsmi_device_handle device_handle, amdsmi_memory_ty * @param[inout] used a pointer to uint64_t to which the amount of memory * currently being used will be written * If this parameter is nullptr, this function will return - * ::AMDSMI_STATUS_INVALID_ARGS if the function is supported with the provided, + * ::AMDSMI_STATUS_INVAL if the function is supported with the provided, * arguments and ::AMDSMI_STATUS_NOT_SUPPORTED if it is not supported with the * provided arguments. * * @retval ::AMDSMI_STATUS_SUCCESS call was successful * @retval ::AMDSMI_STATUS_NOT_SUPPORTED installed software or hardware does not * support this function with the given arguments - * @retval ::AMDSMI_STATUS_INVALID_ARGS the provided arguments are not valid + * @retval ::AMDSMI_STATUS_INVAL the provided arguments are not valid * */ amdsmi_status_t @@ -1759,14 +1809,14 @@ amdsmi_dev_memory_usage_get(amdsmi_device_handle device_handle, amdsmi_memory_ty * @param[inout] busy_percent a pointer to the uint32_t to which the busy * percent will be written * If this parameter is nullptr, this function will return - * ::AMDSMI_STATUS_INVALID_ARGS if the function is supported with the provided, + * ::AMDSMI_STATUS_INVAL if the function is supported with the provided, * arguments and ::AMDSMI_STATUS_NOT_SUPPORTED if it is not supported with the * provided arguments. * * @retval ::AMDSMI_STATUS_SUCCESS call was successful * @retval ::AMDSMI_STATUS_NOT_SUPPORTED installed software or hardware does not * support this function with the given arguments - * @retval ::AMDSMI_STATUS_INVALID_ARGS the provided arguments are not valid + * @retval ::AMDSMI_STATUS_INVAL the provided arguments are not valid * */ amdsmi_status_t @@ -1791,7 +1841,7 @@ amdsmi_dev_memory_busy_percent_get(amdsmi_device_handle device_handle, uint32_t * number of records that could have been written if enough memory had been * provided. * If this parameter is nullptr, this function will return - * ::AMDSMI_STATUS_INVALID_ARGS if the function is supported with the provided, + * ::AMDSMI_STATUS_INVAL if the function is supported with the provided, * arguments and ::AMDSMI_STATUS_NOT_SUPPORTED if it is not supported with the * provided arguments. * @@ -1803,7 +1853,7 @@ amdsmi_dev_memory_busy_percent_get(amdsmi_device_handle device_handle, uint32_t * @retval ::AMDSMI_STATUS_SUCCESS call was successful * @retval ::AMDSMI_STATUS_NOT_SUPPORTED installed software or hardware does not * support this function with the given arguments - * @retval ::AMDSMI_STATUS_INVALID_ARGS the provided arguments are not valid + * @retval ::AMDSMI_STATUS_INVAL the provided arguments are not valid * @retval ::AMDSMI_STATUS_INSUFFICIENT_SIZE is returned if more records were available * than allowed by the provided, allocated memory. */ @@ -1833,14 +1883,14 @@ amdsmi_dev_memory_reserved_pages_get(amdsmi_device_handle device_handle, uint32_ * @param[inout] speed a pointer to uint32_t to which the speed will be * written * If this parameter is nullptr, this function will return - * ::AMDSMI_STATUS_INVALID_ARGS if the function is supported with the provided, + * ::AMDSMI_STATUS_INVAL if the function is supported with the provided, * arguments and ::AMDSMI_STATUS_NOT_SUPPORTED if it is not supported with the * provided arguments. * * @retval ::AMDSMI_STATUS_SUCCESS call was successful * @retval ::AMDSMI_STATUS_NOT_SUPPORTED installed software or hardware does not * support this function with the given arguments - * @retval ::AMDSMI_STATUS_INVALID_ARGS the provided arguments are not valid + * @retval ::AMDSMI_STATUS_INVAL the provided arguments are not valid * */ amdsmi_status_t amdsmi_dev_fan_rpms_get(amdsmi_device_handle device_handle, uint32_t sensor_ind, @@ -1863,14 +1913,14 @@ amdsmi_status_t amdsmi_dev_fan_rpms_get(amdsmi_device_handle device_handle, uint * @param[inout] speed a pointer to uint32_t to which the speed will be * written * If this parameter is nullptr, this function will return - * ::AMDSMI_STATUS_INVALID_ARGS if the function is supported with the provided, + * ::AMDSMI_STATUS_INVAL if the function is supported with the provided, * arguments and ::AMDSMI_STATUS_NOT_SUPPORTED if it is not supported with the * provided arguments. * * @retval ::AMDSMI_STATUS_SUCCESS call was successful * @retval ::AMDSMI_STATUS_NOT_SUPPORTED installed software or hardware does not * support this function with the given arguments - * @retval ::AMDSMI_STATUS_INVALID_ARGS the provided arguments are not valid + * @retval ::AMDSMI_STATUS_INVAL the provided arguments are not valid * */ amdsmi_status_t amdsmi_dev_fan_speed_get(amdsmi_device_handle device_handle, @@ -1891,14 +1941,14 @@ amdsmi_status_t amdsmi_dev_fan_speed_get(amdsmi_device_handle device_handle, * @param[inout] max_speed a pointer to uint32_t to which the maximum speed * will be written * If this parameter is nullptr, this function will return - * ::AMDSMI_STATUS_INVALID_ARGS if the function is supported with the provided, + * ::AMDSMI_STATUS_INVAL if the function is supported with the provided, * arguments and ::AMDSMI_STATUS_NOT_SUPPORTED if it is not supported with the * provided arguments. * * @retval ::AMDSMI_STATUS_SUCCESS call was successful * @retval ::AMDSMI_STATUS_NOT_SUPPORTED installed software or hardware does not * support this function with the given arguments - * @retval ::AMDSMI_STATUS_INVALID_ARGS the provided arguments are not valid + * @retval ::AMDSMI_STATUS_INVAL the provided arguments are not valid * */ amdsmi_status_t amdsmi_dev_fan_speed_max_get(amdsmi_device_handle device_handle, @@ -1924,14 +1974,14 @@ amdsmi_status_t amdsmi_dev_fan_speed_max_get(amdsmi_device_handle device_handle, * @param[inout] temperature a pointer to int64_t to which the temperature * will be written, in millidegrees Celcius. * If this parameter is nullptr, this function will return - * ::AMDSMI_STATUS_INVALID_ARGS if the function is supported with the provided, + * ::AMDSMI_STATUS_INVAL if the function is supported with the provided, * arguments and ::AMDSMI_STATUS_NOT_SUPPORTED if it is not supported with the * provided arguments. * * @retval ::AMDSMI_STATUS_SUCCESS call was successful * @retval ::AMDSMI_STATUS_NOT_SUPPORTED installed software or hardware does not * support this function with the given arguments - * @retval ::AMDSMI_STATUS_INVALID_ARGS the provided arguments are not valid + * @retval ::AMDSMI_STATUS_INVAL the provided arguments are not valid * */ amdsmi_status_t amdsmi_dev_temp_metric_get(amdsmi_device_handle device_handle, uint32_t sensor_type, @@ -1957,14 +2007,14 @@ amdsmi_status_t amdsmi_dev_temp_metric_get(amdsmi_device_handle device_handle, u * @param[inout] voltage a pointer to int64_t to which the voltage * will be written, in millivolts. * If this parameter is nullptr, this function will return - * ::AMDSMI_STATUS_INVALID_ARGS if the function is supported with the provided, + * ::AMDSMI_STATUS_INVAL if the function is supported with the provided, * arguments and ::AMDSMI_STATUS_NOT_SUPPORTED if it is not supported with the * provided arguments. * * @retval ::AMDSMI_STATUS_SUCCESS call was successful * @retval ::AMDSMI_STATUS_NOT_SUPPORTED installed software or hardware does not * support this function with the given arguments - * @retval ::AMDSMI_STATUS_INVALID_ARGS the provided arguments are not valid + * @retval ::AMDSMI_STATUS_INVAL the provided arguments are not valid * */ amdsmi_status_t amdsmi_dev_volt_metric_get(amdsmi_device_handle device_handle, @@ -2016,8 +2066,8 @@ amdsmi_status_t amdsmi_dev_fan_reset(amdsmi_device_handle device_handle, uint32_ * @retval ::AMDSMI_STATUS_PERMISSION function requires root access * */ -amdsmi_status_t amdsmi_dev_fan_speed_set(amdsmi_device_handle device_handle, uint32_t sensor_ind, - uint64_t speed); +amdsmi_status_t amdsmi_dev_fan_speed_set(amdsmi_device_handle device_handle, + uint32_t sensor_ind, uint64_t speed); /** @} */ // end of PhysCont /*****************************************************************************/ @@ -2040,14 +2090,14 @@ amdsmi_status_t amdsmi_dev_fan_speed_set(amdsmi_device_handle device_handle, uin * @param[inout] busy_percent a pointer to the uint32_t to which the busy * percent will be written * If this parameter is nullptr, this function will return - * ::AMDSMI_STATUS_INVALID_ARGS if the function is supported with the provided, + * ::AMDSMI_STATUS_INVAL if the function is supported with the provided, * arguments and ::AMDSMI_STATUS_NOT_SUPPORTED if it is not supported with the * provided arguments. * * @retval ::AMDSMI_STATUS_SUCCESS call was successful * @retval ::AMDSMI_STATUS_NOT_SUPPORTED installed software or hardware does not * support this function with the given arguments - * @retval ::AMDSMI_STATUS_INVALID_ARGS the provided arguments are not valid + * @retval ::AMDSMI_STATUS_INVAL the provided arguments are not valid * */ amdsmi_status_t @@ -2079,7 +2129,7 @@ amdsmi_dev_busy_percent_get(amdsmi_device_handle device_handle, uint32_t *busy_p * @retval ::AMDSMI_STATUS_SUCCESS call was successful * @retval ::AMDSMI_STATUS_NOT_SUPPORTED installed software or hardware does not * support this function with the given arguments - * @retval ::AMDSMI_STATUS_INVALID_ARGS the provided arguments are not valid + * @retval ::AMDSMI_STATUS_INVAL the provided arguments are not valid * */ amdsmi_status_t @@ -2101,14 +2151,14 @@ amdsmi_utilization_count_get(amdsmi_device_handle device_handle, * @param[inout] perf a pointer to ::amdsmi_dev_perf_level_t to which the * performance level will be written * If this parameter is nullptr, this function will return - * ::AMDSMI_STATUS_INVALID_ARGS if the function is supported with the provided, + * ::AMDSMI_STATUS_INVAL if the function is supported with the provided, * arguments and ::AMDSMI_STATUS_NOT_SUPPORTED if it is not supported with the * provided arguments. * * @retval ::AMDSMI_STATUS_SUCCESS call was successful * @retval ::AMDSMI_STATUS_NOT_SUPPORTED installed software or hardware does not * support this function with the given arguments - * @retval ::AMDSMI_STATUS_INVALID_ARGS the provided arguments are not valid + * @retval ::AMDSMI_STATUS_INVAL the provided arguments are not valid * */ amdsmi_status_t amdsmi_dev_perf_level_get(amdsmi_device_handle device_handle, @@ -2132,11 +2182,12 @@ amdsmi_status_t amdsmi_dev_perf_level_get(amdsmi_device_handle device_handle, * @retval ::AMDSMI_STATUS_SUCCESS call was successful * @retval ::AMDSMI_STATUS_NOT_SUPPORTED installed software or hardware does not * support this function with the given arguments - * @retval ::AMDSMI_STATUS_INVALID_ARGS the provided arguments are not valid + * @retval ::AMDSMI_STATUS_INVAL the provided arguments are not valid * */ -amdsmi_status_t amdsmi_perf_determinism_mode_set(amdsmi_device_handle device_handle, uint64_t clkvalue); +amdsmi_status_t +amdsmi_perf_determinism_mode_set(amdsmi_device_handle device_handle, uint64_t clkvalue); /** * @brief Get the overdrive percent associated with the device with provided * device handle. @@ -2150,14 +2201,14 @@ amdsmi_status_t amdsmi_perf_determinism_mode_set(amdsmi_device_handle device_han * @param[inout] od a pointer to uint32_t to which the overdrive percentage * will be written * If this parameter is nullptr, this function will return - * ::AMDSMI_STATUS_INVALID_ARGS if the function is supported with the provided, + * ::AMDSMI_STATUS_INVAL if the function is supported with the provided, * arguments and ::AMDSMI_STATUS_NOT_SUPPORTED if it is not supported with the * provided arguments. * * @retval ::AMDSMI_STATUS_SUCCESS call was successful * @retval ::AMDSMI_STATUS_NOT_SUPPORTED installed software or hardware does not * support this function with the given arguments - * @retval ::AMDSMI_STATUS_INVALID_ARGS the provided arguments are not valid + * @retval ::AMDSMI_STATUS_INVAL the provided arguments are not valid * */ @@ -2180,14 +2231,14 @@ amdsmi_status_t amdsmi_dev_overdrive_level_get(amdsmi_device_handle device_handl * to which the frequency information will be written. Frequency values are in * Hz. * If this parameter is nullptr, this function will return - * ::AMDSMI_STATUS_INVALID_ARGS if the function is supported with the provided, + * ::AMDSMI_STATUS_INVAL if the function is supported with the provided, * arguments and ::AMDSMI_STATUS_NOT_SUPPORTED if it is not supported with the * provided arguments. * * @retval ::AMDSMI_STATUS_SUCCESS call was successful * @retval ::AMDSMI_STATUS_NOT_SUPPORTED installed software or hardware does not * support this function with the given arguments - * @retval ::AMDSMI_STATUS_INVALID_ARGS the provided arguments are not valid + * @retval ::AMDSMI_STATUS_INVAL the provided arguments are not valid * */ amdsmi_status_t amdsmi_dev_gpu_clk_freq_get(amdsmi_device_handle device_handle, @@ -2203,7 +2254,7 @@ amdsmi_status_t amdsmi_dev_gpu_clk_freq_get(amdsmi_device_handle device_handle, * @retval ::AMDSMI_STATUS_SUCCESS call was successful * @retval ::AMDSMI_STATUS_NOT_SUPPORTED installed software or hardware does not * support this function with the given arguments - * @retval ::AMDSMI_STATUS_INVALID_ARGS the provided arguments are not valid + * @retval ::AMDSMI_STATUS_INVAL the provided arguments are not valid * */ amdsmi_status_t amdsmi_dev_gpu_reset(amdsmi_device_handle device_handle); @@ -2219,14 +2270,14 @@ amdsmi_status_t amdsmi_dev_gpu_reset(amdsmi_device_handle device_handle); * * @param[inout] odv a pointer to an ::amdsmi_od_volt_freq_data_t structure * If this parameter is nullptr, this function will return - * ::AMDSMI_STATUS_INVALID_ARGS if the function is supported with the provided, + * ::AMDSMI_STATUS_INVAL if the function is supported with the provided, * arguments and ::AMDSMI_STATUS_NOT_SUPPORTED if it is not supported with the * provided arguments. * * @retval ::AMDSMI_STATUS_SUCCESS call was successful * @retval ::AMDSMI_STATUS_NOT_SUPPORTED installed software or hardware does not * support this function with the given arguments - * @retval ::AMDSMI_STATUS_INVALID_ARGS the provided arguments are not valid + * @retval ::AMDSMI_STATUS_INVAL the provided arguments are not valid */ amdsmi_status_t amdsmi_dev_od_volt_info_get(amdsmi_device_handle device_handle, amdsmi_od_volt_freq_data_t *odv); @@ -2242,14 +2293,14 @@ amdsmi_status_t amdsmi_dev_od_volt_info_get(amdsmi_device_handle device_handle, * * @param[inout] pgpu_metrics a pointer to an ::amdsmi_gpu_metrics_t structure * If this parameter is nullptr, this function will return - * ::AMDSMI_STATUS_INVALID_ARGS if the function is supported with the provided, + * ::AMDSMI_STATUS_INVAL if the function is supported with the provided, * arguments and ::AMDSMI_STATUS_NOT_SUPPORTED if it is not supported with the * provided arguments. * * @retval ::AMDSMI_STATUS_SUCCESS call was successful * @retval ::AMDSMI_STATUS_NOT_SUPPORTED installed software or hardware does not * support this function with the given arguments - * @retval ::AMDSMI_STATUS_INVALID_ARGS the provided arguments are not valid + * @retval ::AMDSMI_STATUS_INVAL the provided arguments are not valid */ amdsmi_status_t amdsmi_dev_gpu_metrics_info_get(amdsmi_device_handle device_handle, amdsmi_gpu_metrics_t *pgpu_metrics); @@ -2274,7 +2325,7 @@ amdsmi_status_t amdsmi_dev_gpu_metrics_info_get(amdsmi_device_handle device_hand * @retval ::AMDSMI_STATUS_SUCCESS call was successful * @retval ::AMDSMI_STATUS_NOT_SUPPORTED installed software or hardware does not * support this function with the given arguments - * @retval ::AMDSMI_STATUS_INVALID_ARGS the provided arguments are not valid + * @retval ::AMDSMI_STATUS_INVAL the provided arguments are not valid */ amdsmi_status_t amdsmi_dev_clk_range_set(amdsmi_device_handle device_handle, uint64_t minclkvalue, uint64_t maxclkvalue, @@ -2300,7 +2351,7 @@ amdsmi_status_t amdsmi_dev_clk_range_set(amdsmi_device_handle device_handle, uin * @retval ::AMDSMI_STATUS_SUCCESS call was successful * @retval ::AMDSMI_STATUS_NOT_SUPPORTED installed software or hardware does not * support this function with the given arguments - * @retval ::AMDSMI_STATUS_INVALID_ARGS the provided arguments are not valid + * @retval ::AMDSMI_STATUS_INVAL the provided arguments are not valid */ amdsmi_status_t amdsmi_dev_od_clk_info_set(amdsmi_device_handle device_handle, amdsmi_freq_ind_t level, uint64_t clkvalue, @@ -2325,7 +2376,7 @@ amdsmi_status_t amdsmi_dev_od_clk_info_set(amdsmi_device_handle device_handle, a * @retval ::AMDSMI_STATUS_SUCCESS call was successful * @retval ::AMDSMI_STATUS_NOT_SUPPORTED installed software or hardware does not * support this function with the given arguments - * @retval ::AMDSMI_STATUS_INVALID_ARGS the provided arguments are not valid + * @retval ::AMDSMI_STATUS_INVAL the provided arguments are not valid */ amdsmi_status_t amdsmi_dev_od_volt_info_set(amdsmi_device_handle device_handle, uint32_t vpoint, uint64_t clkvalue, uint64_t voltvalue); @@ -2352,21 +2403,21 @@ amdsmi_status_t amdsmi_dev_od_volt_info_set(amdsmi_device_handle device_handle, * output, this is the number of ::amdsmi_freq_volt_region_t structures that were * actually written. * If this parameter is nullptr, this function will return - * ::AMDSMI_STATUS_INVALID_ARGS if the function is supported with the provided, + * ::AMDSMI_STATUS_INVAL if the function is supported with the provided, * arguments and ::AMDSMI_STATUS_NOT_SUPPORTED if it is not supported with the * provided arguments. * * @param[inout] buffer a caller provided buffer to which * ::amdsmi_freq_volt_region_t structures will be written * If this parameter is nullptr, this function will return - * ::AMDSMI_STATUS_INVALID_ARGS if the function is supported with the provided, + * ::AMDSMI_STATUS_INVAL if the function is supported with the provided, * arguments and ::AMDSMI_STATUS_NOT_SUPPORTED if it is not supported with the * provided arguments. * * @retval ::AMDSMI_STATUS_SUCCESS call was successful * @retval ::AMDSMI_STATUS_NOT_SUPPORTED installed software or hardware does not * support this function with the given arguments - * @retval ::AMDSMI_STATUS_INVALID_ARGS the provided arguments are not valid + * @retval ::AMDSMI_STATUS_INVAL the provided arguments are not valid */ amdsmi_status_t amdsmi_dev_od_volt_curve_regions_get(amdsmi_device_handle device_handle, uint32_t *num_regions, amdsmi_freq_volt_region_t *buffer); @@ -2396,14 +2447,14 @@ amdsmi_status_t amdsmi_dev_od_volt_curve_regions_get(amdsmi_device_handle device * @param[inout] status a pointer to ::amdsmi_power_profile_status_t that will be * populated by a call to this function * If this parameter is nullptr, this function will return - * ::AMDSMI_STATUS_INVALID_ARGS if the function is supported with the provided, + * ::AMDSMI_STATUS_INVAL if the function is supported with the provided, * arguments and ::AMDSMI_STATUS_NOT_SUPPORTED if it is not supported with the * provided arguments. * * @retval ::AMDSMI_STATUS_SUCCESS call was successful * @retval ::AMDSMI_STATUS_NOT_SUPPORTED installed software or hardware does not * support this function with the given arguments - * @retval ::AMDSMI_STATUS_INVALID_ARGS the provided arguments are not valid + * @retval ::AMDSMI_STATUS_INVAL the provided arguments are not valid * */ amdsmi_status_t @@ -2630,7 +2681,7 @@ amdsmi_version_get(amdsmi_version_t *version); * @retval ::AMDSMI_STATUS_SUCCESS call was successful * @retval ::AMDSMI_STATUS_NOT_SUPPORTED installed software or hardware does not * support this function with the given arguments - * @retval ::AMDSMI_STATUS_INVALID_ARGS the provided arguments are not valid + * @retval ::AMDSMI_STATUS_INVAL the provided arguments are not valid * @retval ::AMDSMI_STATUS_INSUFFICIENT_SIZE is returned if @p len bytes is not * large enough to hold the entire name. In this case, only @p len bytes will * be written. @@ -2663,14 +2714,14 @@ amdsmi_version_str_get(amdsmi_sw_component_t component, char *ver_str, * @param[inout] ec A pointer to an ::amdsmi_error_count_t to which the error * counts should be written * If this parameter is nullptr, this function will return - * ::AMDSMI_STATUS_INVALID_ARGS if the function is supported with the provided, + * ::AMDSMI_STATUS_INVAL if the function is supported with the provided, * arguments and ::AMDSMI_STATUS_NOT_SUPPORTED if it is not supported with the * provided arguments. * * @retval ::AMDSMI_STATUS_SUCCESS call was successful * @retval ::AMDSMI_STATUS_NOT_SUPPORTED installed software or hardware does not * support this function with the given arguments - * @retval ::AMDSMI_STATUS_INVALID_ARGS the provided arguments are not valid + * @retval ::AMDSMI_STATUS_INVAL the provided arguments are not valid * */ amdsmi_status_t amdsmi_dev_ecc_count_get(amdsmi_device_handle device_handle, @@ -2694,14 +2745,14 @@ amdsmi_status_t amdsmi_dev_ecc_count_get(amdsmi_device_handle device_handle, * @param[inout] enabled_blocks A pointer to a uint64_t to which the enabled * blocks bits will be written. * If this parameter is nullptr, this function will return - * ::AMDSMI_STATUS_INVALID_ARGS if the function is supported with the provided, + * ::AMDSMI_STATUS_INVAL if the function is supported with the provided, * arguments and ::AMDSMI_STATUS_NOT_SUPPORTED if it is not supported with the * provided arguments. * * @retval ::AMDSMI_STATUS_SUCCESS call was successful * @retval ::AMDSMI_STATUS_NOT_SUPPORTED installed software or hardware does not * support this function with the given arguments - * @retval ::AMDSMI_STATUS_INVALID_ARGS the provided arguments are not valid + * @retval ::AMDSMI_STATUS_INVAL the provided arguments are not valid */ amdsmi_status_t amdsmi_dev_ecc_enabled_get(amdsmi_device_handle device_handle, uint64_t *enabled_blocks); @@ -2721,14 +2772,14 @@ amdsmi_status_t amdsmi_dev_ecc_enabled_get(amdsmi_device_handle device_handle, * @param[inout] state A pointer to an ::amdsmi_ras_err_state_t to which the * ECC state should be written * If this parameter is nullptr, this function will return - * ::AMDSMI_STATUS_INVALID_ARGS if the function is supported with the provided, + * ::AMDSMI_STATUS_INVAL if the function is supported with the provided, * arguments and ::AMDSMI_STATUS_NOT_SUPPORTED if it is not supported with the * provided arguments. * * @retval ::AMDSMI_STATUS_SUCCESS call was successful * @retval ::AMDSMI_STATUS_NOT_SUPPORTED installed software or hardware does not * support this function with the given arguments - * @retval ::AMDSMI_STATUS_INVALID_ARGS the provided arguments are not valid + * @retval ::AMDSMI_STATUS_INVAL the provided arguments are not valid * */ amdsmi_status_t amdsmi_dev_ecc_status_get(amdsmi_device_handle device_handle, amdsmi_gpu_block_t block, @@ -2892,14 +2943,14 @@ amdsmi_dev_counter_group_supported(amdsmi_device_handle device_handle, amdsmi_ev * @param[inout] evnt_handle A pointer to a ::amdsmi_event_handle_t which will be * associated with a newly allocated counter * If this parameter is nullptr, this function will return - * ::AMDSMI_STATUS_INVALID_ARGS if the function is supported with the provided, + * ::AMDSMI_STATUS_INVAL if the function is supported with the provided, * arguments and ::AMDSMI_STATUS_NOT_SUPPORTED if it is not supported with the * provided arguments. * * @retval ::AMDSMI_STATUS_SUCCESS call was successful * @retval ::AMDSMI_STATUS_NOT_SUPPORTED installed software or hardware does not * support this function with the given arguments - * @retval ::AMDSMI_STATUS_INVALID_ARGS the provided arguments are not valid + * @retval ::AMDSMI_STATUS_INVAL the provided arguments are not valid * @retval ::AMDSMI_STATUS_OUT_OF_RESOURCES unable to allocate memory for counter * @retval ::AMDSMI_STATUS_PERMISSION function requires root access * @@ -2917,7 +2968,7 @@ amdsmi_dev_counter_create(amdsmi_device_handle device_handle, amdsmi_event_type_ * @param[in] evnt_handle handle to event object to be deallocated * * @retval ::AMDSMI_STATUS_SUCCESS is returned upon successful call - * @retval ::AMDSMI_STATUS_INVALID_ARGS the provided arguments are not valid + * @retval ::AMDSMI_STATUS_INVAL the provided arguments are not valid * @retval ::AMDSMI_STATUS_PERMISSION function requires root access * */ @@ -2937,7 +2988,7 @@ amdsmi_dev_counter_destroy(amdsmi_event_handle_t evnt_handle); * @param[inout] cmd_args Currently not used. Should be set to NULL. * * @retval ::AMDSMI_STATUS_SUCCESS is returned upon successful call - * @retval ::AMDSMI_STATUS_INVALID_ARGS the provided arguments are not valid + * @retval ::AMDSMI_STATUS_INVAL the provided arguments are not valid * @retval ::AMDSMI_STATUS_PERMISSION function requires root access * */ @@ -2958,7 +3009,7 @@ amdsmi_counter_control(amdsmi_event_handle_t evt_handle, * which the counter value will be written * * @retval ::AMDSMI_STATUS_SUCCESS is returned upon successful call - * @retval ::AMDSMI_STATUS_INVALID_ARGS the provided arguments are not valid + * @retval ::AMDSMI_STATUS_INVAL the provided arguments are not valid * @retval ::AMDSMI_STATUS_PERMISSION function requires root access * */ @@ -2982,7 +3033,7 @@ amdsmi_counter_read(amdsmi_event_handle_t evt_handle, * available counters will be written * * @retval ::AMDSMI_STATUS_SUCCESS is returned upon successful call - * @retval ::AMDSMI_STATUS_INVALID_ARGS the provided arguments are not valid + * @retval ::AMDSMI_STATUS_INVAL the provided arguments are not valid * */ amdsmi_status_t @@ -3023,7 +3074,7 @@ amdsmi_counter_available_counters_get(amdsmi_device_handle device_handle, * processes for which there is information. * * @retval ::AMDSMI_STATUS_SUCCESS is returned upon successful call - * @retval ::AMDSMI_STATUS_INVALID_ARGS the provided arguments are not valid + * @retval ::AMDSMI_STATUS_INVAL the provided arguments are not valid * @retval ::AMDSMI_STATUS_INSUFFICIENT_SIZE is returned if there were more * processes for which information was available, but not enough space was * provided as indicated by @p procs and @p num_items, on input. @@ -3046,7 +3097,7 @@ amdsmi_compute_process_info_get(amdsmi_process_info_t *procs, uint32_t *num_item * process information for @p pid will be written if it is found. * * @retval ::AMDSMI_STATUS_SUCCESS is returned upon successful call - * @retval ::AMDSMI_STATUS_INVALID_ARGS the provided arguments are not valid + * @retval ::AMDSMI_STATUS_INVAL the provided arguments are not valid * @retval ::AMDSMI_STATUS_NOT_FOUND is returned if there was no process * information * found for the provided @p pid @@ -3083,7 +3134,7 @@ amdsmi_compute_process_info_by_pid_get(uint32_t pid, amdsmi_process_info_t *proc * NULL, this argument will be updated with the number devices being used. * * @retval ::AMDSMI_STATUS_SUCCESS is returned upon successful call - * @retval ::AMDSMI_STATUS_INVALID_ARGS the provided arguments are not valid + * @retval ::AMDSMI_STATUS_INVAL the provided arguments are not valid * @retval ::AMDSMI_STATUS_INSUFFICIENT_SIZE is returned if there were more * gpu indices that could have been written, but not enough space was * provided as indicated by @p device_handleices and @p num_devices, on input. @@ -3114,14 +3165,14 @@ amdsmi_compute_process_gpus_get(uint32_t pid, uint32_t *dv_indices, * @param[inout] status A pointer to an ::amdsmi_xgmi_status_t to which the * XGMI error state should be written * If this parameter is nullptr, this function will return - * ::AMDSMI_STATUS_INVALID_ARGS if the function is supported with the provided, + * ::AMDSMI_STATUS_INVAL if the function is supported with the provided, * arguments and ::AMDSMI_STATUS_NOT_SUPPORTED if it is not supported with the * provided arguments. * * @retval ::AMDSMI_STATUS_SUCCESS call was successful * @retval ::AMDSMI_STATUS_NOT_SUPPORTED installed software or hardware does not * support this function with the given arguments - * @retval ::AMDSMI_STATUS_INVALID_ARGS the provided arguments are not valid + * @retval ::AMDSMI_STATUS_INVAL the provided arguments are not valid * */ amdsmi_status_t @@ -3164,7 +3215,7 @@ amdsmi_dev_xgmi_error_reset(amdsmi_device_handle device_handle); * numa node number should be written. * * @retval ::AMDSMI_STATUS_SUCCESS call was successful - * @retval ::AMDSMI_STATUS_INVALID_ARGS the provided arguments are not valid + * @retval ::AMDSMI_STATUS_INVAL the provided arguments are not valid * */ amdsmi_status_t @@ -3187,7 +3238,7 @@ amdsmi_topo_get_numa_node_number(amdsmi_device_handle device_handle, uint32_t *n * weight for the connection should be written. * * @retval ::AMDSMI_STATUS_SUCCESS call was successful - * @retval ::AMDSMI_STATUS_INVALID_ARGS the provided arguments are not valid + * @retval ::AMDSMI_STATUS_INVAL the provided arguments are not valid * */ amdsmi_status_t @@ -3214,7 +3265,7 @@ amdsmi_topo_get_link_weight(amdsmi_device_handle device_handle_src, amdsmi_devic * maximal bandwidth for the connection should be written. * * @retval ::AMDSMI_STATUS_SUCCESS call was successful - * @retval ::AMDSMI_STATUS_INVALID_ARGS the provided arguments are not valid + * @retval ::AMDSMI_STATUS_INVAL the provided arguments are not valid */ amdsmi_status_t amdsmi_minmax_bandwidth_get(amdsmi_device_handle device_handle_src, amdsmi_device_handle device_handle_dst, @@ -3241,7 +3292,7 @@ amdsmi_minmax_bandwidth_get(amdsmi_device_handle device_handle_src, amdsmi_devic * type for the connection should be written. * * @retval ::AMDSMI_STATUS_SUCCESS call was successful - * @retval ::AMDSMI_STATUS_INVALID_ARGS the provided arguments are not valid + * @retval ::AMDSMI_STATUS_INVAL the provided arguments are not valid * */ amdsmi_status_t @@ -3266,7 +3317,7 @@ amdsmi_topo_get_link_type(amdsmi_device_handle device_handle_src, * the P2P connection availablity should be written. * * @retval ::AMDSMI_STATUS_SUCCESS call was successful - * @retval ::AMDSMI_STATUS_INVALID_ARGS the provided arguments are not valid + * @retval ::AMDSMI_STATUS_INVAL the provided arguments are not valid * */ amdsmi_status_t @@ -3319,14 +3370,15 @@ amdsmi_is_P2P_accessible(amdsmi_device_handle device_handle_src, amdsmi_device_h * amdsmi_func_id_iter_handle_t iter_handle, var_iter, sub_var_iter; * amdsmi_func_id_value_t value; * amdsmi_status_t err; + * amdsmi_device_handle device; * - * for (uint32_t i = 0; i < ; ++i) { - * std::cout << "Supported AMDSMI Functions:" << std::endl; - * std::cout << "\tVariants (Monitors)" << std::endl; + * // Get the device handle via amdsmi_get_device_handles() + * // ... ... + * + * std::cout << "Supported AMDSMI Functions:" << std::endl; * + * err = amdsmi_dev_supported_func_iterator_open(device, &iter_handle); * - * err = amdsmi_dev_supported_func_iterator_open(i, &iter_handle); - * - * while (1) { + * while (1) { * err = amdsmi_func_iter_value_get(iter_handle, &value); * std::cout << "Function Name: " << value.name << std::endl; * @@ -3607,7 +3659,7 @@ amdsmi_event_notification_get(int timeout_ms, * @param[in] dv_ind The device handle of the GPU for which event * notification resources will be free * - * @retval ::AMDSMI_STATUS_INVALID_ARGS resources for the given device have + * @retval ::AMDSMI_STATUS_INVAL resources for the given device have * either already been freed, or were never allocated by * ::amdsmi_event_notification_init() * diff --git a/amd_smi/src/amd_smi.cc b/amd_smi/src/amd_smi.cc index f0170373d6..fe4f2a93c2 100644 --- a/amd_smi/src/amd_smi.cc +++ b/amd_smi/src/amd_smi.cc @@ -52,6 +52,7 @@ #include #include #include +#include #include #include #include "amd_smi.h" @@ -60,6 +61,7 @@ #include "impl/amd_smi_socket.h" #include "impl/amd_smi_gpu_device.h" #include "rocm_smi/rocm_smi.h" +#include "rocm_smi/rocm_smi_common.h" #include "impl/amdgpu_drm.h" // TODO(bliu): One to one map to all status code @@ -197,34 +199,53 @@ amdsmi_status_t amdsmi_get_device_type(amdsmi_device_handle device_handle , } amdsmi_status_t amdsmi_get_board_info(amdsmi_device_handle device_handle, - amdsmi_board_info_t *board_info) { - if (board_info == NULL) { + amdsmi_board_info_t *info) { + if (info == NULL) { return AMDSMI_STATUS_INVAL; } + memset(info, 0, sizeof(amdsmi_board_info_t)); + + // ignore errors so that if the function is not supported, + // it will continue to add other info. auto r = rsmi_wrapper(rsmi_dev_name_get, device_handle, - board_info->product_name, AMDSMI_PRODUCT_NAME_LENGTH); - if (r != AMDSMI_STATUS_SUCCESS) - return r; - // TODO(bliu) : rsmi_dev_serial_number_get, rsmi_dev_brand_get, - // rsmi_dev_sku_get, Do we include in the board_info or different data structure - /* + info->product_name, AMDSMI_PRODUCT_NAME_LENGTH); + r = rsmi_wrapper(rsmi_dev_serial_number_get, device_handle, - board_info->serial_number, AMDSMI_NORMAL_STRING_LENGTH); - if (r != AMDSMI_STATUS_SUCCESS) - return r; + info->product_serial, AMDSMI_NORMAL_STRING_LENGTH); + + return AMDSMI_STATUS_SUCCESS; +} + +// TODO(bliu) : add other asic info +amdsmi_status amdsmi_get_asic_info(amdsmi_device_handle device_handle, + amdsmi_asic_info_t *info) { + if (info == nullptr) + return AMDSMI_STATUS_INVAL; + memset(info, 0, sizeof(amdsmi_asic_info_t)); + + auto r = rsmi_wrapper(rsmi_dev_serial_number_get, device_handle, + info->asic_serial, AMDSMI_NORMAL_STRING_LENGTH); r = rsmi_wrapper(rsmi_dev_brand_get, device_handle, - board_info->brand, AMDSMI_NORMAL_STRING_LENGTH); - if (r != AMDSMI_STATUS_SUCCESS) - return r; + info->market_name, AMDSMI_NORMAL_STRING_LENGTH); - r = rsmi_wrapper(rsmi_dev_sku_get, device_handle, - &(board_info->sku)); - if (r != AMDSMI_STATUS_SUCCESS) - return r; -*/ - return r; + uint16_t vendor_id = 0; + r = rsmi_wrapper(rsmi_dev_vendor_id_get, device_handle, + &vendor_id); + if ( r == AMDSMI_STATUS_SUCCESS) + info->vendor_id = static_cast(vendor_id); + + r = rsmi_wrapper(rsmi_dev_unique_id_get, device_handle, + &(info->device_id)); + + vendor_id = 0; + r = rsmi_wrapper(rsmi_dev_subsystem_vendor_id_get, device_handle, + &vendor_id); + if ( r == AMDSMI_STATUS_SUCCESS) + info->subvendor_id = static_cast(vendor_id); + + return AMDSMI_STATUS_SUCCESS; } amdsmi_status_t amdsmi_dev_temp_metric_get(amdsmi_device_handle device_handle, @@ -274,7 +295,8 @@ amdsmi_status_t amdsmi_get_vram_usage(amdsmi_device_handle device_handle, sizeof(struct drm_amdgpu_memory_info), >t); if (r != AMDSMI_STATUS_SUCCESS) return r; - vram_info->vram_total = static_cast(gtt.vram_size / (1024 * 1024)); + vram_info->vram_total = static_cast( + gtt.vram_size / (1024 * 1024)); r = gpu_device->amdgpu_query_info(AMDGPU_INFO_VRAM_USAGE, sizeof(vram_used), &vram_used); @@ -414,36 +436,49 @@ amdsmi_status_t amdsmi_dev_id_get(amdsmi_device_handle device_handle, return rsmi_wrapper(rsmi_dev_id_get, device_handle, id); } -// TODO(bliu) : add other asic info -amdsmi_status -amdsmi_get_asic_info(amdsmi_device_handle dev, amdsmi_asic_info_t *info) { - if (info == nullptr) - return AMDSMI_STATUS_INVAL; - - // Set init value - memset(info, 0, sizeof(amdsmi_asic_info_t)); - - // ignore errors to set multiple properties - uint16_t vendor_id = 0; - amdsmi_status status = rsmi_wrapper(rsmi_dev_vendor_id_get, dev, - &vendor_id); - if (status == AMDSMI_STATUS_SUCCESS) - info->vendor_id = vendor_id; - - // TODO(bliu) : get unique_id from rocm-smi and then covert to string - // status = rsmi_wrapper(rsmi_dev_unique_id_get, dev, &(info->unique_id)); - - return AMDSMI_STATUS_SUCCESS; -} - -// TODO(bliu) : get all fw info +// TODO(bliu) : add fw info from libdrm amdsmi_status amdsmi_get_fw_info(amdsmi_device_handle dev, amdsmi_fw_info_t *info) { + const std::map fw_in_rsmi = { + { FW_ID_ASD, RSMI_FW_BLOCK_ASD}, + { FW_ID_CP_CE, RSMI_FW_BLOCK_CE}, + { FW_ID_DMCU, RSMI_FW_BLOCK_DMCU}, + { FW_ID_MC, RSMI_FW_BLOCK_MC}, + { FW_ID_CP_ME, RSMI_FW_BLOCK_ME}, + { FW_ID_CP_MEC1, RSMI_FW_BLOCK_MEC}, + { FW_ID_CP_MEC2, RSMI_FW_BLOCK_MEC2}, + { FW_ID_CP_PFP, RSMI_FW_BLOCK_PFP}, + { FW_ID_RLC, RSMI_FW_BLOCK_RLC}, + { FW_ID_RLC_RESTORE_LIST_CNTL, RSMI_FW_BLOCK_RLC_SRLC}, + { FW_ID_RLC_RESTORE_LIST_GPM_MEM, RSMI_FW_BLOCK_RLC_SRLG}, + { FW_ID_RLC_RESTORE_LIST_SRM_MEM, RSMI_FW_BLOCK_RLC_SRLS}, + { FW_ID_SDMA0, RSMI_FW_BLOCK_SDMA}, + { FW_ID_SDMA1, RSMI_FW_BLOCK_SDMA2}, + { FW_ID_SMC, RSMI_FW_BLOCK_SMC}, + { FW_ID_PSP_SOSDRV, RSMI_FW_BLOCK_SOS}, + { FW_ID_TA_RAS, RSMI_FW_BLOCK_TA_RAS}, + { FW_ID_XGMI, RSMI_FW_BLOCK_TA_XGMI}, + { FW_ID_UVD, RSMI_FW_BLOCK_UVD}, + { FW_ID_VCE, RSMI_FW_BLOCK_VCE}, + { FW_ID_VCN, RSMI_FW_BLOCK_VCN} + }; + if (info == nullptr) return AMDSMI_STATUS_INVAL; - auto status = AMDSMI_STATUS_SUCCESS; - // rsmi_wrapper(rsmi_dev_firmware_version_get, dev, &(info->unique_id)); - return status; + memset(info, 0, sizeof(amdsmi_fw_info_t)); + + // 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, dev, + (*ite).second, + &(info->fw_info_list[info->num_fw_info].fw_version)); + if (status == AMDSMI_STATUS_SUCCESS) { + info->fw_info_list[info->num_fw_info].fw_id = (*ite).first; + info->num_fw_info++; + } + } + + return AMDSMI_STATUS_SUCCESS; } @@ -463,11 +498,6 @@ amdsmi_status_t amdsmi_dev_vendor_name_get( return rsmi_wrapper(rsmi_dev_vendor_name_get, device_handle, name, len); } -amdsmi_status_t amdsmi_dev_subsystem_vendor_id_get( - amdsmi_device_handle device_handle, uint16_t *id) { - return rsmi_wrapper(rsmi_dev_subsystem_vendor_id_get, device_handle, id); -} - amdsmi_status_t amdsmi_dev_vram_vendor_get(amdsmi_device_handle device_handle, char *brand, uint32_t len) { return rsmi_wrapper(rsmi_dev_vram_vendor_get, device_handle, brand, len); @@ -694,9 +724,91 @@ amdsmi_func_iter_value_get(amdsmi_func_id_iter_handle_t handle, amdsmi_func_id_value_t *value) { if (value == nullptr) return AMDSMI_STATUS_INVAL; + + static const std::map rsmi_2_amdsmi = { + {"rsmi_dev_vram_vendor_get", "amdsmi_dev_vram_vendor_get"}, + {"rsmi_dev_id_get", "amdsmi_dev_id_get"}, + {"rsmi_dev_vendor_id_get", "amdsmi_get_asic_info"}, + {"rsmi_dev_name_get", "amdsmi_get_board_info"}, + {"rsmi_dev_sku_get", "amdsmi_get_board_info"}, + {"rsmi_dev_brand_get", "amdsmi_get_asic_info"}, + {"rsmi_dev_vendor_name_get", "amdsmi_dev_vendor_name_get"}, + {"rsmi_dev_serial_number_get", "amdsmi_get_asic_info"}, + {"rsmi_dev_subsystem_id_get", "amdsmi_dev_subsystem_id_get"}, + {"rsmi_dev_subsystem_name_get", "amdsmi_dev_subsystem_name_get"}, + {"rsmi_dev_drm_render_minor_get", "amdsmi_dev_drm_render_minor_get"}, + {"rsmi_dev_subsystem_vendor_id_get", "amdsmi_get_asic_info"}, + {"rsmi_dev_unique_id_get", "amdsmi_get_board_info"}, + {"rsmi_dev_pci_bandwidth_get", "amdsmi_dev_pci_bandwidth_get"}, + {"rsmi_dev_pci_id_get", "amdsmi_dev_pci_id_get"}, + {"rsmi_dev_pci_throughput_get", "amdsmi_dev_pci_throughput_get"}, + {"rsmi_dev_pci_replay_counter_get", "amdsmi_dev_pci_replay_counter_get"}, + {"rsmi_dev_pci_bandwidth_set", "amdsmi_dev_pci_bandwidth_set"}, + {"rsmi_dev_power_profile_set", "amdsmi_dev_power_profile_set"}, + {"rsmi_dev_memory_busy_percent_get", "amdsmi_dev_memory_busy_percent_get"}, + {"rsmi_dev_busy_percent_get", "amdsmi_dev_busy_percent_get"}, + {"rsmi_dev_memory_reserved_pages_get", "amdsmi_dev_memory_reserved_pages_get"}, + {"rsmi_dev_overdrive_level_get", "amdsmi_dev_overdrive_level_get"}, + {"rsmi_dev_power_profile_presets_get", "amdsmi_dev_power_profile_presets_get"}, + {"rsmi_dev_perf_level_set", "amdsmi_dev_perf_level_set"}, + {"rsmi_dev_perf_level_set_v1", "amdsmi_dev_perf_level_set_v1"}, + {"rsmi_dev_perf_level_get", "amdsmi_dev_perf_level_get"}, + {"rsmi_perf_determinism_mode_set", "amdsmi_perf_determinism_mode_set"}, + {"rsmi_dev_overdrive_level_set", "amdsmi_dev_overdrive_level_set"}, + {"rsmi_dev_vbios_version_get", "amdsmi_get_vbios_info"}, + {"rsmi_dev_od_volt_info_get", "amdsmi_dev_od_volt_info_get"}, + {"rsmi_dev_od_volt_info_set", "amdsmi_dev_od_volt_info_set"}, + {"rsmi_dev_od_volt_curve_regions_get", "amdsmi_dev_od_volt_curve_regions_get"}, + {"rsmi_dev_ecc_enabled_get", "amdsmi_dev_ecc_enabled_get"}, + {"rsmi_dev_ecc_status_get", "amdsmi_dev_ecc_status_get"}, + {"rsmi_dev_counter_group_supported", "amdsmi_dev_counter_group_supported"}, + {"rsmi_dev_counter_create", "amdsmi_dev_counter_create"}, + {"rsmi_dev_xgmi_error_status", "amdsmi_dev_xgmi_error_status"}, + {"rsmi_dev_xgmi_error_reset", "amdsmi_dev_xgmi_error_reset"}, + {"rsmi_dev_memory_reserved_pages_get", "amdsmi_dev_memory_reserved_pages_get"}, + {"rsmi_topo_numa_affinity_get", "amdsmi_topo_numa_affinity_get"}, + {"rsmi_dev_gpu_metrics_info_get", "amdsmi_dev_gpu_metrics_info_get"}, + {"rsmi_dev_gpu_reset", "amdsmi_dev_gpu_reset"}, + {"rsmi_dev_memory_total_get", "amdsmi_dev_memory_total_get"}, + {"rsmi_dev_memory_usage_get", "amdsmi_dev_memory_usage_get"}, + {"rsmi_dev_gpu_clk_freq_get", "amdsmi_dev_gpu_clk_freq_get"}, + {"rsmi_dev_gpu_clk_freq_set", "amdsmi_dev_gpu_clk_freq_set"}, + {"rsmi_dev_firmware_version_get", "amdsmi_get_fw_info"}, + {"rsmi_dev_ecc_count_get", "amdsmi_dev_ecc_count_get"}, + {"rsmi_counter_available_counters_get", "amdsmi_counter_available_counters_get"}, + {"rsmi_dev_power_ave_get", "amdsmi_dev_power_ave_get"}, + {"rsmi_dev_power_cap_get", "amdsmi_get_power_cap_info"}, + {"rsmi_dev_power_cap_default_get", "amdsmi_get_power_cap_info"}, + {"rsmi_dev_power_cap_range_get", "amdsmi_get_power_cap_info"}, + {"rsmi_dev_power_cap_set", "amdsmi_dev_power_cap_set"}, + {"rsmi_dev_fan_rpms_get", "amdsmi_dev_fan_rpms_get"}, + {"rsmi_dev_fan_speed_get", "amdsmi_dev_fan_speed_get"}, + {"rsmi_dev_fan_speed_max_get", "amdsmi_dev_fan_speed_max_get"}, + {"rsmi_dev_temp_metric_get", "amdsmi_dev_temp_metric_get"}, + {"rsmi_dev_fan_reset", "amdsmi_dev_fan_reset"}, + {"rsmi_dev_fan_speed_set", "amdsmi_dev_fan_speed_set"}, + {"rsmi_dev_volt_metric_get", "amdsmi_dev_volt_metric_get"} + }; + + auto rocm_func_handle = + reinterpret_cast(handle); + auto r = rsmi_func_iter_value_get( - reinterpret_cast(handle), + rocm_func_handle, reinterpret_cast(value)); + + if ( r != RSMI_STATUS_SUCCESS ) + return rsmi_to_amdsmi_status(r); + + // Only change the function name, FUNC_ITER == 0 + if (rocm_func_handle->id_type != 0) + return rsmi_to_amdsmi_status(r); + + auto iter = rsmi_2_amdsmi.find(value->name); + if (iter != rsmi_2_amdsmi.end()) { + value->name = (*iter).second; + } + return rsmi_to_amdsmi_status(r); } @@ -770,7 +882,7 @@ amdsmi_status_t amdsmi_dev_gpu_metrics_info_get( reinterpret_cast(pgpu_metrics)); } -// TODO(bliu): read from libdrm +// TODO(bliu): read from libdrm amdsmi_status amdsmi_get_power_cap_info(amdsmi_device_handle device_handle, uint32_t sensor_ind, @@ -1080,3 +1192,19 @@ amdsmi_status_t amdsmi_version_str_get(amdsmi_sw_component_t component, return rsmi_to_amdsmi_status(status); } +amdsmi_status amdsmi_get_gpu_activity(amdsmi_device_handle dev, + amdsmi_engine_usage_t *info) { + if (info == nullptr) + return AMDSMI_STATUS_INVAL; + + // Get gpu activity from the gpu_metrics table + amdsmi_gpu_metrics_t gpu_metrics_info; + auto r = amdsmi_dev_gpu_metrics_info_get(dev, &gpu_metrics_info); + if ( r == AMDSMI_STATUS_SUCCESS ) { + info->average_gfx_activity = gpu_metrics_info.average_gfx_activity; + info->average_umc_activity = gpu_metrics_info.average_umc_activity; + info->average_mm_activity[0] = gpu_metrics_info.average_mm_activity; + } + + return r; +} diff --git a/tests/amd_smi_test/functional/frequencies_read_write.cc b/tests/amd_smi_test/functional/frequencies_read_write.cc index e6a6cdc752..19f630448b 100755 --- a/tests/amd_smi_test/functional/frequencies_read_write.cc +++ b/tests/amd_smi_test/functional/frequencies_read_write.cc @@ -112,7 +112,7 @@ void TestFrequenciesReadWrite::Run(void) { // Skip CLOCK_TYPE_PCIE, which does not supported in rocm-smi. std::cout << amdsmi_clk << std::endl; if (amdsmi_clk == CLOCK_TYPE_PCIE) - return true; + return false; ret = amdsmi_dev_gpu_clk_freq_get(device_handles_[dv_ind], amdsmi_clk, &f); std::cout << ret << std::endl; @@ -158,6 +158,11 @@ void TestFrequenciesReadWrite::Run(void) { ": Not supported on this machine. Skipping..." << std::endl; ret = AMDSMI_STATUS_SUCCESS; return; + } else if (ret == AMDSMI_STATUS_NOT_SUPPORTED) { + std::cout << "\t**Set " << FreqEnumToStr(amdsmi_clk) << + ": Not supported on this machine. Skipping..." << std::endl; + ret = AMDSMI_STATUS_SUCCESS; + return; } CHK_ERR_ASRT(ret) ret = amdsmi_dev_gpu_clk_freq_get(device_handles_[dv_ind], amdsmi_clk, &f); diff --git a/tests/amd_smi_test/functional/id_info_read.cc b/tests/amd_smi_test/functional/id_info_read.cc index 3e968460de..e68da1f524 100755 --- a/tests/amd_smi_test/functional/id_info_read.cc +++ b/tests/amd_smi_test/functional/id_info_read.cc @@ -207,21 +207,12 @@ void TestIdInfoRead::Run(void) { err = amdsmi_dev_subsystem_name_get(device_handles_[i], nullptr, kBufferLen); ASSERT_EQ(err, AMDSMI_STATUS_INVAL); } - err = amdsmi_dev_subsystem_vendor_id_get(device_handles_[i], &id); - if (err == AMDSMI_STATUS_NOT_SUPPORTED) { - // Verify api support checking functionality is working - err = amdsmi_dev_subsystem_vendor_id_get(device_handles_[i], nullptr); - ASSERT_EQ(err, AMDSMI_STATUS_NOT_SUPPORTED); - } else { - CHK_ERR_ASRT(err) - IF_VERB(STANDARD) { + + IF_VERB(STANDARD) { std::cout << "\t**Sub-system Vendor ID: 0x" << std::hex << - id << std::endl; - } - // Verify api support checking functionality is working - err = amdsmi_dev_subsystem_vendor_id_get(device_handles_[i], nullptr); - ASSERT_EQ(err, AMDSMI_STATUS_INVAL); + asci_info.subvendor_id << std::endl; } + err = amdsmi_dev_vendor_name_get(device_handles_[i], buffer, kBufferLen); if (err == AMDSMI_STATUS_NOT_SUPPORTED) { std::cout << diff --git a/tests/amd_smi_test/functional/mutual_exclusion.cc b/tests/amd_smi_test/functional/mutual_exclusion.cc index 1f3bf74b70..f94123e82b 100755 --- a/tests/amd_smi_test/functional/mutual_exclusion.cc +++ b/tests/amd_smi_test/functional/mutual_exclusion.cc @@ -215,8 +215,6 @@ void TestMutualExclusion::Run(void) { CHECK_RET(ret, AMDSMI_STATUS_BUSY); ret = amdsmi_dev_subsystem_id_get(device_handles_[0], &dmy_ui16); CHECK_RET(ret, AMDSMI_STATUS_BUSY); - ret = amdsmi_dev_subsystem_vendor_id_get(device_handles_[0], &dmy_ui16); - CHECK_RET(ret, AMDSMI_STATUS_BUSY); ret = amdsmi_dev_pci_id_get(device_handles_[0], &dmy_ui64); CHECK_RET(ret, AMDSMI_STATUS_BUSY); ret = amdsmi_dev_pci_throughput_get(device_handles_[0], &dmy_ui64, &dmy_ui64, &dmy_ui64); diff --git a/tests/amd_smi_test/test_base.cc b/tests/amd_smi_test/test_base.cc index 999508fcbc..c8c6018851 100644 --- a/tests/amd_smi_test/test_base.cc +++ b/tests/amd_smi_test/test_base.cc @@ -163,25 +163,23 @@ void TestBase::PrintDeviceHeader(amdsmi_device_handle dv_ind) { CHK_ERR_ASRT(err) IF_VERB(STANDARD) { std::cout << "\t**Device name: " << board_info.product_name << std::endl; + + err = amdsmi_get_asic_info(dv_ind, &info); + CHK_ERR_ASRT(err) + IF_VERB(STANDARD) { + std::cout << "\t**Device Vendor ID: 0x" << std::hex << + info.vendor_id << std::endl; + } } - err = amdsmi_get_asic_info(dv_ind, &info); - CHK_ERR_ASRT(err) - IF_VERB(STANDARD) { - std::cout << "\t**Device Vendor ID: 0x" << std::hex << info.vendor_id << - std::endl; - } err = amdsmi_dev_subsystem_id_get(dv_ind, &val_ui16); CHK_ERR_ASRT(err) IF_VERB(STANDARD) { std::cout << "\t**Subsystem ID: 0x" << std::hex << val_ui16 << std::endl; + std::cout << "\t**Subsystem Vendor ID: 0x" << std::hex + << info.subvendor_id << std::endl; } - err = amdsmi_dev_subsystem_vendor_id_get(dv_ind, &val_ui16); - CHK_ERR_ASRT(err) - IF_VERB(STANDARD) { - std::cout << "\t**Subsystem Vendor ID: 0x" << std::hex << val_ui16 << - std::endl; - } + std::cout << std::setbase(10); } void TestBase::Run(void) {