SWDEV-370223 - Change the name of the header to amdsmi.h
Change dev to device_handle throughout the file Change the pcie_info pcie_speed field type to uint32_t Add AMDSMI prefix before amdsmi_mm_ip enum Change-Id: I242145389ddc3f2ad05dfd6ca371640f4d118fc4 Signed-off-by: Dalibor Stanisavljevic <Dalibor.Stanisavljevic@amd.com>
This commit is contained in:
+2
-2
@@ -161,12 +161,12 @@ if(PYTHON3 AND PIP3)
|
||||
python_wrapper
|
||||
DEPENDS clang_tools_extract
|
||||
COMMAND mkdir -p ${CMAKE_CURRENT_BINARY_DIR}/amdsmi_wrapper
|
||||
COMMAND cp -r ${CMAKE_CURRENT_SOURCE_DIR}/include/amd_smi/amd_smi.h ${CMAKE_CURRENT_BINARY_DIR}/amdsmi_wrapper
|
||||
COMMAND cp -r ${CMAKE_CURRENT_SOURCE_DIR}/include/amd_smi/amdsmi.h ${CMAKE_CURRENT_BINARY_DIR}/amdsmi_wrapper
|
||||
COMMAND mkdir -p ${CMAKE_CURRENT_BINARY_DIR}/amdsmi_wrapper/amd_smi
|
||||
COMMAND cp ${CMAKE_CURRENT_SOURCE_DIR}/rocm_smi/include/rocm_smi/kfd_ioctl.h
|
||||
${CMAKE_CURRENT_BINARY_DIR}/amdsmi_wrapper/amd_smi/
|
||||
COMMAND
|
||||
python3 ${CMAKE_CURRENT_SOURCE_DIR}/tools/generator.py ${CMAKE_CURRENT_BINARY_DIR}/amdsmi_wrapper/amd_smi.h
|
||||
python3 ${CMAKE_CURRENT_SOURCE_DIR}/tools/generator.py ${CMAKE_CURRENT_BINARY_DIR}/amdsmi_wrapper/amdsmi.h
|
||||
${CMAKE_CURRENT_BINARY_DIR}/amdsmi_wrapper/ ${CMAKE_CURRENT_BINARY_DIR}/amdsmi_wrapper/
|
||||
COMMAND cp ${CMAKE_CURRENT_BINARY_DIR}/amdsmi_wrapper/amdsmi_wrapper.py
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/py-interface/
|
||||
|
||||
@@ -79,7 +79,7 @@ A simple "Hello World" type program that displays the temperature of detected de
|
||||
```c++
|
||||
#include <iostream>
|
||||
#include <vector>
|
||||
#include "amd_smi/amd_smi.h"
|
||||
#include "amd_smi/amdsmi.h"
|
||||
|
||||
int main() {
|
||||
amdsmi_status_t ret;
|
||||
|
||||
@@ -760,7 +760,7 @@ WARN_LOGFILE =
|
||||
# Note: If this tag is empty the current directory is searched.
|
||||
|
||||
INPUT = @CMAKE_CURRENT_SOURCE_DIR@/../README.md \
|
||||
@CMAKE_CURRENT_SOURCE_DIR@/../include/amd_smi/amd_smi.h
|
||||
@CMAKE_CURRENT_SOURCE_DIR@/../include/amd_smi/amdsmi.h
|
||||
|
||||
# This tag can be used to specify the character encoding of the source files
|
||||
# that doxygen parses. Internally doxygen uses the UTF-8 encoding. Doxygen uses
|
||||
|
||||
@@ -44,7 +44,7 @@
|
||||
#include <stdint.h>
|
||||
#include <unistd.h>
|
||||
|
||||
#include "amd_smi/amd_smi.h"
|
||||
#include "amd_smi/amdsmi.h"
|
||||
#include <bitset>
|
||||
#include <iostream>
|
||||
#include <pwd.h>
|
||||
|
||||
@@ -44,7 +44,7 @@
|
||||
#include <stdint.h>
|
||||
#include <unistd.h>
|
||||
|
||||
#include "amd_smi/amd_smi.h"
|
||||
#include "amd_smi/amdsmi.h"
|
||||
#include <bitset>
|
||||
#include <iostream>
|
||||
#include <pwd.h>
|
||||
|
||||
@@ -41,11 +41,11 @@
|
||||
*
|
||||
*/
|
||||
|
||||
#ifndef INCLUDE_AMD_SMI_H_
|
||||
#define INCLUDE_AMD_SMI_H_
|
||||
#ifndef INCLUDE_AMDSMI_H_
|
||||
#define INCLUDE_AMDSMI_H_
|
||||
|
||||
/**
|
||||
* @file amd_smi.h
|
||||
* @file amdsmi.h
|
||||
* @brief AMD System Management Interface API
|
||||
*/
|
||||
|
||||
@@ -88,7 +88,7 @@ typedef enum amdsmi_init_flags {
|
||||
#define AMDSMI_TIME_FORMAT "%02d:%02d:%02d.%03d"
|
||||
#define AMDSMI_DATE_FORMAT "%04d-%02d-%02d:%02d:%02d:%02d.%03d"
|
||||
|
||||
typedef enum amdsmi_mm_ip { MM_UVD, MM_VCE, MM_VCN, MM__MAX } amdsmi_mm_ip_t;
|
||||
typedef enum amdsmi_mm_ip { AMDSMI_MM_UVD, AMDSMI_MM_VCE, AMDSMI_MM_VCN, AMDSMI_MM__MAX } amdsmi_mm_ip_t;
|
||||
|
||||
typedef enum amdsmi_container_types {
|
||||
CONTAINER_LXC,
|
||||
@@ -1100,7 +1100,7 @@ typedef struct {
|
||||
*/
|
||||
typedef struct amdsmi_pcie_info {
|
||||
uint16_t pcie_lanes;
|
||||
uint16_t pcie_speed;
|
||||
uint32_t pcie_speed;
|
||||
} amdsmi_pcie_info_t;
|
||||
/**
|
||||
* @brief This structure contains information specific to a process.
|
||||
@@ -2151,30 +2151,30 @@ amdsmi_utilization_count_get(amdsmi_device_handle device_handle,
|
||||
/**
|
||||
* @brief Get current PCIE info of the device with provided device handle.
|
||||
*
|
||||
* @details Given a device handle @p dev, this function returns PCIE info of the
|
||||
* @details Given a device handle @p device_handle, this function returns PCIE info of the
|
||||
* given device.
|
||||
*
|
||||
* @param[in] dev a device handle
|
||||
* @param[in] device_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_device_handle dev, amdsmi_pcie_info_t *info);
|
||||
amdsmi_status_t amdsmi_get_pcie_link_status(amdsmi_device_handle device_handle, amdsmi_pcie_info_t *info);
|
||||
|
||||
/**
|
||||
* @brief Get max PCIe capabilities of the device with provided device handle.
|
||||
*
|
||||
* @details Given a device handle @p dev, this function returns PCIe caps info of the
|
||||
* @details Given a device handle @p device_handle, this function returns PCIe caps info of the
|
||||
* given device.
|
||||
*
|
||||
* @param[in] dev a device handle
|
||||
* @param[in] device_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_device_handle dev, amdsmi_pcie_info_t *info);
|
||||
amdsmi_status_t amdsmi_get_pcie_link_caps(amdsmi_device_handle device_handle, amdsmi_pcie_info_t *info);
|
||||
|
||||
/**
|
||||
* @brief Get the performance level of the device
|
||||
@@ -3580,19 +3580,19 @@ amdsmi_status_t amdsmi_event_notification_stop(amdsmi_device_handle device_handl
|
||||
/**
|
||||
* @brief Returns BDF of the given device
|
||||
*
|
||||
* @param[in] dev Device which to query
|
||||
* @param[in] device_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_device_handle dev, amdsmi_bdf_t *bdf);
|
||||
amdsmi_get_device_bdf(amdsmi_device_handle device_handle, amdsmi_bdf_t *bdf);
|
||||
|
||||
/**
|
||||
* @brief Returns the UUID of the device
|
||||
*
|
||||
* @param[in] dev Device which to query
|
||||
* @param[in] device_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
|
||||
@@ -3604,7 +3604,7 @@ amdsmi_get_device_bdf(amdsmi_device_handle dev, 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_device_handle dev, unsigned int *uuid_length, char *uuid);
|
||||
amdsmi_get_device_uuid(amdsmi_device_handle device_handle, unsigned int *uuid_length, char *uuid);
|
||||
|
||||
/*****************************************************************************/
|
||||
/** @defgroup swversion SW Version Information
|
||||
@@ -3614,7 +3614,7 @@ amdsmi_get_device_uuid(amdsmi_device_handle dev, unsigned int *uuid_length, char
|
||||
/**
|
||||
* @brief Returns the driver version information
|
||||
*
|
||||
* @param[in] dev Device which to query
|
||||
* @param[in] device_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
|
||||
@@ -3626,7 +3626,7 @@ amdsmi_get_device_uuid(amdsmi_device_handle dev, unsigned int *uuid_length, char
|
||||
* @return ::amdsmi_status_t | ::AMDSMI_STATUS_SUCCESS on success, non-zero on fail
|
||||
*/
|
||||
amdsmi_status_t
|
||||
amdsmi_get_driver_version(amdsmi_device_handle dev, int *length, char *version);
|
||||
amdsmi_get_driver_version(amdsmi_device_handle device_handle, int *length, char *version);
|
||||
|
||||
/** @} End swversion */
|
||||
|
||||
@@ -3642,7 +3642,7 @@ amdsmi_get_driver_version(amdsmi_device_handle dev, int *length, char *version);
|
||||
* the family, the vendor ID, the subvendor ID, the device ID,
|
||||
* the revision ID and the serial number.
|
||||
*
|
||||
* @param[in] dev Device which to query
|
||||
* @param[in] device_handle Device which to query
|
||||
*
|
||||
* @param[out] info Reference to static asic information structure.
|
||||
* Must be allocated by user.
|
||||
@@ -3650,12 +3650,12 @@ amdsmi_get_driver_version(amdsmi_device_handle dev, int *length, char *version);
|
||||
* @return ::amdsmi_status_t | ::AMDSMI_STATUS_SUCCESS on success, non-zero on fail
|
||||
*/
|
||||
amdsmi_status_t
|
||||
amdsmi_get_asic_info(amdsmi_device_handle dev, amdsmi_asic_info_t *info);
|
||||
amdsmi_get_asic_info(amdsmi_device_handle device_handle, amdsmi_asic_info_t *info);
|
||||
|
||||
/**
|
||||
* @brief Returns the board part number and board information for the requested device
|
||||
*
|
||||
* @param[in] dev Device which to query
|
||||
* @param[in] device_handle Device which to query
|
||||
*
|
||||
* @param[out] info Reference to board info structure.
|
||||
* Must be allocated by user.
|
||||
@@ -3663,13 +3663,13 @@ amdsmi_get_asic_info(amdsmi_device_handle dev, amdsmi_asic_info_t *info);
|
||||
* @return ::amdsmi_status_t | ::AMDSMI_STATUS_SUCCESS on success, non-zero on fail
|
||||
*/
|
||||
amdsmi_status_t
|
||||
amdsmi_get_board_info(amdsmi_device_handle dev, amdsmi_board_info_t *info);
|
||||
amdsmi_get_board_info(amdsmi_device_handle device_handle, amdsmi_board_info_t *info);
|
||||
|
||||
/**
|
||||
* @brief Returns the power caps as currently configured in the
|
||||
* system.
|
||||
*
|
||||
* @param[in] dev Device which to query
|
||||
* @param[in] device_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
|
||||
@@ -3678,13 +3678,13 @@ amdsmi_get_board_info(amdsmi_device_handle dev, amdsmi_board_info_t *info);
|
||||
* @return ::amdsmi_status_t | ::AMDSMI_STATUS_SUCCESS on success, non-zero on fail
|
||||
*/
|
||||
amdsmi_status_t
|
||||
amdsmi_get_power_cap_info(amdsmi_device_handle dev, uint32_t sensor_ind,
|
||||
amdsmi_get_power_cap_info(amdsmi_device_handle device_handle, uint32_t sensor_ind,
|
||||
amdsmi_power_cap_info_t *info);
|
||||
|
||||
/**
|
||||
* @brief Returns XGMI information for the GPU.
|
||||
*
|
||||
* @param[in] dev Device which to query
|
||||
* @param[in] device_handle Device which to query
|
||||
*
|
||||
* @param[out] info Reference to xgmi information structure. Must be
|
||||
* allocated by user.
|
||||
@@ -3693,13 +3693,13 @@ amdsmi_get_power_cap_info(amdsmi_device_handle dev, uint32_t sensor_ind,
|
||||
* @return ::amdsmi_status_t | ::AMDSMI_STATUS_SUCCESS on success, non-zero on fail
|
||||
*/
|
||||
amdsmi_status_t
|
||||
amdsmi_get_xgmi_info(amdsmi_device_handle dev, amdsmi_xgmi_info_t *info);
|
||||
amdsmi_get_xgmi_info(amdsmi_device_handle device_handle, amdsmi_xgmi_info_t *info);
|
||||
|
||||
/**
|
||||
* @brief Returns the device capabilities as currently configured in
|
||||
* the system
|
||||
*
|
||||
* @param[in] dev Device which to query
|
||||
* @param[in] device_handle Device which to query
|
||||
*
|
||||
* @param[out] info Reference to caps information structure. Must be
|
||||
* allocated by user.
|
||||
@@ -3707,7 +3707,7 @@ amdsmi_get_xgmi_info(amdsmi_device_handle dev, amdsmi_xgmi_info_t *info);
|
||||
* @return ::amdsmi_status_t | ::AMDSMI_STATUS_SUCCESS on success, non-zero on fail
|
||||
*/
|
||||
amdsmi_status_t
|
||||
amdsmi_get_caps_info(amdsmi_device_handle dev, amdsmi_gpu_caps_t *info);
|
||||
amdsmi_get_caps_info(amdsmi_device_handle device_handle, amdsmi_gpu_caps_t *info);
|
||||
|
||||
/** @} End asicinfo */
|
||||
|
||||
@@ -3719,19 +3719,19 @@ amdsmi_get_caps_info(amdsmi_device_handle dev, amdsmi_gpu_caps_t *info);
|
||||
/**
|
||||
* @brief Returns the firmware versions running on the device.
|
||||
*
|
||||
* @param[in] dev Device which to query
|
||||
* @param[in] device_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_device_handle dev, amdsmi_fw_info_t *info);
|
||||
amdsmi_get_fw_info(amdsmi_device_handle device_handle, amdsmi_fw_info_t *info);
|
||||
|
||||
/**
|
||||
* @brief Returns the static information for the vBIOS on the device.
|
||||
*
|
||||
* @param[in] dev Device which to query
|
||||
* @param[in] device_handle Device which to query
|
||||
*
|
||||
* @param[out] info Reference to static vBIOS information.
|
||||
* Must be allocated by user.
|
||||
@@ -3739,7 +3739,7 @@ amdsmi_get_fw_info(amdsmi_device_handle dev, 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_device_handle dev, amdsmi_vbios_info_t *info);
|
||||
amdsmi_get_vbios_info(amdsmi_device_handle device_handle, amdsmi_vbios_info_t *info);
|
||||
|
||||
/** @} End fwinfo */
|
||||
|
||||
@@ -3752,34 +3752,34 @@ amdsmi_get_vbios_info(amdsmi_device_handle dev, amdsmi_vbios_info_t *info);
|
||||
* @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] dev Device which to query
|
||||
* @param[in] device_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_device_handle dev, amdsmi_engine_usage_t *info);
|
||||
amdsmi_get_gpu_activity(amdsmi_device_handle device_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] dev Device which to query
|
||||
* @param[in] device_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_device_handle dev, amdsmi_power_measure_t *info);
|
||||
amdsmi_get_power_measure(amdsmi_device_handle device_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] dev Device which to query
|
||||
* @param[in] device_handle Device which to query
|
||||
*
|
||||
* @param[in] clk_type Enum representing the clock type to query.
|
||||
*
|
||||
@@ -3789,13 +3789,13 @@ amdsmi_get_power_measure(amdsmi_device_handle dev, amdsmi_power_measure_t *info)
|
||||
* @return ::amdsmi_status_t | ::AMDSMI_STATUS_SUCCESS on success, non-zero on fail
|
||||
*/
|
||||
amdsmi_status_t
|
||||
amdsmi_get_clock_measure(amdsmi_device_handle dev, amdsmi_clk_type_t clk_type, amdsmi_clk_measure_t *info);
|
||||
amdsmi_get_clock_measure(amdsmi_device_handle device_handle, amdsmi_clk_type_t clk_type, amdsmi_clk_measure_t *info);
|
||||
|
||||
/**
|
||||
* @brief Returns temperature measurements of the GPU.
|
||||
* The results are in °C.
|
||||
*
|
||||
* @param[in] dev Device which to query
|
||||
* @param[in] device_handle Device which to query
|
||||
*
|
||||
* @param[in] temp_type Enum representing the temperature type to query.
|
||||
*
|
||||
@@ -3805,13 +3805,13 @@ amdsmi_get_clock_measure(amdsmi_device_handle dev, amdsmi_clk_type_t clk_type, a
|
||||
* @return ::amdsmi_status_t | ::AMDSMI_STATUS_SUCCESS on success, non-zero on fail
|
||||
*/
|
||||
amdsmi_status_t
|
||||
amdsmi_get_temperature_measure(amdsmi_device_handle dev, amdsmi_temperature_type_t temp_type, amdsmi_temperature_t *info);
|
||||
amdsmi_get_temperature_measure(amdsmi_device_handle device_handle, amdsmi_temperature_type_t temp_type, amdsmi_temperature_t *info);
|
||||
|
||||
/**
|
||||
* @brief Returns temperature limit of the GPU.
|
||||
* The results are in °C.
|
||||
*
|
||||
* @param[in] dev Device which to query
|
||||
* @param[in] device_handle Device which to query
|
||||
*
|
||||
* @param[in] temp_type Enum representing the temperature type to query.
|
||||
*
|
||||
@@ -3821,13 +3821,13 @@ amdsmi_get_temperature_measure(amdsmi_device_handle dev, amdsmi_temperature_type
|
||||
* @return ::amdsmi_status_t | ::AMDSMI_STATUS_SUCCESS on success, non-zero on fail
|
||||
*/
|
||||
amdsmi_status_t
|
||||
amdsmi_get_temperature_limit(amdsmi_device_handle dev, amdsmi_temperature_type_t temp_type, amdsmi_temperature_limit_t *limit);
|
||||
amdsmi_get_temperature_limit(amdsmi_device_handle device_handle, amdsmi_temperature_type_t temp_type, amdsmi_temperature_limit_t *limit);
|
||||
|
||||
/**
|
||||
* @brief Returns power limit of the GPU.
|
||||
* The results are in W.
|
||||
*
|
||||
* @param[in] dev Device which to query
|
||||
* @param[in] device_handle Device which to query
|
||||
*
|
||||
* @param[out] limit Reference to the power limit.
|
||||
* Must be allocated by user.
|
||||
@@ -3835,13 +3835,13 @@ amdsmi_get_temperature_limit(amdsmi_device_handle dev, amdsmi_temperature_type_t
|
||||
* @return ::amdsmi_status_t | ::AMDSMI_STATUS_SUCCESS on success, non-zero on fail
|
||||
*/
|
||||
amdsmi_status_t
|
||||
amdsmi_get_power_limit(amdsmi_device_handle dev, amdsmi_power_limit_t *limit);
|
||||
amdsmi_get_power_limit(amdsmi_device_handle device_handle, amdsmi_power_limit_t *power);
|
||||
|
||||
/**
|
||||
* @brief Returns the VRAM usage (both total and used memory)
|
||||
* in MegaBytes.
|
||||
*
|
||||
* @param[in] dev Device which to query
|
||||
* @param[in] device_handle Device which to query
|
||||
*
|
||||
*
|
||||
* @param[out] info Reference to vram information.
|
||||
@@ -3850,7 +3850,7 @@ amdsmi_get_power_limit(amdsmi_device_handle dev, amdsmi_power_limit_t *limit);
|
||||
* @return ::amdsmi_status_t | ::AMDSMI_STATUS_SUCCESS on success, non-zero on fail
|
||||
*/
|
||||
amdsmi_status_t
|
||||
amdsmi_get_vram_usage(amdsmi_device_handle dev, amdsmi_vram_info_t *info);
|
||||
amdsmi_get_vram_usage(amdsmi_device_handle device_handle, amdsmi_vram_info_t *info);
|
||||
|
||||
/** @} End gpumon */
|
||||
|
||||
@@ -3863,7 +3863,7 @@ amdsmi_get_vram_usage(amdsmi_device_handle dev, amdsmi_vram_info_t *info);
|
||||
* @brief Returns current and supported frequency range
|
||||
* for the specified clock type.
|
||||
*
|
||||
* @param[in] dev Device which to query
|
||||
* @param[in] device_handle Device which to query
|
||||
*
|
||||
* @param[in] clk_type Clock type for which to get current and supported
|
||||
* frequency range.
|
||||
@@ -3874,7 +3874,7 @@ amdsmi_get_vram_usage(amdsmi_device_handle dev, amdsmi_vram_info_t *info);
|
||||
* @return ::amdsmi_status_t | ::AMDSMI_STATUS_SUCCESS on success, non-zero on fail
|
||||
*/
|
||||
amdsmi_status_t
|
||||
amdsmi_get_target_frequency_range(amdsmi_device_handle dev, amdsmi_clk_type_t clk_type, amdsmi_frequency_range_t *range);
|
||||
amdsmi_get_target_frequency_range(amdsmi_device_handle device_handle, amdsmi_clk_type_t clk_type, amdsmi_frequency_range_t *range);
|
||||
|
||||
/** @} End powermon */
|
||||
|
||||
@@ -3891,7 +3891,7 @@ amdsmi_get_target_frequency_range(amdsmi_device_handle dev, amdsmi_clk_type_t cl
|
||||
* sets max_processes to 0, the total number of processes will be
|
||||
* returned.
|
||||
*
|
||||
* @param[in] dev Device which to query
|
||||
* @param[in] device_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
|
||||
@@ -3905,12 +3905,12 @@ amdsmi_get_target_frequency_range(amdsmi_device_handle dev, amdsmi_clk_type_t cl
|
||||
* @return ::amdsmi_status_t | ::AMDSMI_STATUS_SUCCESS on success, non-zero on fail
|
||||
*/
|
||||
amdsmi_status_t
|
||||
amdsmi_get_process_list(amdsmi_device_handle dev, amdsmi_process_handle *list, uint32_t *max_processes);
|
||||
amdsmi_get_process_list(amdsmi_device_handle device_handle, amdsmi_process_handle *list, uint32_t *max_processes);
|
||||
|
||||
/**
|
||||
* @brief Returns the process information of a given process.
|
||||
*
|
||||
* @param[in] dev Device which to query
|
||||
* @param[in] device_handle Device which to query
|
||||
*
|
||||
* @param[in] process Handle of process to query.
|
||||
*
|
||||
@@ -3920,7 +3920,7 @@ amdsmi_get_process_list(amdsmi_device_handle dev, amdsmi_process_handle *list, u
|
||||
* @return ::amdsmi_status_t | ::AMDSMI_STATUS_SUCCESS on success, non-zero on fail
|
||||
*/
|
||||
amdsmi_status_t
|
||||
amdsmi_get_process_info(amdsmi_device_handle dev, amdsmi_process_handle process, amdsmi_proc_info_t *info);
|
||||
amdsmi_get_process_info(amdsmi_device_handle device_handle, amdsmi_process_handle process, amdsmi_proc_info_t *info);
|
||||
|
||||
/** @} End processinfo */
|
||||
|
||||
@@ -3933,7 +3933,7 @@ amdsmi_get_process_info(amdsmi_device_handle dev, amdsmi_process_handle process,
|
||||
* @brief Returns the number of ECC errors (correctable and
|
||||
* uncorrectable) in the given GPU.
|
||||
*
|
||||
* @param[in] dev Device which to query
|
||||
* @param[in] device_handle Device which to query
|
||||
*
|
||||
* @param[out] ec Reference to ecc error count structure.
|
||||
* Must be allocated by user.
|
||||
@@ -3941,11 +3941,11 @@ amdsmi_get_process_info(amdsmi_device_handle dev, amdsmi_process_handle process,
|
||||
* @return ::amdsmi_status_t | ::AMDSMI_STATUS_SUCCESS on success, non-zero on fail
|
||||
*/
|
||||
amdsmi_status_t
|
||||
amdsmi_get_ecc_error_count(amdsmi_device_handle dev, amdsmi_error_count_t *ec);
|
||||
amdsmi_get_ecc_error_count(amdsmi_device_handle device_handle, amdsmi_error_count_t *ec);
|
||||
|
||||
/** @} End eccinfo */
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif // __cplusplus
|
||||
#endif // INCLUDE_AMD_SMI_H_
|
||||
#endif // INCLUDE_AMDSMI_H_
|
||||
@@ -44,7 +44,7 @@
|
||||
#ifndef AMD_SMI_INCLUDE_AMD_SMI_DEVICE_H_
|
||||
#define AMD_SMI_INCLUDE_AMD_SMI_DEVICE_H_
|
||||
|
||||
#include "amd_smi/amd_smi.h"
|
||||
#include "amd_smi/amdsmi.h"
|
||||
|
||||
namespace amd {
|
||||
namespace smi {
|
||||
|
||||
@@ -48,7 +48,7 @@
|
||||
#include <vector>
|
||||
#include <memory>
|
||||
#include <mutex> // NOLINT
|
||||
#include "amd_smi/amd_smi.h"
|
||||
#include "amd_smi/amdsmi.h"
|
||||
#include "amd_smi/impl/amd_smi_lib_loader.h"
|
||||
|
||||
namespace amd {
|
||||
|
||||
@@ -44,7 +44,7 @@
|
||||
#ifndef AMD_SMI_INCLUDE_IMPL_AMD_SMI_GPU_DEVICE_H_
|
||||
#define AMD_SMI_INCLUDE_IMPL_AMD_SMI_GPU_DEVICE_H_
|
||||
|
||||
#include "amd_smi/amd_smi.h"
|
||||
#include "amd_smi/amdsmi.h"
|
||||
#include "amd_smi/impl/amd_smi_device.h"
|
||||
#include "amd_smi/impl/amd_smi_drm.h"
|
||||
#include "shared_mutex.h" // NOLINT
|
||||
|
||||
@@ -26,7 +26,7 @@ THE SOFTWARE.
|
||||
#include <map>
|
||||
#include <iostream>
|
||||
#include <mutex> // NOLINT(build/c++11)
|
||||
#include "amd_smi/amd_smi.h"
|
||||
#include "amd_smi/amdsmi.h"
|
||||
|
||||
|
||||
namespace amd {
|
||||
|
||||
@@ -47,7 +47,7 @@
|
||||
#include <string>
|
||||
#include <algorithm>
|
||||
#include <vector>
|
||||
#include "amd_smi/amd_smi.h"
|
||||
#include "amd_smi/amdsmi.h"
|
||||
#include "amd_smi/impl/amd_smi_device.h"
|
||||
|
||||
namespace amd {
|
||||
|
||||
@@ -46,7 +46,7 @@
|
||||
|
||||
#include <vector>
|
||||
#include <set>
|
||||
#include "amd_smi/amd_smi.h"
|
||||
#include "amd_smi/amdsmi.h"
|
||||
#include "amd_smi/impl/amd_smi_socket.h"
|
||||
#include "amd_smi/impl/amd_smi_device.h"
|
||||
#include "amd_smi/impl/amd_smi_drm.h"
|
||||
|
||||
@@ -21,7 +21,7 @@
|
||||
#ifndef AMD_SMI_INCLUDE_AMD_SMI_UTILS_H_
|
||||
#define AMD_SMI_INCLUDE_AMD_SMI_UTILS_H_
|
||||
|
||||
#include "amd_smi/amd_smi.h"
|
||||
#include "amd_smi/amdsmi.h"
|
||||
#include "amd_smi/impl/amd_smi_gpu_device.h"
|
||||
#include "rocm_smi/rocm_smi_utils.h"
|
||||
|
||||
|
||||
@@ -42,12 +42,10 @@ class AmdSmiRetCode(IntEnum):
|
||||
UNEXPECTED_DATA = amdsmi_wrapper.AMDSMI_STATUS_UNEXPECTED_DATA
|
||||
ERR_BUSY = amdsmi_wrapper.AMDSMI_STATUS_BUSY
|
||||
REFCOUNT_OVERFLOW = amdsmi_wrapper.AMDSMI_STATUS_REFCOUNT_OVERFLOW
|
||||
LIB_START = amdsmi_wrapper.AMDSMI_LIB_START
|
||||
FAIL_LOAD_MODULE = amdsmi_wrapper.AMDSMI_STATUS_FAIL_LOAD_MODULE
|
||||
FAIL_LOAD_SYMBOL = amdsmi_wrapper.AMDSMI_STATUS_FAIL_LOAD_SYMBOL
|
||||
DRM_ERROR = amdsmi_wrapper.AMDSMI_STATUS_DRM_ERROR
|
||||
ERR_IO = amdsmi_wrapper.AMDSMI_STATUS_IO
|
||||
FAULT = amdsmi_wrapper.AMDSMI_STATUS_FAULT
|
||||
API_FAILED = amdsmi_wrapper.AMDSMI_STATUS_API_FAILED
|
||||
TIMEOUT = amdsmi_wrapper.AMDSMI_STATUS_TIMEOUT
|
||||
NO_SLOT = amdsmi_wrapper.AMDSMI_STATUS_NO_SLOT
|
||||
@@ -97,11 +95,9 @@ class AmdSmiLibraryException(AmdSmiException):
|
||||
AmdSmiRetCode.NO_DATA: "AMDSMI_STATUS_NO_DATA - No data was found for given input",
|
||||
AmdSmiRetCode.UNEXPECTED_DATA: "AMDSMI_STATUS_UNEXPECTED_DATA - The data read or provided was unexpected",
|
||||
AmdSmiRetCode.REFCOUNT_OVERFLOW: "AMDSMI_STATUS_REFCOUNT_OVERFLOW - Internal reference counter exceeded INT32_MAX",
|
||||
AmdSmiRetCode.LIB_START: "AMDSMI_LIB_START - Lib start status",
|
||||
AmdSmiRetCode.FAIL_LOAD_MODULE: "AMDSMI_STATUS_FAIL_LOAD_MODULE - Fail to load lib",
|
||||
AmdSmiRetCode.FAIL_LOAD_SYMBOL: "AMDSMI_STATUS_FAIL_LOAD_SYMBOL - Fail to load symbol",
|
||||
AmdSmiRetCode.DRM_ERROR: "AMDSMI_STATUS_DRM_ERROR - Error when called libdrm",
|
||||
AmdSmiRetCode.FAULT: "AMDSMI_STATUS_FAULT - Bad address",
|
||||
AmdSmiRetCode.API_FAILED: "AMDSMI_STATUS_API_FAILED - API call failed",
|
||||
AmdSmiRetCode.TIMEOUT: "AMDSMI_STATUS_TIMEOUT - Timeout in API call",
|
||||
AmdSmiRetCode.NO_SLOT: "AMDSMI_STATUS_NO_SLOT - No more free slot",
|
||||
|
||||
@@ -51,9 +51,9 @@ class AmdSmiDeviceType(IntEnum):
|
||||
|
||||
|
||||
class AmdSmiMmIp(IntEnum):
|
||||
UVD = amdsmi_wrapper.MM_UVD
|
||||
VCE = amdsmi_wrapper.MM_VCE
|
||||
VCN = amdsmi_wrapper.MM_VCN
|
||||
UVD = amdsmi_wrapper.AMDSMI_MM_UVD
|
||||
VCE = amdsmi_wrapper.AMDSMI_MM_VCE
|
||||
VCN = amdsmi_wrapper.AMDSMI_MM_VCN
|
||||
|
||||
|
||||
class AmdSmiFWBlock(IntEnum):
|
||||
|
||||
@@ -193,15 +193,15 @@ amdsmi_init_flags_t__enumvalues = amdsmi_init_flags__enumvalues
|
||||
|
||||
# values for enumeration 'amdsmi_mm_ip'
|
||||
amdsmi_mm_ip__enumvalues = {
|
||||
0: 'MM_UVD',
|
||||
1: 'MM_VCE',
|
||||
2: 'MM_VCN',
|
||||
3: 'MM__MAX',
|
||||
0: 'AMDSMI_MM_UVD',
|
||||
1: 'AMDSMI_MM_VCE',
|
||||
2: 'AMDSMI_MM_VCN',
|
||||
3: 'AMDSMI_MM__MAX',
|
||||
}
|
||||
MM_UVD = 0
|
||||
MM_VCE = 1
|
||||
MM_VCN = 2
|
||||
MM__MAX = 3
|
||||
AMDSMI_MM_UVD = 0
|
||||
AMDSMI_MM_VCE = 1
|
||||
AMDSMI_MM_VCN = 2
|
||||
AMDSMI_MM__MAX = 3
|
||||
amdsmi_mm_ip = ctypes.c_uint32 # enum
|
||||
amdsmi_mm_ip_t = amdsmi_mm_ip
|
||||
amdsmi_mm_ip_t__enumvalues = amdsmi_mm_ip__enumvalues
|
||||
@@ -424,6 +424,15 @@ amdsmi_xgmi_info_t = amdsmi_xgmi_info
|
||||
class amdsmi_gpu_caps(Structure):
|
||||
pass
|
||||
|
||||
class amdsmi_gpu_caps_1(Structure):
|
||||
pass
|
||||
|
||||
amdsmi_gpu_caps_1._pack_ = 1 # source:False
|
||||
amdsmi_gpu_caps_1._fields_ = [
|
||||
('mm_ip_count', ctypes.c_ubyte),
|
||||
('mm_ip_list', ctypes.c_ubyte * 8),
|
||||
]
|
||||
|
||||
class amdsmi_gpu_caps_0(Structure):
|
||||
pass
|
||||
|
||||
@@ -435,15 +444,6 @@ amdsmi_gpu_caps_0._fields_ = [
|
||||
('PADDING_0', ctypes.c_ubyte * 2),
|
||||
]
|
||||
|
||||
class amdsmi_gpu_caps_1(Structure):
|
||||
pass
|
||||
|
||||
amdsmi_gpu_caps_1._pack_ = 1 # source:False
|
||||
amdsmi_gpu_caps_1._fields_ = [
|
||||
('mm_ip_count', ctypes.c_ubyte),
|
||||
('mm_ip_list', ctypes.c_ubyte * 8),
|
||||
]
|
||||
|
||||
amdsmi_gpu_caps._pack_ = 1 # source:False
|
||||
amdsmi_gpu_caps._fields_ = [
|
||||
('gfx', amdsmi_gpu_caps_0),
|
||||
@@ -644,6 +644,16 @@ amdsmi_process_handle = ctypes.c_uint32
|
||||
class amdsmi_process_info(Structure):
|
||||
pass
|
||||
|
||||
class amdsmi_process_info_1(Structure):
|
||||
pass
|
||||
|
||||
amdsmi_process_info_1._pack_ = 1 # source:False
|
||||
amdsmi_process_info_1._fields_ = [
|
||||
('gtt_mem', ctypes.c_uint64),
|
||||
('cpu_mem', ctypes.c_uint64),
|
||||
('vram_mem', ctypes.c_uint64),
|
||||
]
|
||||
|
||||
class amdsmi_process_info_0(Structure):
|
||||
pass
|
||||
|
||||
@@ -656,16 +666,6 @@ amdsmi_process_info_0._fields_ = [
|
||||
('dec', ctypes.c_uint16 * 8),
|
||||
]
|
||||
|
||||
class amdsmi_process_info_1(Structure):
|
||||
pass
|
||||
|
||||
amdsmi_process_info_1._pack_ = 1 # source:False
|
||||
amdsmi_process_info_1._fields_ = [
|
||||
('gtt_mem', ctypes.c_uint64),
|
||||
('cpu_mem', ctypes.c_uint64),
|
||||
('vram_mem', ctypes.c_uint64),
|
||||
]
|
||||
|
||||
amdsmi_process_info._pack_ = 1 # source:False
|
||||
amdsmi_process_info._fields_ = [
|
||||
('name', ctypes.c_char * 32),
|
||||
@@ -1296,7 +1296,8 @@ class amdsmi_pcie_info(Structure):
|
||||
amdsmi_pcie_info._pack_ = 1 # source:False
|
||||
amdsmi_pcie_info._fields_ = [
|
||||
('pcie_lanes', ctypes.c_uint16),
|
||||
('pcie_speed', ctypes.c_uint16),
|
||||
('PADDING_0', ctypes.c_ubyte * 2),
|
||||
('pcie_speed', ctypes.c_uint32),
|
||||
]
|
||||
|
||||
amdsmi_pcie_info_t = amdsmi_pcie_info
|
||||
@@ -1391,7 +1392,8 @@ __all__ = \
|
||||
'AMDSMI_MEM_PAGE_STATUS_UNRESERVABLE', 'AMDSMI_MEM_TYPE_FIRST',
|
||||
'AMDSMI_MEM_TYPE_GTT', 'AMDSMI_MEM_TYPE_LAST',
|
||||
'AMDSMI_MEM_TYPE_VIS_VRAM', 'AMDSMI_MEM_TYPE_VRAM',
|
||||
'AMDSMI_PWR_PROF_PRST_3D_FULL_SCR_MASK',
|
||||
'AMDSMI_MM_UVD', 'AMDSMI_MM_VCE', 'AMDSMI_MM_VCN',
|
||||
'AMDSMI_MM__MAX', 'AMDSMI_PWR_PROF_PRST_3D_FULL_SCR_MASK',
|
||||
'AMDSMI_PWR_PROF_PRST_BOOTUP_DEFAULT',
|
||||
'AMDSMI_PWR_PROF_PRST_COMPUTE_MASK',
|
||||
'AMDSMI_PWR_PROF_PRST_CUSTOM_MASK',
|
||||
@@ -1441,15 +1443,14 @@ __all__ = \
|
||||
'FW_ID_SDMA2', 'FW_ID_SDMA3', 'FW_ID_SDMA4', 'FW_ID_SDMA5',
|
||||
'FW_ID_SDMA6', 'FW_ID_SDMA7', 'FW_ID_SMC', 'FW_ID_SMU',
|
||||
'FW_ID_TA_RAS', 'FW_ID_UVD', 'FW_ID_VCE', 'FW_ID_VCN',
|
||||
'FW_ID_XGMI', 'FW_ID__MAX', 'MM_UVD', 'MM_VCE', 'MM_VCN',
|
||||
'MM__MAX', 'NON_AMD_CPU', 'NON_AMD_GPU', 'TEMPERATURE_TYPE_EDGE',
|
||||
'TEMPERATURE_TYPE_FIRST', 'TEMPERATURE_TYPE_HBM_0',
|
||||
'TEMPERATURE_TYPE_HBM_1', 'TEMPERATURE_TYPE_HBM_2',
|
||||
'TEMPERATURE_TYPE_HBM_3', 'TEMPERATURE_TYPE_JUNCTION',
|
||||
'TEMPERATURE_TYPE_PLX', 'TEMPERATURE_TYPE_VRAM',
|
||||
'TEMPERATURE_TYPE__MAX', 'UNKNOWN', '_AMDSMI_IO_LINK_TYPE',
|
||||
'amdsmi_asic_info_t', 'amdsmi_bdf_t', 'amdsmi_bit_field',
|
||||
'amdsmi_bit_field_t', 'amdsmi_board_info_t',
|
||||
'FW_ID_XGMI', 'FW_ID__MAX', 'NON_AMD_CPU', 'NON_AMD_GPU',
|
||||
'TEMPERATURE_TYPE_EDGE', 'TEMPERATURE_TYPE_FIRST',
|
||||
'TEMPERATURE_TYPE_HBM_0', 'TEMPERATURE_TYPE_HBM_1',
|
||||
'TEMPERATURE_TYPE_HBM_2', 'TEMPERATURE_TYPE_HBM_3',
|
||||
'TEMPERATURE_TYPE_JUNCTION', 'TEMPERATURE_TYPE_PLX',
|
||||
'TEMPERATURE_TYPE_VRAM', 'TEMPERATURE_TYPE__MAX', 'UNKNOWN',
|
||||
'_AMDSMI_IO_LINK_TYPE', 'amdsmi_asic_info_t', 'amdsmi_bdf_t',
|
||||
'amdsmi_bit_field', 'amdsmi_bit_field_t', 'amdsmi_board_info_t',
|
||||
'amdsmi_clk_measure_t', 'amdsmi_clk_type', 'amdsmi_clk_type_t',
|
||||
'amdsmi_clk_type_t__enumvalues', 'amdsmi_container_types',
|
||||
'amdsmi_container_types_t',
|
||||
@@ -1590,15 +1591,15 @@ amdsmi_init_flags_t__enumvalues = amdsmi_init_flags__enumvalues
|
||||
|
||||
# values for enumeration 'amdsmi_mm_ip'
|
||||
amdsmi_mm_ip__enumvalues = {
|
||||
0: 'MM_UVD',
|
||||
1: 'MM_VCE',
|
||||
2: 'MM_VCN',
|
||||
3: 'MM__MAX',
|
||||
0: 'AMDSMI_MM_UVD',
|
||||
1: 'AMDSMI_MM_VCE',
|
||||
2: 'AMDSMI_MM_VCN',
|
||||
3: 'AMDSMI_MM__MAX',
|
||||
}
|
||||
MM_UVD = 0
|
||||
MM_VCE = 1
|
||||
MM_VCN = 2
|
||||
MM__MAX = 3
|
||||
AMDSMI_MM_UVD = 0
|
||||
AMDSMI_MM_VCE = 1
|
||||
AMDSMI_MM_VCN = 2
|
||||
AMDSMI_MM__MAX = 3
|
||||
amdsmi_mm_ip = ctypes.c_uint32 # enum
|
||||
amdsmi_mm_ip_t = amdsmi_mm_ip
|
||||
amdsmi_mm_ip_t__enumvalues = amdsmi_mm_ip__enumvalues
|
||||
@@ -1700,7 +1701,8 @@ amdsmi_status_t = ctypes.c_uint32 # enum
|
||||
__all__ += \
|
||||
['AMDSMI_INIT_ALL_DEVICES', 'AMDSMI_INIT_AMD_CPUS',
|
||||
'AMDSMI_INIT_AMD_GPUS', 'AMDSMI_INIT_NON_AMD_CPUS',
|
||||
'AMDSMI_INIT_NON_AMD_GPUS', 'AMDSMI_LIB_START',
|
||||
'AMDSMI_INIT_NON_AMD_GPUS', 'AMDSMI_LIB_START', 'AMDSMI_MM_UVD',
|
||||
'AMDSMI_MM_VCE', 'AMDSMI_MM_VCN', 'AMDSMI_MM__MAX',
|
||||
'AMDSMI_STATUS_API_FAILED', 'AMDSMI_STATUS_BUSY',
|
||||
'AMDSMI_STATUS_DRM_ERROR', 'AMDSMI_STATUS_FAIL_LOAD_MODULE',
|
||||
'AMDSMI_STATUS_FAIL_LOAD_SYMBOL', 'AMDSMI_STATUS_FAULT',
|
||||
@@ -1718,9 +1720,8 @@ __all__ += \
|
||||
'AMDSMI_STATUS_SUCCESS', 'AMDSMI_STATUS_TIMEOUT',
|
||||
'AMDSMI_STATUS_UNEXPECTED_DATA', 'AMDSMI_STATUS_UNEXPECTED_SIZE',
|
||||
'AMDSMI_STATUS_UNKNOWN_ERROR', 'AMD_CPU', 'AMD_GPU',
|
||||
'CONTAINER_DOCKER', 'CONTAINER_LXC', 'MM_UVD', 'MM_VCE', 'MM_VCN',
|
||||
'MM__MAX', 'NON_AMD_CPU', 'NON_AMD_GPU', 'UNKNOWN',
|
||||
'amdsmi_container_types', 'amdsmi_container_types_t',
|
||||
'CONTAINER_DOCKER', 'CONTAINER_LXC', 'NON_AMD_CPU', 'NON_AMD_GPU',
|
||||
'UNKNOWN', 'amdsmi_container_types', 'amdsmi_container_types_t',
|
||||
'amdsmi_container_types_t__enumvalues', 'amdsmi_device_handle',
|
||||
'amdsmi_init_flags', 'amdsmi_init_flags_t',
|
||||
'amdsmi_init_flags_t__enumvalues', 'amdsmi_mm_ip',
|
||||
|
||||
+3
-3
@@ -39,7 +39,7 @@ set(SRC_LIST
|
||||
"${SRC_DIR}/fdinfo.cc"
|
||||
"${CMN_SRC_LIST}")
|
||||
set(INC_LIST
|
||||
"${INC_DIR}/amd_smi.h"
|
||||
"${INC_DIR}/amdsmi.h"
|
||||
"${INC_DIR}/impl/amd_smi_common.h"
|
||||
"${INC_DIR}/impl/amd_smi_device.h"
|
||||
"${INC_DIR}/impl/amd_smi_drm.h"
|
||||
@@ -113,7 +113,7 @@ install(
|
||||
LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
|
||||
ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} COMPONENT ${AMD_SMI_COMPONENT})
|
||||
|
||||
install(FILES ${PROJECT_SOURCE_DIR}/include/amd_smi/amd_smi.h DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/amd_smi)
|
||||
install(FILES ${PROJECT_SOURCE_DIR}/include/amd_smi/amdsmi.h DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/amd_smi)
|
||||
install(FILES ${PROJECT_SOURCE_DIR}/include/amd_smi/${AMD_SMI_TARGET}Config.h
|
||||
DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/amd_smi)
|
||||
install(FILES ${PROJECT_SOURCE_DIR}/rocm_smi/include/rocm_smi/kfd_ioctl.h
|
||||
@@ -138,7 +138,7 @@ if(DOXYGEN_FOUND AND LATEX_FOUND)
|
||||
add_custom_command(
|
||||
OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/latex/refman.tex
|
||||
COMMAND ${DOXYGEN_EXECUTABLE} ${CMAKE_CURRENT_BINARY_DIR}/Doxyfile
|
||||
DEPENDS ${PROJECT_SOURCE_DIR}/docs/amd_smi_doxygen.cfg "${PROJECT_SOURCE_DIR}/include/amd_smi/amd_smi.h"
|
||||
DEPENDS ${PROJECT_SOURCE_DIR}/docs/amd_smi_doxygen.cfg "${PROJECT_SOURCE_DIR}/include/amd_smi/amdsmi.h"
|
||||
WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR})
|
||||
add_custom_command(
|
||||
OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/latex/refman.pdf
|
||||
|
||||
+57
-58
@@ -56,7 +56,7 @@
|
||||
#include <map>
|
||||
#include <memory>
|
||||
#include <xf86drm.h>
|
||||
#include "amd_smi/amd_smi.h"
|
||||
#include "amd_smi/amdsmi.h"
|
||||
#include "amd_smi/impl/fdinfo.h"
|
||||
#include "amd_smi/impl/amd_smi_common.h"
|
||||
#include "amd_smi/impl/amd_smi_system.h"
|
||||
@@ -418,21 +418,21 @@ amdsmi_status_t amdsmi_get_caps_info(amdsmi_device_handle device_handle,
|
||||
if (r != AMDSMI_STATUS_SUCCESS) return r;
|
||||
|
||||
for (j = 0; j < uvd; j++)
|
||||
info->mm.mm_ip_list[count++] = MM_UVD;
|
||||
info->mm.mm_ip_list[count++] = AMDSMI_MM_UVD;
|
||||
|
||||
r = gpu_device->amdgpu_query_hw_ip(AMDGPU_INFO_HW_IP_COUNT,
|
||||
AMDGPU_HW_IP_UVD_ENC, sizeof(struct drm_amdgpu_info_device), &uvd_enc);
|
||||
if (r != AMDSMI_STATUS_SUCCESS) return r;
|
||||
|
||||
for (j = 0; j < uvd_enc; j++)
|
||||
info->mm.mm_ip_list[count++] = MM_UVD;
|
||||
info->mm.mm_ip_list[count++] = AMDSMI_MM_UVD;
|
||||
|
||||
r = gpu_device->amdgpu_query_hw_ip(AMDGPU_INFO_HW_IP_COUNT,
|
||||
AMDGPU_HW_IP_VCE, sizeof(struct drm_amdgpu_info_device), &vce);
|
||||
if (r != AMDSMI_STATUS_SUCCESS) return r;
|
||||
|
||||
for (j = 0; j < vce; j++)
|
||||
info->mm.mm_ip_list[count++] = MM_VCE;
|
||||
info->mm.mm_ip_list[count++] = AMDSMI_MM_VCE;
|
||||
|
||||
/* VCN is shared DEC/ENC check only ENC */
|
||||
r = gpu_device->amdgpu_query_hw_ip(AMDGPU_INFO_HW_IP_COUNT,
|
||||
@@ -441,7 +441,7 @@ amdsmi_status_t amdsmi_get_caps_info(amdsmi_device_handle device_handle,
|
||||
if (r != AMDSMI_STATUS_SUCCESS) return r;
|
||||
|
||||
for (j = 0; j < vcn_enc; j++)
|
||||
info->mm.mm_ip_list[count++] = MM_VCN;
|
||||
info->mm.mm_ip_list[count++] = AMDSMI_MM_VCN;
|
||||
|
||||
info->mm.mm_ip_count = static_cast<uint8_t>(count);
|
||||
|
||||
@@ -485,7 +485,7 @@ amdsmi_status_t amdsmi_dev_id_get(amdsmi_device_handle device_handle,
|
||||
}
|
||||
|
||||
// TODO(bliu) : add fw info from libdrm
|
||||
amdsmi_status_t amdsmi_get_fw_info(amdsmi_device_handle dev,
|
||||
amdsmi_status_t amdsmi_get_fw_info(amdsmi_device_handle device_handle,
|
||||
amdsmi_fw_info_t *info) {
|
||||
const std::map<amdsmi_fw_block, rsmi_fw_block_t> fw_in_rsmi = {
|
||||
{ FW_ID_ASD, RSMI_FW_BLOCK_ASD},
|
||||
@@ -517,7 +517,7 @@ amdsmi_status_t amdsmi_get_fw_info(amdsmi_device_handle dev,
|
||||
|
||||
// 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,
|
||||
auto status = rsmi_wrapper(rsmi_dev_firmware_version_get, device_handle,
|
||||
(*ite).second,
|
||||
&(info->fw_info_list[info->num_fw_info].fw_version));
|
||||
if (status == AMDSMI_STATUS_SUCCESS) {
|
||||
@@ -1308,14 +1308,14 @@ amdsmi_status_t amdsmi_version_str_get(amdsmi_sw_component_t component,
|
||||
}
|
||||
|
||||
amdsmi_status_t
|
||||
amdsmi_get_vbios_info(amdsmi_device_handle dev, amdsmi_vbios_info_t *info) {
|
||||
amdsmi_get_vbios_info(amdsmi_device_handle device_handle, amdsmi_vbios_info_t *info) {
|
||||
if (info == nullptr) {
|
||||
return AMDSMI_STATUS_INVAL;
|
||||
}
|
||||
struct drm_amdgpu_info_vbios vbios = {};
|
||||
|
||||
amd::smi::AMDSmiGPUDevice* gpu_device =
|
||||
static_cast<amd::smi::AMDSmiGPUDevice*>(dev);
|
||||
static_cast<amd::smi::AMDSmiGPUDevice*>(device_handle);
|
||||
amdsmi_status_t status;
|
||||
|
||||
if (gpu_device->check_if_drm_is_supported()){
|
||||
@@ -1332,7 +1332,7 @@ amdsmi_get_vbios_info(amdsmi_device_handle dev, amdsmi_vbios_info_t *info) {
|
||||
|
||||
// get vbios version string from rocm_smi
|
||||
char vbios_version[AMDSMI_NORMAL_STRING_LENGTH];
|
||||
status = rsmi_wrapper(rsmi_dev_vbios_version_get, dev,
|
||||
status = rsmi_wrapper(rsmi_dev_vbios_version_get, device_handle,
|
||||
vbios_version,
|
||||
AMDSMI_NORMAL_STRING_LENGTH);
|
||||
|
||||
@@ -1346,16 +1346,16 @@ amdsmi_get_vbios_info(amdsmi_device_handle dev, amdsmi_vbios_info_t *info) {
|
||||
}
|
||||
|
||||
amdsmi_status_t
|
||||
amdsmi_get_gpu_activity(amdsmi_device_handle dev, amdsmi_engine_usage_t *info) {
|
||||
amdsmi_get_gpu_activity(amdsmi_device_handle device_handle, amdsmi_engine_usage_t *info) {
|
||||
if (info == nullptr) {
|
||||
return AMDSMI_STATUS_INVAL;
|
||||
}
|
||||
|
||||
amdsmi_gpu_metrics_t metrics = {};
|
||||
amd::smi::AMDSmiGPUDevice* gpu_device =
|
||||
static_cast<amd::smi::AMDSmiGPUDevice*>(dev);
|
||||
static_cast<amd::smi::AMDSmiGPUDevice*>(device_handle);
|
||||
amdsmi_status_t status;
|
||||
status = amdsmi_dev_gpu_metrics_info_get(dev, &metrics);
|
||||
status = amdsmi_dev_gpu_metrics_info_get(device_handle, &metrics);
|
||||
if (status != AMDSMI_STATUS_SUCCESS) {
|
||||
return status;
|
||||
}
|
||||
@@ -1367,41 +1367,40 @@ amdsmi_get_gpu_activity(amdsmi_device_handle dev, amdsmi_engine_usage_t *info) {
|
||||
}
|
||||
|
||||
amdsmi_status_t
|
||||
amdsmi_get_power_limit(amdsmi_device_handle dev, amdsmi_power_limit_t *limit) {
|
||||
if (limit == nullptr) {
|
||||
amdsmi_get_power_limit(amdsmi_device_handle device_handle, amdsmi_power_limit_t *power) {
|
||||
if (power == nullptr) {
|
||||
return AMDSMI_STATUS_INVAL;
|
||||
}
|
||||
|
||||
amd::smi::AMDSmiGPUDevice* gpu_device =
|
||||
static_cast<amd::smi::AMDSmiGPUDevice*>(dev);
|
||||
static_cast<amd::smi::AMDSmiGPUDevice*>(device_handle);
|
||||
amdsmi_status_t status;
|
||||
int power_limit;
|
||||
status = smi_amdgpu_get_power_cap(gpu_device, &power_limit);
|
||||
if (status != AMDSMI_STATUS_SUCCESS) {
|
||||
return status;
|
||||
}
|
||||
limit->limit = (uint16_t)(power_limit);
|
||||
power->limit = (uint16_t)(power_limit);
|
||||
|
||||
return AMDSMI_STATUS_SUCCESS;
|
||||
}
|
||||
|
||||
amdsmi_status_t
|
||||
amdsmi_get_clock_measure(amdsmi_device_handle dev, amdsmi_clk_type_t clk_type, amdsmi_clk_measure_t *info) {
|
||||
amdsmi_get_clock_measure(amdsmi_device_handle device_handle, amdsmi_clk_type_t clk_type, amdsmi_clk_measure_t *info) {
|
||||
if (info == nullptr) {
|
||||
return AMDSMI_STATUS_INVAL;
|
||||
}
|
||||
|
||||
if (clk_type >= CLK_TYPE__MAX) {
|
||||
printf("Domain value greater or equals CLK_TYPE__MAX value. Return code: %d", AMDSMI_STATUS_INVAL);
|
||||
if (clk_type > CLK_TYPE__MAX) {
|
||||
return AMDSMI_STATUS_INVAL;
|
||||
}
|
||||
|
||||
amdsmi_gpu_metrics_t metrics = {};
|
||||
amd::smi::AMDSmiGPUDevice* gpu_device =
|
||||
static_cast<amd::smi::AMDSmiGPUDevice*>(dev);
|
||||
static_cast<amd::smi::AMDSmiGPUDevice*>(device_handle);
|
||||
amdsmi_status_t status;
|
||||
|
||||
status = amdsmi_dev_gpu_metrics_info_get(dev, &metrics);
|
||||
status = amdsmi_dev_gpu_metrics_info_get(device_handle, &metrics);
|
||||
if (status != AMDSMI_STATUS_SUCCESS) {
|
||||
return status;
|
||||
}
|
||||
@@ -1438,12 +1437,12 @@ amdsmi_get_clock_measure(amdsmi_device_handle dev, amdsmi_clk_type_t clk_type, a
|
||||
}
|
||||
|
||||
amdsmi_status_t
|
||||
amdsmi_get_temperature_limit(amdsmi_device_handle dev, amdsmi_temperature_type_t temp_type, amdsmi_temperature_limit_t *limit) {
|
||||
if (limit == nullptr || temp_type >= TEMPERATURE_TYPE__MAX) {
|
||||
amdsmi_get_temperature_limit(amdsmi_device_handle device_handle, amdsmi_temperature_type_t temp_type, amdsmi_temperature_limit_t *temp) {
|
||||
if (temp == nullptr || temp_type > TEMPERATURE_TYPE__MAX) {
|
||||
return AMDSMI_STATUS_INVAL;
|
||||
}
|
||||
amd::smi::AMDSmiGPUDevice* gpu_device =
|
||||
static_cast<amd::smi::AMDSmiGPUDevice*>(dev);
|
||||
static_cast<amd::smi::AMDSmiGPUDevice*>(device_handle);
|
||||
amdsmi_status_t status;
|
||||
std::string name;
|
||||
std::string path;
|
||||
@@ -1469,12 +1468,12 @@ amdsmi_get_temperature_limit(amdsmi_device_handle dev, amdsmi_temperature_type_t
|
||||
for (int count = 1; ; count++) {
|
||||
std::string local_path = path + "/temp" +
|
||||
std::to_string(count);
|
||||
std::string temp = local_path + "_label";
|
||||
std::string local_temp = local_path + "_label";
|
||||
char f_name[10];
|
||||
std::ifstream file(temp.c_str(), std::ifstream::in);
|
||||
std::ifstream file(local_temp.c_str(), std::ifstream::in);
|
||||
|
||||
if (!file.is_open()) {
|
||||
printf("Failed to open file: %s \n", temp.c_str());
|
||||
printf("Failed to open file: %s \n", local_temp.c_str());
|
||||
return AMDSMI_STATUS_API_FAILED;
|
||||
}
|
||||
|
||||
@@ -1482,11 +1481,11 @@ amdsmi_get_temperature_limit(amdsmi_device_handle dev, amdsmi_temperature_type_t
|
||||
|
||||
if (!strstr(name.c_str(), f_name)) {
|
||||
int readTemp = 0;
|
||||
temp = local_path + "_crit";
|
||||
std::ifstream file2(temp.c_str(), std::ifstream::in);
|
||||
local_temp = local_path + "_crit";
|
||||
std::ifstream file2(local_temp.c_str(), std::ifstream::in);
|
||||
|
||||
if (!file2.is_open()) {
|
||||
printf("Failed to open file: %s \n", temp.c_str());
|
||||
printf("Failed to open file: %s \n", local_temp.c_str());
|
||||
return AMDSMI_STATUS_API_FAILED;
|
||||
}
|
||||
|
||||
@@ -1494,7 +1493,7 @@ amdsmi_get_temperature_limit(amdsmi_device_handle dev, amdsmi_temperature_type_t
|
||||
if (!sscanf(f_name, "%d", &readTemp)) {
|
||||
return AMDSMI_STATUS_API_FAILED;
|
||||
}
|
||||
limit->limit = (uint16_t)(readTemp / 1000);
|
||||
temp->limit = (uint16_t)(readTemp / 1000);
|
||||
break;
|
||||
}
|
||||
file.close();
|
||||
@@ -1503,16 +1502,16 @@ amdsmi_get_temperature_limit(amdsmi_device_handle dev, amdsmi_temperature_type_t
|
||||
return AMDSMI_STATUS_SUCCESS;
|
||||
}
|
||||
amdsmi_status_t
|
||||
amdsmi_get_temperature_measure(amdsmi_device_handle dev, amdsmi_temperature_type_t temp_type, amdsmi_temperature_t *info) {
|
||||
amdsmi_get_temperature_measure(amdsmi_device_handle device_handle, amdsmi_temperature_type_t temp_type, amdsmi_temperature_t *info) {
|
||||
if (info == nullptr || temp_type > TEMPERATURE_TYPE__MAX) {
|
||||
return AMDSMI_STATUS_INVAL;
|
||||
}
|
||||
|
||||
amdsmi_gpu_metrics_t metrics;
|
||||
amd::smi::AMDSmiGPUDevice* gpu_device =
|
||||
static_cast<amd::smi::AMDSmiGPUDevice*>(dev);
|
||||
static_cast<amd::smi::AMDSmiGPUDevice*>(device_handle);
|
||||
amdsmi_status_t status;
|
||||
status = amdsmi_dev_gpu_metrics_info_get(dev, &metrics);
|
||||
status = amdsmi_dev_gpu_metrics_info_get(device_handle, &metrics);
|
||||
if (status != AMDSMI_STATUS_SUCCESS) {
|
||||
return status;
|
||||
}
|
||||
@@ -1578,13 +1577,13 @@ amdsmi_get_bad_page_info(amdsmi_device_handle device_handle, uint32_t *num_pages
|
||||
}
|
||||
|
||||
amdsmi_status_t
|
||||
amdsmi_get_ecc_error_count(amdsmi_device_handle dev, amdsmi_error_count_t *ec) {
|
||||
amdsmi_get_ecc_error_count(amdsmi_device_handle device_handle, amdsmi_error_count_t *ec) {
|
||||
if (ec == nullptr) {
|
||||
return AMDSMI_STATUS_INVAL;
|
||||
}
|
||||
|
||||
amd::smi::AMDSmiGPUDevice* gpu_device =
|
||||
static_cast<amd::smi::AMDSmiGPUDevice*>(dev);
|
||||
static_cast<amd::smi::AMDSmiGPUDevice*>(device_handle);
|
||||
amdsmi_status_t status;
|
||||
if (gpu_device->check_if_drm_is_supported()){
|
||||
status = smi_amdgpu_get_ecc_error_count(gpu_device, ec);
|
||||
@@ -1600,7 +1599,7 @@ amdsmi_get_ecc_error_count(amdsmi_device_handle dev, amdsmi_error_count_t *ec) {
|
||||
}
|
||||
|
||||
amdsmi_status_t
|
||||
amdsmi_get_process_list(amdsmi_device_handle dev, amdsmi_process_handle *list, uint32_t *max_processes) {
|
||||
amdsmi_get_process_list(amdsmi_device_handle device_handle, amdsmi_process_handle *list, uint32_t *max_processes) {
|
||||
if (max_processes == nullptr) {
|
||||
return AMDSMI_STATUS_INVAL;
|
||||
}
|
||||
@@ -1610,7 +1609,7 @@ amdsmi_get_process_list(amdsmi_device_handle dev, amdsmi_process_handle *list, u
|
||||
uint64_t size = 0;
|
||||
amdsmi_status_t status;
|
||||
amd::smi::AMDSmiGPUDevice* gpu_device =
|
||||
static_cast<amd::smi::AMDSmiGPUDevice*>(dev);
|
||||
static_cast<amd::smi::AMDSmiGPUDevice*>(device_handle);
|
||||
if (gpu_device->check_if_drm_is_supported()){
|
||||
amdsmi_bdf_t bdf = gpu_device->get_bdf();
|
||||
status = gpuvsmi_get_pids(bdf, pids, &size);
|
||||
@@ -1643,13 +1642,13 @@ amdsmi_get_process_list(amdsmi_device_handle dev, amdsmi_process_handle *list, u
|
||||
}
|
||||
|
||||
amdsmi_status_t
|
||||
amdsmi_get_process_info(amdsmi_device_handle dev, amdsmi_process_handle process, amdsmi_proc_info_t *info) {
|
||||
amdsmi_get_process_info(amdsmi_device_handle device_handle, amdsmi_process_handle process, amdsmi_proc_info_t *info) {
|
||||
if (info == nullptr) {
|
||||
return AMDSMI_STATUS_INVAL;
|
||||
}
|
||||
|
||||
amd::smi::AMDSmiGPUDevice* gpu_device =
|
||||
static_cast<amd::smi::AMDSmiGPUDevice*>(dev);
|
||||
static_cast<amd::smi::AMDSmiGPUDevice*>(device_handle);
|
||||
amdsmi_status_t status;
|
||||
if (gpu_device->check_if_drm_is_supported()) {
|
||||
status = gpuvsmi_get_pid_info(gpu_device->get_bdf(), process, *info);
|
||||
@@ -1663,24 +1662,24 @@ amdsmi_get_process_info(amdsmi_device_handle dev, amdsmi_process_handle process,
|
||||
}
|
||||
|
||||
amdsmi_status_t
|
||||
amdsmi_get_power_measure(amdsmi_device_handle dev, amdsmi_power_measure_t *info) {
|
||||
amdsmi_get_power_measure(amdsmi_device_handle device_handle, amdsmi_power_measure_t *info) {
|
||||
if (info == nullptr) {
|
||||
return AMDSMI_STATUS_INVAL;
|
||||
}
|
||||
|
||||
amdsmi_gpu_metrics_t metrics = {};
|
||||
amd::smi::AMDSmiGPUDevice* gpu_device =
|
||||
static_cast<amd::smi::AMDSmiGPUDevice*>(dev);
|
||||
static_cast<amd::smi::AMDSmiGPUDevice*>(device_handle);
|
||||
amdsmi_status_t status;
|
||||
|
||||
status = amdsmi_dev_gpu_metrics_info_get(dev, &metrics);
|
||||
status = amdsmi_dev_gpu_metrics_info_get(device_handle, &metrics);
|
||||
if (status != AMDSMI_STATUS_SUCCESS) {
|
||||
return status;
|
||||
}
|
||||
|
||||
int64_t voltage_read = 0;
|
||||
|
||||
status = amdsmi_dev_volt_metric_get(dev, AMDSMI_VOLT_TYPE_VDDGFX, AMDSMI_VOLT_CURRENT, &voltage_read);
|
||||
status = amdsmi_dev_volt_metric_get(device_handle, AMDSMI_VOLT_TYPE_VDDGFX, AMDSMI_VOLT_CURRENT, &voltage_read);
|
||||
if (status != AMDSMI_STATUS_SUCCESS) {
|
||||
return status;
|
||||
}
|
||||
@@ -1694,18 +1693,18 @@ amdsmi_get_power_measure(amdsmi_device_handle dev, amdsmi_power_measure_t *info)
|
||||
}
|
||||
|
||||
amdsmi_status_t
|
||||
amdsmi_get_target_frequency_range(amdsmi_device_handle dev, amdsmi_clk_type_t clk_type, amdsmi_frequency_range_t *range) {
|
||||
amdsmi_get_target_frequency_range(amdsmi_device_handle device_handle, amdsmi_clk_type_t clk_type, amdsmi_frequency_range_t *range) {
|
||||
if (range == nullptr || clk_type > CLK_TYPE__MAX) {
|
||||
return AMDSMI_STATUS_INVAL;
|
||||
}
|
||||
|
||||
amdsmi_gpu_metrics_t metrics = {};
|
||||
amd::smi::AMDSmiGPUDevice* gpu_device =
|
||||
static_cast<amd::smi::AMDSmiGPUDevice*>(dev);
|
||||
static_cast<amd::smi::AMDSmiGPUDevice*>(device_handle);
|
||||
amdsmi_status_t status;
|
||||
|
||||
int min = 0, max = 0;
|
||||
status = amdsmi_dev_gpu_metrics_info_get(dev, &metrics);
|
||||
status = amdsmi_dev_gpu_metrics_info_get(device_handle, &metrics);
|
||||
if (status != AMDSMI_STATUS_SUCCESS) {
|
||||
return status;
|
||||
}
|
||||
@@ -1740,26 +1739,26 @@ amdsmi_get_target_frequency_range(amdsmi_device_handle dev, amdsmi_clk_type_t cl
|
||||
}
|
||||
|
||||
amdsmi_status_t
|
||||
amdsmi_get_driver_version(amdsmi_device_handle dev, int *length, char *version) {
|
||||
amdsmi_get_driver_version(amdsmi_device_handle device_handle, int *length, char *version) {
|
||||
if (length == nullptr || version == nullptr) {
|
||||
return AMDSMI_STATUS_INVAL;
|
||||
}
|
||||
amdsmi_status_t status = AMDSMI_STATUS_SUCCESS;
|
||||
amd::smi::AMDSmiGPUDevice* gpu_device =
|
||||
static_cast<amd::smi::AMDSmiGPUDevice*>(dev);
|
||||
static_cast<amd::smi::AMDSmiGPUDevice*>(device_handle);
|
||||
status = smi_amdgpu_get_driver_version(gpu_device, length, version);
|
||||
|
||||
return status;
|
||||
}
|
||||
|
||||
amdsmi_status_t
|
||||
amdsmi_get_device_uuid(amdsmi_device_handle dev, unsigned int *uuid_length, char *uuid) {
|
||||
amdsmi_get_device_uuid(amdsmi_device_handle device_handle, unsigned int *uuid_length, char *uuid) {
|
||||
if (uuid_length == nullptr || uuid == nullptr) {
|
||||
return AMDSMI_STATUS_INVAL;
|
||||
}
|
||||
|
||||
amd::smi::AMDSmiGPUDevice* gpu_device =
|
||||
static_cast<amd::smi::AMDSmiGPUDevice*>(dev);
|
||||
static_cast<amd::smi::AMDSmiGPUDevice*>(device_handle);
|
||||
amdsmi_status_t status = AMDSMI_STATUS_SUCCESS;
|
||||
SMIGPUDEVICE_MUTEX(gpu_device->get_mutex())
|
||||
|
||||
@@ -1770,7 +1769,7 @@ amdsmi_get_device_uuid(amdsmi_device_handle dev, unsigned int *uuid_length, char
|
||||
const uint8_t fcn = 0xff;
|
||||
|
||||
std::string path = "/sys/class/drm/" + gpu_device->get_gpu_path() + "/device/uuid_info";
|
||||
status = amdsmi_get_asic_info(dev, &asic_info);
|
||||
status = amdsmi_get_asic_info(device_handle, &asic_info);
|
||||
if (status != AMDSMI_STATUS_SUCCESS) {
|
||||
printf("Getting asic info failed. Return code: %d", status);
|
||||
return status;
|
||||
@@ -1796,14 +1795,14 @@ amdsmi_get_device_uuid(amdsmi_device_handle dev, unsigned int *uuid_length, char
|
||||
}
|
||||
|
||||
amdsmi_status_t
|
||||
amdsmi_get_pcie_link_status(amdsmi_device_handle dev, amdsmi_pcie_info_t *info){
|
||||
amdsmi_get_pcie_link_status(amdsmi_device_handle device_handle, amdsmi_pcie_info_t *info){
|
||||
if (info == nullptr) {
|
||||
return AMDSMI_STATUS_INVAL;
|
||||
}
|
||||
amdsmi_status_t status = AMDSMI_STATUS_SUCCESS;
|
||||
amdsmi_gpu_metrics_t metric_info = {};
|
||||
status = amdsmi_dev_gpu_metrics_info_get(
|
||||
dev, &metric_info);
|
||||
device_handle, &metric_info);
|
||||
if (status != AMDSMI_STATUS_SUCCESS)
|
||||
return status;
|
||||
|
||||
@@ -1813,14 +1812,14 @@ amdsmi_get_pcie_link_status(amdsmi_device_handle dev, amdsmi_pcie_info_t *info){
|
||||
return status;
|
||||
}
|
||||
|
||||
amdsmi_status_t amdsmi_get_pcie_link_caps(amdsmi_device_handle dev, amdsmi_pcie_info_t *info) {
|
||||
amdsmi_status_t amdsmi_get_pcie_link_caps(amdsmi_device_handle device_handle, amdsmi_pcie_info_t *info) {
|
||||
if (info == nullptr) {
|
||||
return AMDSMI_STATUS_INVAL;
|
||||
}
|
||||
|
||||
amdsmi_status_t status = AMDSMI_STATUS_SUCCESS;
|
||||
amd::smi::AMDSmiGPUDevice* gpu_device =
|
||||
static_cast<amd::smi::AMDSmiGPUDevice*>(dev);
|
||||
static_cast<amd::smi::AMDSmiGPUDevice*>(device_handle);
|
||||
|
||||
SMIGPUDEVICE_MUTEX(gpu_device->get_mutex())
|
||||
|
||||
@@ -1855,7 +1854,7 @@ amdsmi_status_t amdsmi_get_pcie_link_caps(amdsmi_device_handle dev, amdsmi_pcie_
|
||||
return AMDSMI_STATUS_API_FAILED;
|
||||
}
|
||||
|
||||
status = amdsmi_get_asic_info(dev, &asic_info);
|
||||
status = amdsmi_get_asic_info(device_handle, &asic_info);
|
||||
if (status != AMDSMI_STATUS_SUCCESS)
|
||||
return status;
|
||||
|
||||
|
||||
@@ -20,7 +20,7 @@
|
||||
* THE SOFTWARE.
|
||||
*/
|
||||
|
||||
#include "amd_smi/amd_smi.h"
|
||||
#include "amd_smi/amdsmi.h"
|
||||
#include "amd_smi/impl/amd_smi_uuid.h"
|
||||
|
||||
#include <string.h>
|
||||
|
||||
@@ -28,7 +28,7 @@
|
||||
#include <algorithm>
|
||||
#include <string.h>
|
||||
|
||||
#include "amd_smi/amd_smi.h"
|
||||
#include "amd_smi/amdsmi.h"
|
||||
#include "amd_smi/impl/amd_smi_utils.h"
|
||||
|
||||
extern "C" {
|
||||
|
||||
@@ -50,7 +50,7 @@
|
||||
#include <string>
|
||||
|
||||
#include <gtest/gtest.h>
|
||||
#include "amd_smi/amd_smi.h"
|
||||
#include "amd_smi/amdsmi.h"
|
||||
#include "api_support_read.h"
|
||||
#include "../test_common.h"
|
||||
#include "../test_utils.h"
|
||||
|
||||
@@ -47,7 +47,7 @@
|
||||
#include <iostream>
|
||||
|
||||
#include <gtest/gtest.h>
|
||||
#include "amd_smi/amd_smi.h"
|
||||
#include "amd_smi/amdsmi.h"
|
||||
#include "err_cnt_read.h"
|
||||
#include "../test_common.h"
|
||||
|
||||
|
||||
@@ -49,7 +49,7 @@
|
||||
#include <iostream>
|
||||
|
||||
#include <gtest/gtest.h>
|
||||
#include "amd_smi/amd_smi.h"
|
||||
#include "amd_smi/amdsmi.h"
|
||||
#include "evt_notif_read_write.h"
|
||||
#include "../test_common.h"
|
||||
#include "../test_utils.h"
|
||||
|
||||
@@ -49,7 +49,7 @@
|
||||
#include <iostream>
|
||||
|
||||
#include <gtest/gtest.h>
|
||||
#include "amd_smi/amd_smi.h"
|
||||
#include "amd_smi/amdsmi.h"
|
||||
#include "fan_read.h"
|
||||
#include "../test_common.h"
|
||||
|
||||
|
||||
@@ -49,7 +49,7 @@
|
||||
#include <iostream>
|
||||
|
||||
#include <gtest/gtest.h>
|
||||
#include "amd_smi/amd_smi.h"
|
||||
#include "amd_smi/amdsmi.h"
|
||||
#include "fan_read_write.h"
|
||||
#include "../test_common.h"
|
||||
|
||||
|
||||
@@ -50,7 +50,7 @@
|
||||
#include <string>
|
||||
|
||||
#include <gtest/gtest.h>
|
||||
#include "amd_smi/amd_smi.h"
|
||||
#include "amd_smi/amdsmi.h"
|
||||
#include "frequencies_read.h"
|
||||
#include "../test_common.h"
|
||||
|
||||
|
||||
@@ -53,7 +53,7 @@
|
||||
#include <algorithm>
|
||||
|
||||
#include <gtest/gtest.h>
|
||||
#include "amd_smi/amd_smi.h"
|
||||
#include "amd_smi/amdsmi.h"
|
||||
#include "frequencies_read_write.h"
|
||||
#include "../test_common.h"
|
||||
|
||||
|
||||
@@ -50,7 +50,7 @@
|
||||
#include <string>
|
||||
|
||||
#include <gtest/gtest.h>
|
||||
#include "amd_smi/amd_smi.h"
|
||||
#include "amd_smi/amdsmi.h"
|
||||
#include "gpu_busy_read.h"
|
||||
#include "../test_common.h"
|
||||
|
||||
|
||||
@@ -51,7 +51,7 @@
|
||||
#include <map>
|
||||
|
||||
#include <gtest/gtest.h>
|
||||
#include "amd_smi/amd_smi.h"
|
||||
#include "amd_smi/amdsmi.h"
|
||||
#include "gpu_metrics_read.h"
|
||||
#include "../test_common.h"
|
||||
|
||||
|
||||
@@ -51,7 +51,7 @@
|
||||
#include <vector>
|
||||
|
||||
#include <gtest/gtest.h>
|
||||
#include "amd_smi/amd_smi.h"
|
||||
#include "amd_smi/amdsmi.h"
|
||||
#include "hw_topology_read.h"
|
||||
#include "../test_common.h"
|
||||
|
||||
|
||||
@@ -48,7 +48,7 @@
|
||||
#include <string>
|
||||
|
||||
#include <gtest/gtest.h>
|
||||
#include "amd_smi/amd_smi.h"
|
||||
#include "amd_smi/amdsmi.h"
|
||||
#include "id_info_read.h"
|
||||
#include "../test_common.h"
|
||||
|
||||
|
||||
@@ -53,7 +53,7 @@
|
||||
|
||||
#include "init_shutdown_refcount.h"
|
||||
#include <gtest/gtest.h>
|
||||
#include "amd_smi/amd_smi.h"
|
||||
#include "amd_smi/amdsmi.h"
|
||||
#include "../test_common.h"
|
||||
|
||||
extern int32_t
|
||||
|
||||
@@ -48,7 +48,7 @@
|
||||
#include <string>
|
||||
|
||||
#include <gtest/gtest.h>
|
||||
#include "amd_smi/amd_smi.h"
|
||||
#include "amd_smi/amdsmi.h"
|
||||
#include "mem_page_info_read.h"
|
||||
#include "../test_common.h"
|
||||
|
||||
|
||||
@@ -49,7 +49,7 @@
|
||||
#include <map>
|
||||
|
||||
#include <gtest/gtest.h>
|
||||
#include "amd_smi/amd_smi.h"
|
||||
#include "amd_smi/amdsmi.h"
|
||||
#include "mem_util_read.h"
|
||||
#include "../test_common.h"
|
||||
|
||||
|
||||
@@ -51,7 +51,7 @@
|
||||
#include <map>
|
||||
|
||||
#include <gtest/gtest.h>
|
||||
#include "amd_smi/amd_smi.h"
|
||||
#include "amd_smi/amdsmi.h"
|
||||
#include "metrics_counter_read.h"
|
||||
#include "../test_common.h"
|
||||
|
||||
|
||||
@@ -51,7 +51,7 @@
|
||||
#include <map>
|
||||
|
||||
#include <gtest/gtest.h>
|
||||
#include "amd_smi/amd_smi.h"
|
||||
#include "amd_smi/amdsmi.h"
|
||||
#include "mutual_exclusion.h"
|
||||
#include "../test_common.h"
|
||||
|
||||
|
||||
@@ -50,7 +50,7 @@
|
||||
#include <string>
|
||||
|
||||
#include <gtest/gtest.h>
|
||||
#include "amd_smi/amd_smi.h"
|
||||
#include "amd_smi/amdsmi.h"
|
||||
#include "overdrive_read.h"
|
||||
#include "../test_common.h"
|
||||
|
||||
|
||||
@@ -49,7 +49,7 @@
|
||||
#include <iostream>
|
||||
|
||||
#include <gtest/gtest.h>
|
||||
#include "amd_smi/amd_smi.h"
|
||||
#include "amd_smi/amdsmi.h"
|
||||
#include "overdrive_read_write.h"
|
||||
#include "../test_common.h"
|
||||
|
||||
|
||||
@@ -49,7 +49,7 @@
|
||||
#include <algorithm>
|
||||
|
||||
#include <gtest/gtest.h>
|
||||
#include "amd_smi/amd_smi.h"
|
||||
#include "amd_smi/amdsmi.h"
|
||||
#include "pci_read_write.h"
|
||||
#include "../test_common.h"
|
||||
|
||||
|
||||
@@ -54,7 +54,7 @@
|
||||
#include <memory>
|
||||
|
||||
#include <gtest/gtest.h>
|
||||
#include "amd_smi/amd_smi.h"
|
||||
#include "amd_smi/amdsmi.h"
|
||||
#include "perf_cntr_read_write.h"
|
||||
#include "../test_common.h"
|
||||
|
||||
|
||||
@@ -53,7 +53,7 @@
|
||||
#include <algorithm>
|
||||
|
||||
#include <gtest/gtest.h>
|
||||
#include "amd_smi/amd_smi.h"
|
||||
#include "amd_smi/amdsmi.h"
|
||||
#include "perf_determinism.h"
|
||||
#include "../test_common.h"
|
||||
|
||||
|
||||
@@ -50,7 +50,7 @@
|
||||
#include <string>
|
||||
|
||||
#include <gtest/gtest.h>
|
||||
#include "amd_smi/amd_smi.h"
|
||||
#include "amd_smi/amdsmi.h"
|
||||
#include "perf_level_read.h"
|
||||
#include "../test_common.h"
|
||||
|
||||
|
||||
@@ -50,7 +50,7 @@
|
||||
#include <map>
|
||||
|
||||
#include <gtest/gtest.h>
|
||||
#include "amd_smi/amd_smi.h"
|
||||
#include "amd_smi/amdsmi.h"
|
||||
#include "perf_level_read_write.h"
|
||||
#include "../test_common.h"
|
||||
|
||||
|
||||
@@ -52,7 +52,7 @@
|
||||
#include <algorithm>
|
||||
|
||||
#include <gtest/gtest.h>
|
||||
#include "amd_smi/amd_smi.h"
|
||||
#include "amd_smi/amdsmi.h"
|
||||
#include "power_cap_read_write.h"
|
||||
#include "../test_common.h"
|
||||
|
||||
|
||||
@@ -50,7 +50,7 @@
|
||||
#include <string>
|
||||
|
||||
#include <gtest/gtest.h>
|
||||
#include "amd_smi/amd_smi.h"
|
||||
#include "amd_smi/amdsmi.h"
|
||||
#include "power_read.h"
|
||||
#include "../test_common.h"
|
||||
|
||||
|
||||
@@ -52,7 +52,7 @@
|
||||
#include <algorithm>
|
||||
|
||||
#include <gtest/gtest.h>
|
||||
#include "amd_smi/amd_smi.h"
|
||||
#include "amd_smi/amdsmi.h"
|
||||
#include "power_read_write.h"
|
||||
#include "../test_common.h"
|
||||
|
||||
|
||||
@@ -50,7 +50,7 @@
|
||||
#include <string>
|
||||
|
||||
#include <gtest/gtest.h>
|
||||
#include "amd_smi/amd_smi.h"
|
||||
#include "amd_smi/amdsmi.h"
|
||||
#include "process_info_read.h"
|
||||
#include "../test_common.h"
|
||||
|
||||
|
||||
@@ -50,7 +50,7 @@
|
||||
#include <string>
|
||||
|
||||
#include <gtest/gtest.h>
|
||||
#include "amd_smi/amd_smi.h"
|
||||
#include "amd_smi/amdsmi.h"
|
||||
#include "sys_info_read.h"
|
||||
#include "../test_common.h"
|
||||
#include "../test_utils.h"
|
||||
|
||||
@@ -51,7 +51,7 @@
|
||||
#include <map>
|
||||
|
||||
#include <gtest/gtest.h>
|
||||
#include "amd_smi/amd_smi.h"
|
||||
#include "amd_smi/amdsmi.h"
|
||||
#include "temp_read.h"
|
||||
#include "../test_common.h"
|
||||
|
||||
|
||||
@@ -50,7 +50,7 @@
|
||||
#include <map>
|
||||
|
||||
#include <gtest/gtest.h>
|
||||
#include "amd_smi/amd_smi.h"
|
||||
#include "amd_smi/amdsmi.h"
|
||||
#include "version_read.h"
|
||||
#include "../test_common.h"
|
||||
|
||||
|
||||
@@ -50,7 +50,7 @@
|
||||
#include <string>
|
||||
|
||||
#include <gtest/gtest.h>
|
||||
#include "amd_smi/amd_smi.h"
|
||||
#include "amd_smi/amdsmi.h"
|
||||
#include "volt_freq_curv_read.h"
|
||||
#include "../test_common.h"
|
||||
|
||||
|
||||
@@ -51,7 +51,7 @@
|
||||
#include <map>
|
||||
|
||||
#include <gtest/gtest.h>
|
||||
#include "amd_smi/amd_smi.h"
|
||||
#include "amd_smi/amdsmi.h"
|
||||
#include "volt_read.h"
|
||||
#include "../test_common.h"
|
||||
|
||||
|
||||
@@ -49,7 +49,7 @@
|
||||
#include <iostream>
|
||||
|
||||
#include <gtest/gtest.h>
|
||||
#include "amd_smi/amd_smi.h"
|
||||
#include "amd_smi/amdsmi.h"
|
||||
#include "xgmi_read_write.h"
|
||||
#include "../test_common.h"
|
||||
|
||||
|
||||
@@ -48,7 +48,7 @@
|
||||
#include <memory>
|
||||
#include <iostream>
|
||||
|
||||
#include "amd_smi/amd_smi.h"
|
||||
#include "amd_smi/amdsmi.h"
|
||||
#include <gtest/gtest.h>
|
||||
#include "test_common.h"
|
||||
#include "test_base.h"
|
||||
|
||||
@@ -45,7 +45,7 @@
|
||||
|
||||
#include <assert.h>
|
||||
|
||||
#include "amd_smi/amd_smi.h"
|
||||
#include "amd_smi/amdsmi.h"
|
||||
#include "test_base.h"
|
||||
#include "test_common.h"
|
||||
#include <gtest/gtest.h>
|
||||
|
||||
@@ -47,7 +47,7 @@
|
||||
|
||||
#include <string>
|
||||
#include <vector>
|
||||
#include "amd_smi/amd_smi.h"
|
||||
#include "amd_smi/amdsmi.h"
|
||||
|
||||
// The max devices can be monitored
|
||||
#define MAX_MONITOR_DEVICES 128
|
||||
|
||||
@@ -53,7 +53,7 @@
|
||||
|
||||
#include "test_base.h"
|
||||
#include "test_common.h"
|
||||
#include "amd_smi/amd_smi.h"
|
||||
#include "amd_smi/amdsmi.h"
|
||||
|
||||
static const std::map<amdsmi_dev_perf_level_t, const char *>
|
||||
kDevPerfLvlNameMap = {
|
||||
|
||||
@@ -50,7 +50,7 @@
|
||||
#include <vector>
|
||||
#include <string>
|
||||
|
||||
#include "amd_smi/amd_smi.h"
|
||||
#include "amd_smi/amdsmi.h"
|
||||
|
||||
struct AMDSMITstGlobals {
|
||||
uint32_t verbosity;
|
||||
|
||||
@@ -45,7 +45,7 @@
|
||||
|
||||
#include <map>
|
||||
|
||||
#include "amd_smi/amd_smi.h"
|
||||
#include "amd_smi/amdsmi.h"
|
||||
#include "test_utils.h"
|
||||
|
||||
static const std::map<amdsmi_fw_block_t, const char *> kDevFWNameMap = {
|
||||
|
||||
@@ -46,7 +46,7 @@
|
||||
#ifndef TESTS_AMD_SMI_TEST_TEST_UTILS_H_
|
||||
#define TESTS_AMD_SMI_TEST_TEST_UTILS_H_
|
||||
|
||||
#include "amd_smi/amd_smi.h"
|
||||
#include "amd_smi/amdsmi.h"
|
||||
|
||||
const char *
|
||||
NameFromFWEnum(amdsmi_fw_block_t blk);
|
||||
|
||||
Reference in New Issue
Block a user