nvidia-pmu.rst 13 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299
  1. =========================================================
  2. NVIDIA Tegra SoC Uncore Performance Monitoring Unit (PMU)
  3. =========================================================
  4. The NVIDIA Tegra SoC includes various system PMUs to measure key performance
  5. metrics like memory bandwidth, latency, and utilization:
  6. * Scalable Coherency Fabric (SCF)
  7. * NVLink-C2C0
  8. * NVLink-C2C1
  9. * CNVLink
  10. * PCIE
  11. PMU Driver
  12. ----------
  13. The PMUs in this document are based on ARM CoreSight PMU Architecture as
  14. described in document: ARM IHI 0091. Since this is a standard architecture, the
  15. PMUs are managed by a common driver "arm-cs-arch-pmu". This driver describes
  16. the available events and configuration of each PMU in sysfs. Please see the
  17. sections below to get the sysfs path of each PMU. Like other uncore PMU drivers,
  18. the driver provides "cpumask" sysfs attribute to show the CPU id used to handle
  19. the PMU event. There is also "associated_cpus" sysfs attribute, which contains a
  20. list of CPUs associated with the PMU instance.
  21. .. _SCF_PMU_Section:
  22. SCF PMU
  23. -------
  24. The SCF PMU monitors system level cache events, CPU traffic, and
  25. strongly-ordered (SO) PCIE write traffic to local/remote memory. Please see
  26. :ref:`NVIDIA_Uncore_PMU_Traffic_Coverage_Section` for more info about the PMU
  27. traffic coverage.
  28. The events and configuration options of this PMU device are described in sysfs,
  29. see /sys/bus/event_sources/devices/nvidia_scf_pmu_<socket-id>.
  30. Example usage:
  31. * Count event id 0x0 in socket 0::
  32. perf stat -a -e nvidia_scf_pmu_0/event=0x0/
  33. * Count event id 0x0 in socket 1::
  34. perf stat -a -e nvidia_scf_pmu_1/event=0x0/
  35. NVLink-C2C0 PMU
  36. --------------------
  37. The NVLink-C2C0 PMU monitors incoming traffic from a GPU/CPU connected with
  38. NVLink-C2C (Chip-2-Chip) interconnect. The type of traffic captured by this PMU
  39. varies dependent on the chip configuration:
  40. * NVIDIA Grace Hopper Superchip: Hopper GPU is connected with Grace SoC.
  41. In this config, the PMU captures GPU ATS translated or EGM traffic from the GPU.
  42. * NVIDIA Grace CPU Superchip: two Grace CPU SoCs are connected.
  43. In this config, the PMU captures read and relaxed ordered (RO) writes from
  44. PCIE device of the remote SoC.
  45. Please see :ref:`NVIDIA_Uncore_PMU_Traffic_Coverage_Section` for more info about
  46. the PMU traffic coverage.
  47. The events and configuration options of this PMU device are described in sysfs,
  48. see /sys/bus/event_sources/devices/nvidia_nvlink_c2c0_pmu_<socket-id>.
  49. Example usage:
  50. * Count event id 0x0 from the GPU/CPU connected with socket 0::
  51. perf stat -a -e nvidia_nvlink_c2c0_pmu_0/event=0x0/
  52. * Count event id 0x0 from the GPU/CPU connected with socket 1::
  53. perf stat -a -e nvidia_nvlink_c2c0_pmu_1/event=0x0/
  54. * Count event id 0x0 from the GPU/CPU connected with socket 2::
  55. perf stat -a -e nvidia_nvlink_c2c0_pmu_2/event=0x0/
  56. * Count event id 0x0 from the GPU/CPU connected with socket 3::
  57. perf stat -a -e nvidia_nvlink_c2c0_pmu_3/event=0x0/
  58. NVLink-C2C1 PMU
  59. -------------------
  60. The NVLink-C2C1 PMU monitors incoming traffic from a GPU connected with
  61. NVLink-C2C (Chip-2-Chip) interconnect. This PMU captures untranslated GPU
  62. traffic, in contrast with NvLink-C2C0 PMU that captures ATS translated traffic.
  63. Please see :ref:`NVIDIA_Uncore_PMU_Traffic_Coverage_Section` for more info about
  64. the PMU traffic coverage.
  65. The events and configuration options of this PMU device are described in sysfs,
  66. see /sys/bus/event_sources/devices/nvidia_nvlink_c2c1_pmu_<socket-id>.
  67. Example usage:
  68. * Count event id 0x0 from the GPU connected with socket 0::
  69. perf stat -a -e nvidia_nvlink_c2c1_pmu_0/event=0x0/
  70. * Count event id 0x0 from the GPU connected with socket 1::
  71. perf stat -a -e nvidia_nvlink_c2c1_pmu_1/event=0x0/
  72. * Count event id 0x0 from the GPU connected with socket 2::
  73. perf stat -a -e nvidia_nvlink_c2c1_pmu_2/event=0x0/
  74. * Count event id 0x0 from the GPU connected with socket 3::
  75. perf stat -a -e nvidia_nvlink_c2c1_pmu_3/event=0x0/
  76. CNVLink PMU
  77. ---------------
  78. The CNVLink PMU monitors traffic from GPU and PCIE device on remote sockets
  79. to local memory. For PCIE traffic, this PMU captures read and relaxed ordered
  80. (RO) write traffic. Please see :ref:`NVIDIA_Uncore_PMU_Traffic_Coverage_Section`
  81. for more info about the PMU traffic coverage.
  82. The events and configuration options of this PMU device are described in sysfs,
  83. see /sys/bus/event_sources/devices/nvidia_cnvlink_pmu_<socket-id>.
  84. Each SoC socket can be connected to one or more sockets via CNVLink. The user can
  85. use "rem_socket" bitmap parameter to select the remote socket(s) to monitor.
  86. Each bit represents the socket number, e.g. "rem_socket=0xE" corresponds to
  87. socket 1 to 3.
  88. /sys/bus/event_sources/devices/nvidia_cnvlink_pmu_<socket-id>/format/rem_socket
  89. shows the valid bits that can be set in the "rem_socket" parameter.
  90. The PMU can not distinguish the remote traffic initiator, therefore it does not
  91. provide filter to select the traffic source to monitor. It reports combined
  92. traffic from remote GPU and PCIE devices.
  93. Example usage:
  94. * Count event id 0x0 for the traffic from remote socket 1, 2, and 3 to socket 0::
  95. perf stat -a -e nvidia_cnvlink_pmu_0/event=0x0,rem_socket=0xE/
  96. * Count event id 0x0 for the traffic from remote socket 0, 2, and 3 to socket 1::
  97. perf stat -a -e nvidia_cnvlink_pmu_1/event=0x0,rem_socket=0xD/
  98. * Count event id 0x0 for the traffic from remote socket 0, 1, and 3 to socket 2::
  99. perf stat -a -e nvidia_cnvlink_pmu_2/event=0x0,rem_socket=0xB/
  100. * Count event id 0x0 for the traffic from remote socket 0, 1, and 2 to socket 3::
  101. perf stat -a -e nvidia_cnvlink_pmu_3/event=0x0,rem_socket=0x7/
  102. PCIE PMU
  103. ------------
  104. The PCIE PMU monitors all read/write traffic from PCIE root ports to
  105. local/remote memory. Please see :ref:`NVIDIA_Uncore_PMU_Traffic_Coverage_Section`
  106. for more info about the PMU traffic coverage.
  107. The events and configuration options of this PMU device are described in sysfs,
  108. see /sys/bus/event_sources/devices/nvidia_pcie_pmu_<socket-id>.
  109. Each SoC socket can support multiple root ports. The user can use
  110. "root_port" bitmap parameter to select the port(s) to monitor, i.e.
  111. "root_port=0xF" corresponds to root port 0 to 3.
  112. /sys/bus/event_sources/devices/nvidia_pcie_pmu_<socket-id>/format/root_port
  113. shows the valid bits that can be set in the "root_port" parameter.
  114. Example usage:
  115. * Count event id 0x0 from root port 0 and 1 of socket 0::
  116. perf stat -a -e nvidia_pcie_pmu_0/event=0x0,root_port=0x3/
  117. * Count event id 0x0 from root port 0 and 1 of socket 1::
  118. perf stat -a -e nvidia_pcie_pmu_1/event=0x0,root_port=0x3/
  119. .. _NVIDIA_Uncore_PMU_Traffic_Coverage_Section:
  120. Traffic Coverage
  121. ----------------
  122. The PMU traffic coverage may vary dependent on the chip configuration:
  123. * **NVIDIA Grace Hopper Superchip**: Hopper GPU is connected with Grace SoC.
  124. Example configuration with two Grace SoCs::
  125. ********************************* *********************************
  126. * SOCKET-A * * SOCKET-B *
  127. * * * *
  128. * :::::::: * * :::::::: *
  129. * : PCIE : * * : PCIE : *
  130. * :::::::: * * :::::::: *
  131. * | * * | *
  132. * | * * | *
  133. * ::::::: ::::::::: * * ::::::::: ::::::: *
  134. * : : : : * * : : : : *
  135. * : GPU :<--NVLink-->: Grace :<---CNVLink--->: Grace :<--NVLink-->: GPU : *
  136. * : : C2C : SoC : * * : SoC : C2C : : *
  137. * ::::::: ::::::::: * * ::::::::: ::::::: *
  138. * | | * * | | *
  139. * | | * * | | *
  140. * &&&&&&&& &&&&&&&& * * &&&&&&&& &&&&&&&& *
  141. * & GMEM & & CMEM & * * & CMEM & & GMEM & *
  142. * &&&&&&&& &&&&&&&& * * &&&&&&&& &&&&&&&& *
  143. * * * *
  144. ********************************* *********************************
  145. GMEM = GPU Memory (e.g. HBM)
  146. CMEM = CPU Memory (e.g. LPDDR5X)
  147. |
  148. | Following table contains traffic coverage of Grace SoC PMU in socket-A:
  149. ::
  150. +--------------+-------+-----------+-----------+-----+----------+----------+
  151. | | Source |
  152. + +-------+-----------+-----------+-----+----------+----------+
  153. | Destination | |GPU ATS |GPU Not-ATS| | Socket-B | Socket-B |
  154. | |PCI R/W|Translated,|Translated | CPU | CPU/PCIE1| GPU/PCIE2|
  155. | | |EGM | | | | |
  156. +==============+=======+===========+===========+=====+==========+==========+
  157. | Local | PCIE |NVLink-C2C0|NVLink-C2C1| SCF | SCF PMU | CNVLink |
  158. | SYSRAM/CMEM | PMU |PMU |PMU | PMU | | PMU |
  159. +--------------+-------+-----------+-----------+-----+----------+----------+
  160. | Local GMEM | PCIE | N/A |NVLink-C2C1| SCF | SCF PMU | CNVLink |
  161. | | PMU | |PMU | PMU | | PMU |
  162. +--------------+-------+-----------+-----------+-----+----------+----------+
  163. | Remote | PCIE |NVLink-C2C0|NVLink-C2C1| SCF | | |
  164. | SYSRAM/CMEM | PMU |PMU |PMU | PMU | N/A | N/A |
  165. | over CNVLink | | | | | | |
  166. +--------------+-------+-----------+-----------+-----+----------+----------+
  167. | Remote GMEM | PCIE |NVLink-C2C0|NVLink-C2C1| SCF | | |
  168. | over CNVLink | PMU |PMU |PMU | PMU | N/A | N/A |
  169. +--------------+-------+-----------+-----------+-----+----------+----------+
  170. PCIE1 traffic represents strongly ordered (SO) writes.
  171. PCIE2 traffic represents reads and relaxed ordered (RO) writes.
  172. * **NVIDIA Grace CPU Superchip**: two Grace CPU SoCs are connected.
  173. Example configuration with two Grace SoCs::
  174. ******************* *******************
  175. * SOCKET-A * * SOCKET-B *
  176. * * * *
  177. * :::::::: * * :::::::: *
  178. * : PCIE : * * : PCIE : *
  179. * :::::::: * * :::::::: *
  180. * | * * | *
  181. * | * * | *
  182. * ::::::::: * * ::::::::: *
  183. * : : * * : : *
  184. * : Grace :<--------NVLink------->: Grace : *
  185. * : SoC : * C2C * : SoC : *
  186. * ::::::::: * * ::::::::: *
  187. * | * * | *
  188. * | * * | *
  189. * &&&&&&&& * * &&&&&&&& *
  190. * & CMEM & * * & CMEM & *
  191. * &&&&&&&& * * &&&&&&&& *
  192. * * * *
  193. ******************* *******************
  194. GMEM = GPU Memory (e.g. HBM)
  195. CMEM = CPU Memory (e.g. LPDDR5X)
  196. |
  197. | Following table contains traffic coverage of Grace SoC PMU in socket-A:
  198. ::
  199. +-----------------+-----------+---------+----------+-------------+
  200. | | Source |
  201. + +-----------+---------+----------+-------------+
  202. | Destination | | | Socket-B | Socket-B |
  203. | | PCI R/W | CPU | CPU/PCIE1| PCIE2 |
  204. | | | | | |
  205. +=================+===========+=========+==========+=============+
  206. | Local | PCIE PMU | SCF PMU | SCF PMU | NVLink-C2C0 |
  207. | SYSRAM/CMEM | | | | PMU |
  208. +-----------------+-----------+---------+----------+-------------+
  209. | Remote | | | | |
  210. | SYSRAM/CMEM | PCIE PMU | SCF PMU | N/A | N/A |
  211. | over NVLink-C2C | | | | |
  212. +-----------------+-----------+---------+----------+-------------+
  213. PCIE1 traffic represents strongly ordered (SO) writes.
  214. PCIE2 traffic represents reads and relaxed ordered (RO) writes.