Hardware Topology Functions

Hardware Topology Functions#

AMD SMI: Hardware Topology Functions
Hardware Topology Functions

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_topo_get_numa_node_number (amdsmi_processor_handle processor_handle, uint32_t *numa_node)
 Retrieve the NUMA CPU node number for a device. More...
 
amdsmi_status_t amdsmi_topo_get_link_weight (amdsmi_processor_handle processor_handle_src, amdsmi_processor_handle processor_handle_dst, uint64_t *weight)
 Retrieve the weight for a connection between 2 GPUs. More...
 
amdsmi_status_t amdsmi_get_minmax_bandwidth_between_processors (amdsmi_processor_handle processor_handle_src, amdsmi_processor_handle processor_handle_dst, uint64_t *min_bandwidth, uint64_t *max_bandwidth)
 Retreive minimal and maximal io link bandwidth between 2 GPUs. More...
 
amdsmi_status_t amdsmi_topo_get_link_type (amdsmi_processor_handle processor_handle_src, amdsmi_processor_handle processor_handle_dst, uint64_t *hops, amdsmi_io_link_type_t *type)
 Retrieve the hops and the connection type between 2 GPUs. More...
 
amdsmi_status_t amdsmi_is_P2P_accessible (amdsmi_processor_handle processor_handle_src, amdsmi_processor_handle processor_handle_dst, bool *accessible)
 Return P2P availability status between 2 GPUs. More...
 
amdsmi_status_t amdsmi_topo_get_p2p_status (amdsmi_processor_handle processor_handle_src, amdsmi_processor_handle processor_handle_dst, amdsmi_io_link_type_t *type, amdsmi_p2p_capability_t *cap)
 Retrieve connection type and P2P capabilities between 2 GPUs. More...
 

Detailed Description

These functions are used to query Hardware topology.

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.

Platform:

gpu_bm_linux

host

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_topo_get_numa_node_number()

amdsmi_status_t amdsmi_topo_get_numa_node_number ( amdsmi_processor_handle  processor_handle,
uint32_t *  numa_node 
)

Retrieve the NUMA CPU node number for a device.

Platform:
gpu_bm_linux

Given a processor handle processor_handle, and a pointer to an uint32_t numa_node, this function will write the node number of NUMA CPU for the device processor_handle to the memory pointed to by numa_node.

Parameters
[in]processor_handlea processor handle
[in,out]numa_nodeA pointer to an uint32_t to which the numa node number should be written.
Returns
amdsmi_status_t | AMDSMI_STATUS_SUCCESS on success, non-zero on fail

◆ amdsmi_topo_get_link_weight()

amdsmi_status_t amdsmi_topo_get_link_weight ( amdsmi_processor_handle  processor_handle_src,
amdsmi_processor_handle  processor_handle_dst,
uint64_t *  weight 
)

Retrieve the weight for a connection between 2 GPUs.

Platform:
gpu_bm_linux

Given a source processor handle processor_handle_src and a destination processor handle processor_handle_dst, and a pointer to an uint64_t weight, this function will write the weight for the connection between the device processor_handle_src and processor_handle_dst to the memory pointed to by weight.

Parameters
[in]processor_handle_srcthe source processor handle
[in]processor_handle_dstthe destination processor handle
[in,out]weightA pointer to an uint64_t to which the weight for the connection should be written.
Returns
amdsmi_status_t | AMDSMI_STATUS_SUCCESS on success, non-zero on fail

◆ amdsmi_get_minmax_bandwidth_between_processors()

amdsmi_status_t amdsmi_get_minmax_bandwidth_between_processors ( amdsmi_processor_handle  processor_handle_src,
amdsmi_processor_handle  processor_handle_dst,
uint64_t *  min_bandwidth,
uint64_t *  max_bandwidth 
)

Retreive minimal and maximal io link bandwidth between 2 GPUs.

Platform:
gpu_bm_linux

Given a source processor handle processor_handle_src and a destination processor handle processor_handle_dst, pointer to an uint64_t min_bandwidth, and a pointer to uint64_t max_bandiwidth, this function will write theoretical minimal and maximal bandwidth limits. API works if src and dst are connected via xgmi and have 1 hop distance.

Parameters
[in]processor_handle_srcthe source processor handle
[in]processor_handle_dstthe destination processor handle
[in,out]min_bandwidthA pointer to an uint64_t to which the minimal bandwidth for the connection should be written.
[in,out]max_bandwidthA pointer to an uint64_t to which the maximal bandwidth for the connection should be written.
Returns
amdsmi_status_t | AMDSMI_STATUS_SUCCESS on success, non-zero on fail

◆ amdsmi_topo_get_link_type()

amdsmi_status_t amdsmi_topo_get_link_type ( amdsmi_processor_handle  processor_handle_src,
amdsmi_processor_handle  processor_handle_dst,
uint64_t *  hops,
amdsmi_io_link_type_t type 
)

Retrieve the hops and the connection type between 2 GPUs.

Platform:
gpu_bm_linux

Given a source processor handle processor_handle_src and a destination processor handle processor_handle_dst, and a pointer to an uint64_t hops and a pointer to an AMDSMI_IO_LINK_TYPE type, this function will write the number of hops and the connection type between the device processor_handle_src and processor_handle_dst to the memory pointed to by hops and type.

Parameters
[in]processor_handle_srcthe source processor handle
[in]processor_handle_dstthe destination processor handle
[in,out]hopsA pointer to an uint64_t to which the hops for the connection should be written.
[in,out]typeA pointer to an ::AMDSMI_IO_LINK_TYPE to which the type for the connection should be written.
Returns
amdsmi_status_t | AMDSMI_STATUS_SUCCESS on success, non-zero on fail

◆ amdsmi_is_P2P_accessible()

amdsmi_status_t amdsmi_is_P2P_accessible ( amdsmi_processor_handle  processor_handle_src,
amdsmi_processor_handle  processor_handle_dst,
bool *  accessible 
)

Return P2P availability status between 2 GPUs.

Platform:
gpu_bm_linux

Given a source processor handle processor_handle_src and a destination processor handle processor_handle_dst, and a pointer to a bool accessible, this function will write the P2P connection status between the device processor_handle_src and processor_handle_dst to the memory pointed to by accessible.

Parameters
[in]processor_handle_srcthe source processor handle
[in]processor_handle_dstthe destination processor handle
[in,out]accessibleA pointer to a bool to which the status for the P2P connection availablity should be written.
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_io_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_io_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_io_link_type_t to which the type for the connection should be written.
[in,out]typeA 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