Processor Discovery

Processor Discovery#

AMD SMI: Processor Discovery
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_handleThe socket to query.
[in,out]processor_countAs input, the size of the provided buffer. As output, number of processor handles in the buffer. Parameter must be allocated by user.
[out]processor_handlesReference 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_handlea processor handle
[out]processor_typea 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_countAs input, the size of the provided buffer. As output, number of socket handles in the buffer. Parameter must be allocated by user.
[out]socket_handlesReference 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_handlesocket for which to query
[in]lensize of the allocated character array for the name of the socket
[out]nameReference 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]bdfBDF of the processor
[out]processor_handleReference 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_handleProcessor handle for which to query
[out]processor_indexPointer 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]bdfBDF of the VF
[out]vf_handleReference 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_handlePF or VF for which to query
[out]bdfReference 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_indexFunction processor_index to query
[out]processor_handleReference 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_handleVF for which to query
[out]bdfReference 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_handlePF of a processor for which to query
[in]fcn_idxFunction index to query
[out]vf_handleVF 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]uuidFunction UUID to query.
[out]vf_handleReference 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]uuidFunction UUID to query.
[out]processor_handleReference 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_handlePF for which to query
[in,out]uuid_lengthLength 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]uuidPointer 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_handleVF for which to query
[in,out]uuid_lengthLength 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]uuidPointer to string to store the UUID. Must be allocated by user.
Returns
amdsmi_status_t | AMDSMI_STATUS_SUCCESS on success, non-zero on fail