XGMI info

XGMI info#

AMD SMI: XGMI info
XGMI info

Functions

amdsmi_status_t amdsmi_get_link_metrics (amdsmi_processor_handle processor_handle, amdsmi_link_metrics_t *link_metrics)
 Return link metric information. More...
 
amdsmi_status_t amdsmi_get_link_topology (amdsmi_processor_handle processor_handle_src, amdsmi_processor_handle processor_handle_dst, amdsmi_link_topology_t *topology_info)
 Return link topology information between two connected processors. More...
 
amdsmi_status_t amdsmi_get_link_topology_nearest (amdsmi_processor_handle processor_handle, amdsmi_link_type_t link_type, amdsmi_topology_nearest_t *topology_nearest_info)
 Retrieve the set of GPUs that are nearest to a given device at a specific interconnectivity level. More...
 
amdsmi_status_t amdsmi_get_xgmi_fb_sharing_caps (amdsmi_processor_handle processor_handle, amdsmi_xgmi_fb_sharing_caps_t *caps)
 Return XGMI capabilities. More...
 
amdsmi_status_t amdsmi_get_xgmi_fb_sharing_mode_info (amdsmi_processor_handle processor_handle_src, amdsmi_processor_handle processor_handle_dst, amdsmi_xgmi_fb_sharing_mode_t mode, uint8_t *fb_sharing)
 Return XGMI framebuffer sharing information between two GPUs. More...
 
amdsmi_status_t amdsmi_set_xgmi_fb_sharing_mode (amdsmi_processor_handle processor_handle, amdsmi_xgmi_fb_sharing_mode_t mode)
 Set XGMI framebuffer sharing mode. More...
 
amdsmi_status_t amdsmi_set_xgmi_fb_sharing_mode_v2 (amdsmi_processor_handle *processor_list, uint32_t num_processors, amdsmi_xgmi_fb_sharing_mode_t mode)
 Set XGMI framebuffer custom sharing mode. More...
 
amdsmi_status_t amdsmi_topo_get_p2p_status (amdsmi_processor_handle processor_handle_src, amdsmi_processor_handle processor_handle_dst, amdsmi_link_type_t *type, amdsmi_p2p_capability_t *cap)
 Retrieve connection type and P2P capabilities between 2 GPUs. More...
 

Detailed Description

Function Documentation

◆ amdsmi_get_link_metrics()

amdsmi_status_t amdsmi_get_link_metrics ( amdsmi_processor_handle  processor_handle,
amdsmi_link_metrics_t link_metrics 
)

Return link metric information.

Parameters
[in]processor_handlePF of a processor for which to query
[out]link_metricsreference to the link metrics struct. Must be allocated by user.
Returns
amdsmi_status_t | AMDSMI_STATUS_SUCCESS on success, non-zero on fail

◆ amdsmi_get_link_topology()

amdsmi_status_t amdsmi_get_link_topology ( amdsmi_processor_handle  processor_handle_src,
amdsmi_processor_handle  processor_handle_dst,
amdsmi_link_topology_t topology_info 
)

Return link topology information between two connected processors.

Parameters
[in]processor_handle_srcSource PF of a processor for which to query
[in]processor_handle_dstDestination PF of a processor for which to query
[out]topology_inforeference to the link topology struct. Must be allocated by user.
Returns
amdsmi_status_t | AMDSMI_STATUS_SUCCESS on success, non-zero on fail

◆ amdsmi_get_link_topology_nearest()

amdsmi_status_t amdsmi_get_link_topology_nearest ( amdsmi_processor_handle  processor_handle,
amdsmi_link_type_t  link_type,
amdsmi_topology_nearest_t topology_nearest_info 
)

Retrieve the set of GPUs that are nearest to a given device at a specific interconnectivity level.

Platform:

gpu_bm_linux

host

Once called topology_nearest_info will get populated with a list of all nearest devices for a given link_type. The list has a count of the number of devices found and their respective handles/identifiers.

Parameters
[in]processor_handleThe identifier of the given device.
[in]link_typeThe amdsmi_link_type_t level to search for nearest GPUs.
[in,out]topology_nearest_info.count;
  • When zero, is set to the number of matching GPUs such that .processor_list can be malloc'd.
  • When non-zero, .processor_list will be filled with count number of processor_handle.
