PCIe Queries#
Functions | |
amdsmi_status_t | amdsmi_dev_get_pci_bandwidth (amdsmi_device_handle device_handle, amdsmi_pcie_bandwidth_t *bandwidth) |
Get the list of possible PCIe bandwidths that are available. More... | |
amdsmi_status_t | amdsmi_dev_get_pci_id (amdsmi_device_handle device_handle, uint64_t *bdfid) |
Get the unique PCI device identifier associated for a device. More... | |
amdsmi_status_t | amdsmi_topo_get_numa_affinity (amdsmi_device_handle device_handle, uint32_t *numa_node) |
Get the NUMA node associated with a device. More... | |
amdsmi_status_t | amdsmi_dev_get_pci_throughput (amdsmi_device_handle device_handle, uint64_t *sent, uint64_t *received, uint64_t *max_pkt_sz) |
Get PCIe traffic information. More... | |
amdsmi_status_t | amdsmi_dev_get_pci_replay_counter (amdsmi_device_handle device_handle, uint64_t *counter) |
Get PCIe replay counter. More... | |
Detailed Description
These functions provide information about PCIe.
Function Documentation
◆ amdsmi_dev_get_pci_bandwidth()
amdsmi_status_t amdsmi_dev_get_pci_bandwidth | ( | amdsmi_device_handle | device_handle, |
amdsmi_pcie_bandwidth_t * | bandwidth | ||
) |
Get the list of possible PCIe bandwidths that are available.
Given a device handle device_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] device_handle a device 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_dev_get_pci_id()
amdsmi_status_t amdsmi_dev_get_pci_id | ( | amdsmi_device_handle | device_handle, |
uint64_t * | bdfid | ||
) |
Get the unique PCI device identifier associated for a device.
Give a device handle device_handle
and a pointer to a uint64_t bdfid
, this function will write the Bus/Device/Function PCI identifier (BDFID) associated with device device_handle
to the value pointed to by bdfid
.
The format of bdfid
will be as follows:
BDFID = ((DOMAIN & 0xffffffff) << 32) | ((BUS & 0xff) << 8) | ((DEVICE & 0x1f) <<3 ) | (FUNCTION & 0x7)
Name | Field |
---|---|
Domain | [64:32] |
Reserved | [31:16] |
Bus | [15: 8] |
Device | [ 7: 3] |
Function | [ 2: 0] |
- Parameters
-
[in] device_handle a device 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_topo_get_numa_affinity()
amdsmi_status_t amdsmi_topo_get_numa_affinity | ( | amdsmi_device_handle | device_handle, |
uint32_t * | numa_node | ||
) |
Get the NUMA node associated with a device.
Given a device handle device_handle
and a pointer to a uint32_t numa_node
, this function will retrieve the NUMA node value associated with device device_handle
and store the value at location pointed to by numa_node
.
- Parameters
-
[in] device_handle a device 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_dev_get_pci_throughput()
amdsmi_status_t amdsmi_dev_get_pci_throughput | ( | amdsmi_device_handle | device_handle, |
uint64_t * | sent, | ||
uint64_t * | received, | ||
uint64_t * | max_pkt_sz | ||
) |
Get PCIe traffic information.
Give a device handle device_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] device_handle a device 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_dev_get_pci_replay_counter()
amdsmi_status_t amdsmi_dev_get_pci_replay_counter | ( | amdsmi_device_handle | device_handle, |
uint64_t * | counter | ||
) |
Get PCIe replay counter.
Given a device handle device_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] device_handle a device 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