Processor Discovery#
Functions | |
amdsmi_status_t | amdsmi_get_processor_handles (amdsmi_socket_handle socket_handle, uint32_t *processor_count, amdsmi_processor_handle *processor_handles) |
Returns a list of AMD GPU devices in the system. More... | |
amdsmi_status_t | amdsmi_get_processor_type (amdsmi_processor_handle processor_handle, processor_type_t *processor_type) |
Get the processor type. More... | |
amdsmi_status_t | amdsmi_get_socket_handles (uint32_t *socket_count, amdsmi_socket_handle *socket_handles) |
Returns a list of socket handles in the system. NOT SUPPORTED YET, CURRENTLY HARDCODED TO RETURN EMPTY LIST. More... | |
amdsmi_status_t | amdsmi_get_socket_info (amdsmi_socket_handle socket_handle, size_t len, char *name) |
Returns socket information about given socket handle NOT SUPPORTED YET, CURRENTLY HARDCODED TO RETURN EMPTY VALUES. More... | |
amdsmi_status_t | amdsmi_get_processor_handle_from_bdf (amdsmi_bdf_t bdf, amdsmi_processor_handle *processor_handle) |
Returns processor handle (PF) from the given BDF. More... | |
amdsmi_status_t | amdsmi_get_index_from_processor_handle (amdsmi_processor_handle processor_handle, uint32_t *processor_index) |
Returns the index of the given processor handle. More... | |
amdsmi_status_t | amdsmi_get_vf_handle_from_bdf (amdsmi_bdf_t bdf, amdsmi_vf_handle_t *vf_handle) |
Returns VF handle from the given BDF. More... | |
amdsmi_status_t | amdsmi_get_gpu_device_bdf (amdsmi_processor_handle processor_handle, amdsmi_bdf_t *bdf) |
Returns BDF of the given processor (PF or VF). More... | |
amdsmi_status_t | amdsmi_get_processor_handle_from_index (uint32_t processor_index, amdsmi_processor_handle *processor_handle) |
Returns the processor handle from the given processor index. More... | |
amdsmi_status_t | amdsmi_get_vf_bdf (amdsmi_vf_handle_t vf_handle, amdsmi_bdf_t *bdf) |
Returns BDF of the given device (VF). More... | |
amdsmi_status_t | amdsmi_get_vf_handle_from_vf_index (amdsmi_processor_handle processor_handle, uint32_t fcn_idx, amdsmi_vf_handle_t *vf_handle) |
Returns the handle of a virtual function given its index. More... | |
amdsmi_status_t | amdsmi_get_vf_handle_from_uuid (const char *uuid, amdsmi_vf_handle_t *vf_handle) |
Returns the handle of a virtual function from the given UUID. More... | |
amdsmi_status_t | amdsmi_get_processor_handle_from_uuid (const char *uuid, amdsmi_processor_handle *processor_handle) |
Returns the processor handle from the given UUID. More... | |
amdsmi_status_t | amdsmi_get_gpu_device_uuid (amdsmi_processor_handle processor_handle, unsigned int *uuid_length, char *uuid) |
Returns the UUID of the processor. More... | |
amdsmi_status_t | amdsmi_get_vf_uuid (amdsmi_vf_handle_t processor_handle, unsigned int *uuid_length, char *uuid) |
Returns the UUID of the VF. More... | |
Detailed Description
Function Documentation
◆ amdsmi_get_processor_handles()
amdsmi_status_t amdsmi_get_processor_handles | ( | amdsmi_socket_handle | socket_handle, |
uint32_t * | processor_count, | ||
amdsmi_processor_handle * | processor_handles | ||
) |
Returns a list of AMD GPU devices in the system.
- Note
- This function fills the user-provided buffer with GPU device handles. The processor handles returned are used to instantiate the rest of processor queries in the library. If the buffer is not large enough the call will fail.
- Parameters
-
[in] socket_handle The socket to query. [in,out] processor_count As input, the size of the provided buffer. As output, number of processor handles in the buffer. Parameter must be allocated by user. [out] processor_handles Reference to list of processor handles returned by the library. Buffer must be allocated by user.
- Returns
- amdsmi_status_t | AMDSMI_STATUS_SUCCESS on success, non-zero on fail
◆ amdsmi_get_processor_type()
amdsmi_status_t amdsmi_get_processor_type | ( | amdsmi_processor_handle | processor_handle, |
processor_type_t * | processor_type | ||
) |
Get the processor type.
Given a processor handle processor_handle
, this function will get its processor type.
- Parameters
-
[in] processor_handle a processor handle [out] processor_type a pointer to processor_type_t to which the processor type will be written. If this parameter is nullptr, this function will return AMDSMI_STATUS_INVAL.
- Returns
- amdsmi_status_t | AMDSMI_STATUS_SUCCESS on success, non-zero on fail
◆ amdsmi_get_socket_handles()
amdsmi_status_t amdsmi_get_socket_handles | ( | uint32_t * | socket_count, |
amdsmi_socket_handle * | socket_handles | ||
) |
Returns a list of socket handles in the system. NOT SUPPORTED YET, CURRENTLY HARDCODED TO RETURN EMPTY LIST.
- Parameters
-
[in,out] socket_count As input, the size of the provided buffer. As output, number of socket handles in the buffer. Parameter must be allocated by user. [out] socket_handles Reference to list of socket handles returned by the library. Buffer must be allocated by user.
- Returns
- amdsmi_status_t | AMDSMI_STATUS_SUCCESS on success, non-zero on fail
◆ amdsmi_get_socket_info()
amdsmi_status_t amdsmi_get_socket_info | ( | amdsmi_socket_handle | socket_handle, |
size_t | len, | ||
char * | name | ||
) |
Returns socket information about given socket handle NOT SUPPORTED YET, CURRENTLY HARDCODED TO RETURN EMPTY VALUES.
- Parameters
-
[in] socket_handle socket for which to query [in] len size of the allocated character array for the name of the socket [out] name Reference to character array representing name of the socket returned by the library. Character array must be allocated by user.
- Returns
- amdsmi_status_t | AMDSMI_STATUS_SUCCESS on success, non-zero on fail
◆ amdsmi_get_processor_handle_from_bdf()
amdsmi_status_t amdsmi_get_processor_handle_from_bdf | ( | amdsmi_bdf_t | bdf, |
amdsmi_processor_handle * | processor_handle | ||
) |
Returns processor handle (PF) from the given BDF.
- Parameters
-
[in] bdf BDF of the processor [out] processor_handle Reference to the processor handle. Must be allocated by user.
- Returns
- amdsmi_status_t | AMDSMI_STATUS_SUCCESS on success, non-zero on fail
◆ amdsmi_get_index_from_processor_handle()
amdsmi_status_t amdsmi_get_index_from_processor_handle | ( | amdsmi_processor_handle | processor_handle, |
uint32_t * | processor_index | ||
) |
Returns the index of the given processor handle.
- Parameters
-
[in] processor_handle Processor handle for which to query [out] processor_index Pointer to integer to store the processor index. Must be allocated by user.
- Returns
- amdsmi_status_t | AMDSMI_STATUS_SUCCESS on success, non-zero on fail
◆ amdsmi_get_vf_handle_from_bdf()
amdsmi_status_t amdsmi_get_vf_handle_from_bdf | ( | amdsmi_bdf_t | bdf, |
amdsmi_vf_handle_t * | vf_handle | ||
) |
Returns VF handle from the given BDF.
- Parameters
-
[in] bdf BDF of the VF [out] vf_handle Reference to the VF handle. Must be allocated by user.
- Returns
- amdsmi_status_t | AMDSMI_STATUS_SUCCESS on success, non-zero on fail
◆ amdsmi_get_gpu_device_bdf()
amdsmi_status_t amdsmi_get_gpu_device_bdf | ( | amdsmi_processor_handle | processor_handle, |
amdsmi_bdf_t * | bdf | ||
) |
Returns BDF of the given processor (PF or VF).
- Parameters
-
[in] processor_handle PF or VF for which to query [out] bdf Reference to BDF. Must be allocated by user.
- Returns
- amdsmi_status_t | AMDSMI_STATUS_SUCCESS on success, non-zero on fail
◆ amdsmi_get_processor_handle_from_index()
amdsmi_status_t amdsmi_get_processor_handle_from_index | ( | uint32_t | processor_index, |
amdsmi_processor_handle * | processor_handle | ||
) |
Returns the processor handle from the given processor index.
- Parameters
-
[in] processor_index Function processor_index to query [out] processor_handle Reference to the processor handle. Must be allocated by user.
- Returns
- amdsmi_status_t | AMDSMI_STATUS_SUCCESS on success, non-zero on fail
◆ amdsmi_get_vf_bdf()
amdsmi_status_t amdsmi_get_vf_bdf | ( | amdsmi_vf_handle_t | vf_handle, |
amdsmi_bdf_t * | bdf | ||
) |
Returns BDF of the given device (VF).
- Parameters
-
[in] vf_handle VF for which to query [out] bdf Reference to BDF. Must be allocated by user.
- Returns
- amdsmi_status_t | AMDSMI_STATUS_SUCCESS on success, non-zero on fail
◆ amdsmi_get_vf_handle_from_vf_index()
amdsmi_status_t amdsmi_get_vf_handle_from_vf_index | ( | amdsmi_processor_handle | processor_handle, |
uint32_t | fcn_idx, | ||
amdsmi_vf_handle_t * | vf_handle | ||
) |
Returns the handle of a virtual function given its index.
- Parameters
-
[in] processor_handle PF of a processor for which to query [in] fcn_idx Function index to query [out] vf_handle VF handle. Must be allocated by user.
- Returns
- amdsmi_status_t | AMDSMI_STATUS_SUCCESS on success, non-zero on fail
◆ amdsmi_get_vf_handle_from_uuid()
amdsmi_status_t amdsmi_get_vf_handle_from_uuid | ( | const char * | uuid, |
amdsmi_vf_handle_t * | vf_handle | ||
) |
Returns the handle of a virtual function from the given UUID.
- Parameters
-
[in] uuid Function UUID to query. [out] vf_handle Reference to the VF handle. Must be allocated by user.
- Returns
- amdsmi_status_t | AMDSMI_STATUS_SUCCESS on success, non-zero on fail
◆ amdsmi_get_processor_handle_from_uuid()
amdsmi_status_t amdsmi_get_processor_handle_from_uuid | ( | const char * | uuid, |
amdsmi_processor_handle * | processor_handle | ||
) |
Returns the processor handle from the given UUID.
- Parameters
-
[in] uuid Function UUID to query. [out] processor_handle Reference to the processor handle. Must be allocated by user.
- Returns
- amdsmi_status_t | AMDSMI_STATUS_SUCCESS on success, non-zero on fail
◆ amdsmi_get_gpu_device_uuid()
amdsmi_status_t amdsmi_get_gpu_device_uuid | ( | amdsmi_processor_handle | processor_handle, |
unsigned int * | uuid_length, | ||
char * | uuid | ||
) |
Returns the UUID of the processor.
- Parameters
-
[in] processor_handle PF for which to query [in,out] uuid_length Length of the uuid string. As inpout, must be equal or greater than AMDSMI_GPU_UUID_SIZE and be allocated by user. As output it is the length of the uuid string. [out] uuid Pointer to string to store the UUID. Must be allocated by user.
- Returns
- amdsmi_status_t | AMDSMI_STATUS_SUCCESS on success, non-zero on fail
◆ amdsmi_get_vf_uuid()
amdsmi_status_t amdsmi_get_vf_uuid | ( | amdsmi_vf_handle_t | processor_handle, |
unsigned int * | uuid_length, | ||
char * | uuid | ||
) |
Returns the UUID of the VF.
- Parameters
-
[in] processor_handle VF for which to query [in,out] uuid_length Length of the uuid string. As inpout, must be equal or greater than AMDSMI_GPU_UUID_SIZE and be allocated by user. As output it is the length of the uuid string. [out] uuid Pointer to string to store the UUID. Must be allocated by user.
- Returns
- amdsmi_status_t | AMDSMI_STATUS_SUCCESS on success, non-zero on fail