[out].processor_listAn array of processor_handle for GPUs found at level.
Returns
amdsmi_status_t | AMDSMI_STATUS_SUCCESS on success, non-zero on fail.

◆ amdsmi_get_xgmi_fb_sharing_caps()

amdsmi_status_t amdsmi_get_xgmi_fb_sharing_caps ( amdsmi_processor_handle  processor_handle,
amdsmi_xgmi_fb_sharing_caps_t caps 
)

Return XGMI capabilities.

Parameters
[in]processor_handlePF of a processor for which to query
[out]capsreference to the xgmi caps union. Must be allocated by user.
Returns
amdsmi_status_t | AMDSMI_STATUS_SUCCESS on success, non-zero on fail

◆ amdsmi_get_xgmi_fb_sharing_mode_info()

amdsmi_status_t amdsmi_get_xgmi_fb_sharing_mode_info ( amdsmi_processor_handle  processor_handle_src,
amdsmi_processor_handle  processor_handle_dst,
amdsmi_xgmi_fb_sharing_mode_t  mode,
uint8_t *  fb_sharing 
)

Return XGMI framebuffer sharing information between two GPUs.

Parameters
[in]processor_handle_srcSource PF of a processor for which to query
[in]processor_handle_dstDestination PF of a processor for which to query
[in]modeEnum representing the framebuffer sharing mode to query
[out]fb_sharingIndicates framebuffer sharing between two processors. Must be allocated by user.
Returns
amdsmi_status_t | AMDSMI_STATUS_SUCCESS on success, non-zero on fail

◆ amdsmi_set_xgmi_fb_sharing_mode()

amdsmi_status_t amdsmi_set_xgmi_fb_sharing_mode ( amdsmi_processor_handle  processor_handle,
amdsmi_xgmi_fb_sharing_mode_t  mode 
)

Set XGMI framebuffer sharing mode.

Note
This API will only work if there's no guest VM running.
Parameters
[in]processor_handlePF of a processor for which to query
[in]modeEnum representing the framebuffer sharing mode to set
Returns
amdsmi_status_t | AMDSMI_STATUS_SUCCESS on success, non-zero on fail

◆ amdsmi_set_xgmi_fb_sharing_mode_v2()

amdsmi_status_t amdsmi_set_xgmi_fb_sharing_mode_v2 ( amdsmi_processor_handle *  processor_list,
uint32_t  num_processors,
amdsmi_xgmi_fb_sharing_mode_t  mode 
)

Set XGMI framebuffer custom sharing mode.

Note
This API will only work if there's no guest VM running. This api can be used for custom and auto setting of xgmi frame buffer sharing. In case of custom mode:
  • All processors in the list must be on the same NUMA node. Otherwise, api will return error.
  • If any processor from the list already belongs to an existing group, the existing group will be released automatically. In case of auto mode(MODE_X):
  • The input parameters num_processors should be 1 and processor_list[0] should be valid. Only the first element of processor_list is taken into account and it can be any gpu0,gpu1,...
Parameters
[in]processor_listThe list of processors
[in]num_processorsThe number of processors in the list
[in]modeEnum representing the framebuffer sharing mode to set
Returns
amdsmi_status_t | AMDSMI_STATUS_SUCCESS on success, non-zero on fail

◆ amdsmi_topo_get_p2p_status()

amdsmi_status_t amdsmi_topo_get_p2p_status ( amdsmi_processor_handle  processor_handle_src,
amdsmi_processor_handle  processor_handle_dst,
amdsmi_link_type_t *  type,
amdsmi_p2p_capability_t cap 
)

Retrieve connection type and P2P capabilities between 2 GPUs.

Platform:

gpu_bm_linux

host

guest_1vf

guest_mvf

Given a source processor handle processor_handle_src and a destination processor handle processor_handle_dst, a pointer to an amdsmi_link_type_t type, and a pointer to amdsmi_p2p_capability_t cap. This function will write the connection type, and io link capabilities between the device processor_handle_src and processor_handle_dst to the memory pointed to by cap and type.

Parameters
[in]processor_handle_srcthe source processor handle
[in]processor_handle_dstthe destination processor handle
[in,out]typeA pointer to an ::amdsmi_link_type_t to which the type for the connection should be written.
[in,out]capA pointer to an amdsmi_p2p_capability_t to which the io link capabilities should be written.
Returns
amdsmi_status_t | AMDSMI_STATUS_SUCCESS on success, non-zero on fail