PCIe Queries#
Functions | |
amdsmi_status_t | amdsmi_get_gpu_pci_bandwidth (amdsmi_processor_handle processor_handle, amdsmi_pcie_bandwidth_t *bandwidth) |
Get the list of possible PCIe bandwidths that are available. It is not supported on virtual machine guest. More... | |
amdsmi_status_t | amdsmi_get_gpu_bdf_id (amdsmi_processor_handle processor_handle, uint64_t *bdfid) |
Get the unique PCI device identifier associated for a device. More... | |
amdsmi_status_t | amdsmi_get_gpu_topo_numa_affinity (amdsmi_processor_handle processor_handle, int32_t *numa_node) |
Get the NUMA node associated with a device. More... | |
amdsmi_status_t | amdsmi_get_gpu_pci_throughput (amdsmi_processor_handle processor_handle, uint64_t *sent, uint64_t *received, uint64_t *max_pkt_sz) |
Get PCIe traffic information. It is not supported on virtual machine guest. More... | |
amdsmi_status_t | amdsmi_get_gpu_pci_replay_counter (amdsmi_processor_handle processor_handle, uint64_t *counter) |
Get PCIe replay counter. More... | |
Detailed Description
These functions provide information about PCIe.
Function Documentation
◆ amdsmi_get_gpu_pci_bandwidth()
amdsmi_status_t amdsmi_get_gpu_pci_bandwidth | ( | amdsmi_processor_handle | processor_handle, |
amdsmi_pcie_bandwidth_t * | bandwidth | ||
) |
Get the list of possible PCIe bandwidths that are available. It is not supported on virtual machine guest.
- Platform:
- gpu_bm_linux
Given a processor handle processor_handle
and a pointer to a to an amdsmi_pcie_bandwidth_t structure bandwidth
, this function will fill in bandwidth
with the possible T/s values and associated number of lanes, and indication of the current selection.
- Parameters
-
[in] processor_handle a processor handle [in,out] bandwidth a pointer to a caller provided amdsmi_pcie_bandwidth_t structure to which the frequency information will be written
- Returns
- amdsmi_status_t | AMDSMI_STATUS_SUCCESS on success, non-zero on fail
◆ amdsmi_get_gpu_bdf_id()
amdsmi_status_t amdsmi_get_gpu_bdf_id | ( | amdsmi_processor_handle | processor_handle, |
uint64_t * | bdfid | ||
) |
Get the unique PCI device identifier associated for a device.
- Platform:
gpu_bm_linux
guest_1vf
Give a processor handle processor_handle
and a pointer to a uint64_t bdfid
, this function will write the Bus/Device/Function PCI identifier (BDFID) associated with device processor_handle
to the value pointed to by bdfid
.
The format of bdfid
will be as follows:
BDFID = ((DOMAIN & 0xFFFFFFFF) << 32) | ((Partition & 0xF) << 28) | ((BUS & 0xFF) << 8) | ((DEVICE & 0x1F) <<3 ) | (FUNCTION & 0x7)
| Name | Field | KFD property KFD -> PCIe ID (uint64_t) -----------— | ----— | -------------— | -------------------------— | | Domain | [63:32] | "domain" | (DOMAIN & 0xFFFFFFFF) << 32 | | Partition id | [31:28] | "location id" | (LOCATION & 0xF0000000) | | Reserved | [27:16] | "location id" | N/A | | Bus | [15: 8] | "location id" | (LOCATION & 0xFF00) | | Device | [ 7: 3] | "location id" | (LOCATION & 0xF8) | | Function | [ 2: 0] | "location id" | (LOCATION & 0x7) |
- Parameters
-
[in] processor_handle a processor handle [in,out] bdfid a pointer to uint64_t to which the device bdfid value will be written If this parameter is nullptr, this function will return AMDSMI_STATUS_INVAL if the function is supported with the provided, arguments and AMDSMI_STATUS_NOT_SUPPORTED if it is not supported with the provided arguments.
- Returns
- amdsmi_status_t | AMDSMI_STATUS_SUCCESS on success, non-zero on fail
◆ amdsmi_get_gpu_topo_numa_affinity()
amdsmi_status_t amdsmi_get_gpu_topo_numa_affinity | ( | amdsmi_processor_handle | processor_handle, |
int32_t * | numa_node | ||
) |
Get the NUMA node associated with a device.
- Platform:
- gpu_bm_linux
Given a processor handle processor_handle
and a pointer to a int32_t numa_node
, this function will retrieve the NUMA node value associated with device processor_handle
and store the value at location pointed to by numa_node
.
- Parameters
-
[in] processor_handle a processor handle [in,out] numa_node pointer to location where NUMA node value will be written. If this parameter is nullptr, this function will return AMDSMI_STATUS_INVAL if the function is supported with the provided, arguments and AMDSMI_STATUS_NOT_SUPPORTED if it is not supported with the provided arguments.
- Returns
- amdsmi_status_t | AMDSMI_STATUS_SUCCESS on success, non-zero on fail
◆ amdsmi_get_gpu_pci_throughput()
amdsmi_status_t amdsmi_get_gpu_pci_throughput | ( | amdsmi_processor_handle | processor_handle, |
uint64_t * | sent, | ||
uint64_t * | received, | ||
uint64_t * | max_pkt_sz | ||
) |
Get PCIe traffic information. It is not supported on virtual machine guest.
- Platform:
- gpu_bm_linux
Give a processor handle processor_handle
and pointers to a uint64_t's, sent
, received
and max_pkt_sz
, this function will write the number of bytes sent and received in 1 second to sent
and received
, respectively. The maximum possible packet size will be written to max_pkt_sz
.
- Parameters
-
[in] processor_handle a processor handle [in,out] sent a pointer to uint64_t to which the number of bytes sent will be written in 1 second. If pointer is NULL, it will be ignored. [in,out] received a pointer to uint64_t to which the number of bytes received will be written. If pointer is NULL, it will be ignored. [in,out] max_pkt_sz a pointer to uint64_t to which the maximum packet size will be written. If pointer is NULL, it will be ignored.
- Returns
- amdsmi_status_t | AMDSMI_STATUS_SUCCESS on success, non-zero on fail
◆ amdsmi_get_gpu_pci_replay_counter()
amdsmi_status_t amdsmi_get_gpu_pci_replay_counter | ( | amdsmi_processor_handle | processor_handle, |
uint64_t * | counter | ||
) |
Get PCIe replay counter.
- Platform:
- gpu_bm_linux
Given a processor handle processor_handle
and a pointer to a uint64_t counter
, this function will write the sum of the number of NAK's received by the GPU and the NAK's generated by the GPU to memory pointed to by counter
.
- Parameters
-
[in] processor_handle a processor handle [in,out] counter a pointer to uint64_t to which the sum of the NAK's received and generated by the GPU is written If this parameter is nullptr, this function will return AMDSMI_STATUS_INVAL if the function is supported with the provided, arguments and AMDSMI_STATUS_NOT_SUPPORTED if it is not supported with the provided arguments.
- Returns
- amdsmi_status_t | AMDSMI_STATUS_SUCCESS on success, non-zero on fail