nvidia-pmu.rst 14 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333
  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_source/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_source/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. The NVLink-C2C has two ports that can be connected to one GPU (occupying both
  59. ports) or to two GPUs (one GPU per port). The user can use "port" bitmap
  60. parameter to select the port(s) to monitor. Each bit represents the port number,
  61. e.g. "port=0x1" corresponds to port 0 and "port=0x3" is for port 0 and 1. The
  62. PMU will monitor both ports by default if not specified.
  63. Example for port filtering:
  64. * Count event id 0x0 from the GPU connected with socket 0 on port 0::
  65. perf stat -a -e nvidia_nvlink_c2c0_pmu_0/event=0x0,port=0x1/
  66. * Count event id 0x0 from the GPUs connected with socket 0 on port 0 and port 1::
  67. perf stat -a -e nvidia_nvlink_c2c0_pmu_0/event=0x0,port=0x3/
  68. NVLink-C2C1 PMU
  69. -------------------
  70. The NVLink-C2C1 PMU monitors incoming traffic from a GPU connected with
  71. NVLink-C2C (Chip-2-Chip) interconnect. This PMU captures untranslated GPU
  72. traffic, in contrast with NvLink-C2C0 PMU that captures ATS translated traffic.
  73. Please see :ref:`NVIDIA_Uncore_PMU_Traffic_Coverage_Section` for more info about
  74. the PMU traffic coverage.
  75. The events and configuration options of this PMU device are described in sysfs,
  76. see /sys/bus/event_source/devices/nvidia_nvlink_c2c1_pmu_<socket-id>.
  77. Example usage:
  78. * Count event id 0x0 from the GPU connected with socket 0::
  79. perf stat -a -e nvidia_nvlink_c2c1_pmu_0/event=0x0/
  80. * Count event id 0x0 from the GPU connected with socket 1::
  81. perf stat -a -e nvidia_nvlink_c2c1_pmu_1/event=0x0/
  82. * Count event id 0x0 from the GPU connected with socket 2::
  83. perf stat -a -e nvidia_nvlink_c2c1_pmu_2/event=0x0/
  84. * Count event id 0x0 from the GPU connected with socket 3::
  85. perf stat -a -e nvidia_nvlink_c2c1_pmu_3/event=0x0/
  86. The NVLink-C2C has two ports that can be connected to one GPU (occupying both
  87. ports) or to two GPUs (one GPU per port). The user can use "port" bitmap
  88. parameter to select the port(s) to monitor. Each bit represents the port number,
  89. e.g. "port=0x1" corresponds to port 0 and "port=0x3" is for port 0 and 1. The
  90. PMU will monitor both ports by default if not specified.
  91. Example for port filtering:
  92. * Count event id 0x0 from the GPU connected with socket 0 on port 0::
  93. perf stat -a -e nvidia_nvlink_c2c1_pmu_0/event=0x0,port=0x1/
  94. * Count event id 0x0 from the GPUs connected with socket 0 on port 0 and port 1::
  95. perf stat -a -e nvidia_nvlink_c2c1_pmu_0/event=0x0,port=0x3/
  96. CNVLink PMU
  97. ---------------
  98. The CNVLink PMU monitors traffic from GPU and PCIE device on remote sockets
  99. to local memory. For PCIE traffic, this PMU captures read and relaxed ordered
  100. (RO) write traffic. Please see :ref:`NVIDIA_Uncore_PMU_Traffic_Coverage_Section`
  101. for more info about the PMU traffic coverage.
  102. The events and configuration options of this PMU device are described in sysfs,
  103. see /sys/bus/event_source/devices/nvidia_cnvlink_pmu_<socket-id>.
  104. Each SoC socket can be connected to one or more sockets via CNVLink. The user can
  105. use "rem_socket" bitmap parameter to select the remote socket(s) to monitor.
  106. Each bit represents the socket number, e.g. "rem_socket=0xE" corresponds to
  107. socket 1 to 3. The PMU will monitor all remote sockets by default if not
  108. specified.
  109. /sys/bus/event_source/devices/nvidia_cnvlink_pmu_<socket-id>/format/rem_socket
  110. shows the valid bits that can be set in the "rem_socket" parameter.
  111. The PMU can not distinguish the remote traffic initiator, therefore it does not
  112. provide filter to select the traffic source to monitor. It reports combined
  113. traffic from remote GPU and PCIE devices.
  114. Example usage:
  115. * Count event id 0x0 for the traffic from remote socket 1, 2, and 3 to socket 0::
  116. perf stat -a -e nvidia_cnvlink_pmu_0/event=0x0,rem_socket=0xE/
  117. * Count event id 0x0 for the traffic from remote socket 0, 2, and 3 to socket 1::
  118. perf stat -a -e nvidia_cnvlink_pmu_1/event=0x0,rem_socket=0xD/
  119. * Count event id 0x0 for the traffic from remote socket 0, 1, and 3 to socket 2::
  120. perf stat -a -e nvidia_cnvlink_pmu_2/event=0x0,rem_socket=0xB/
  121. * Count event id 0x0 for the traffic from remote socket 0, 1, and 2 to socket 3::
  122. perf stat -a -e nvidia_cnvlink_pmu_3/event=0x0,rem_socket=0x7/
  123. PCIE PMU
  124. ------------
  125. The PCIE PMU monitors all read/write traffic from PCIE root ports to
  126. local/remote memory. Please see :ref:`NVIDIA_Uncore_PMU_Traffic_Coverage_Section`
  127. for more info about the PMU traffic coverage.
  128. The events and configuration options of this PMU device are described in sysfs,
  129. see /sys/bus/event_source/devices/nvidia_pcie_pmu_<socket-id>.
  130. Each SoC socket can support multiple root ports. The user can use
  131. "root_port" bitmap parameter to select the port(s) to monitor, i.e.
  132. "root_port=0xF" corresponds to root port 0 to 3. The PMU will monitor all root
  133. ports by default if not specified.
  134. /sys/bus/event_source/devices/nvidia_pcie_pmu_<socket-id>/format/root_port
  135. shows the valid bits that can be set in the "root_port" parameter.
  136. Example usage:
  137. * Count event id 0x0 from root port 0 and 1 of socket 0::
  138. perf stat -a -e nvidia_pcie_pmu_0/event=0x0,root_port=0x3/
  139. * Count event id 0x0 from root port 0 and 1 of socket 1::
  140. perf stat -a -e nvidia_pcie_pmu_1/event=0x0,root_port=0x3/
  141. .. _NVIDIA_Uncore_PMU_Traffic_Coverage_Section:
  142. Traffic Coverage
  143. ----------------
  144. The PMU traffic coverage may vary dependent on the chip configuration:
  145. * **NVIDIA Grace Hopper Superchip**: Hopper GPU is connected with Grace SoC.
  146. Example configuration with two Grace SoCs::
  147. ********************************* *********************************
  148. * SOCKET-A * * SOCKET-B *
  149. * * * *
  150. * :::::::: * * :::::::: *
  151. * : PCIE : * * : PCIE : *
  152. * :::::::: * * :::::::: *
  153. * | * * | *
  154. * | * * | *
  155. * ::::::: ::::::::: * * ::::::::: ::::::: *
  156. * : : : : * * : : : : *
  157. * : GPU :<--NVLink-->: Grace :<---CNVLink--->: Grace :<--NVLink-->: GPU : *
  158. * : : C2C : SoC : * * : SoC : C2C : : *
  159. * ::::::: ::::::::: * * ::::::::: ::::::: *
  160. * | | * * | | *
  161. * | | * * | | *
  162. * &&&&&&&& &&&&&&&& * * &&&&&&&& &&&&&&&& *
  163. * & GMEM & & CMEM & * * & CMEM & & GMEM & *
  164. * &&&&&&&& &&&&&&&& * * &&&&&&&& &&&&&&&& *
  165. * * * *
  166. ********************************* *********************************
  167. GMEM = GPU Memory (e.g. HBM)
  168. CMEM = CPU Memory (e.g. LPDDR5X)
  169. |
  170. | Following table contains traffic coverage of Grace SoC PMU in socket-A:
  171. ::
  172. +--------------+-------+-----------+-----------+-----+----------+----------+
  173. | | Source |
  174. + +-------+-----------+-----------+-----+----------+----------+
  175. | Destination | |GPU ATS |GPU Not-ATS| | Socket-B | Socket-B |
  176. | |PCI R/W|Translated,|Translated | CPU | CPU/PCIE1| GPU/PCIE2|
  177. | | |EGM | | | | |
  178. +==============+=======+===========+===========+=====+==========+==========+
  179. | Local | PCIE |NVLink-C2C0|NVLink-C2C1| SCF | SCF PMU | CNVLink |
  180. | SYSRAM/CMEM | PMU |PMU |PMU | PMU | | PMU |
  181. +--------------+-------+-----------+-----------+-----+----------+----------+
  182. | Local GMEM | PCIE | N/A |NVLink-C2C1| SCF | SCF PMU | CNVLink |
  183. | | PMU | |PMU | PMU | | PMU |
  184. +--------------+-------+-----------+-----------+-----+----------+----------+
  185. | Remote | PCIE |NVLink-C2C0|NVLink-C2C1| SCF | | |
  186. | SYSRAM/CMEM | PMU |PMU |PMU | PMU | N/A | N/A |
  187. | over CNVLink | | | | | | |
  188. +--------------+-------+-----------+-----------+-----+----------+----------+
  189. | Remote GMEM | PCIE |NVLink-C2C0|NVLink-C2C1| SCF | | |
  190. | over CNVLink | PMU |PMU |PMU | PMU | N/A | N/A |
  191. +--------------+-------+-----------+-----------+-----+----------+----------+
  192. PCIE1 traffic represents strongly ordered (SO) writes.
  193. PCIE2 traffic represents reads and relaxed ordered (RO) writes.
  194. * **NVIDIA Grace CPU Superchip**: two Grace CPU SoCs are connected.
  195. Example configuration with two Grace SoCs::
  196. ******************* *******************
  197. * SOCKET-A * * SOCKET-B *
  198. * * * *
  199. * :::::::: * * :::::::: *
  200. * : PCIE : * * : PCIE : *
  201. * :::::::: * * :::::::: *
  202. * | * * | *
  203. * | * * | *
  204. * ::::::::: * * ::::::::: *
  205. * : : * * : : *
  206. * : Grace :<--------NVLink------->: Grace : *
  207. * : SoC : * C2C * : SoC : *
  208. * ::::::::: * * ::::::::: *
  209. * | * * | *
  210. * | * * | *
  211. * &&&&&&&& * * &&&&&&&& *
  212. * & CMEM & * * & CMEM & *
  213. * &&&&&&&& * * &&&&&&&& *
  214. * * * *
  215. ******************* *******************
  216. GMEM = GPU Memory (e.g. HBM)
  217. CMEM = CPU Memory (e.g. LPDDR5X)
  218. |
  219. | Following table contains traffic coverage of Grace SoC PMU in socket-A:
  220. ::
  221. +-----------------+-----------+---------+----------+-------------+
  222. | | Source |
  223. + +-----------+---------+----------+-------------+
  224. | Destination | | | Socket-B | Socket-B |
  225. | | PCI R/W | CPU | CPU/PCIE1| PCIE2 |
  226. | | | | | |
  227. +=================+===========+=========+==========+=============+
  228. | Local | PCIE PMU | SCF PMU | SCF PMU | NVLink-C2C0 |
  229. | SYSRAM/CMEM | | | | PMU |
  230. +-----------------+-----------+---------+----------+-------------+
  231. | Remote | | | | |
  232. | SYSRAM/CMEM | PCIE PMU | SCF PMU | N/A | N/A |
  233. | over NVLink-C2C | | | | |
  234. +-----------------+-----------+---------+----------+-------------+
  235. PCIE1 traffic represents strongly ordered (SO) writes.
  236. PCIE2 traffic represents reads and relaxed ordered (RO) writes.