kbuild: Move -Wenum-enum-conversion to W=2
[linux.git] / Documentation / admin-guide / perf / nvidia-pmu.rst
blobf538ef67e0e8f09b0859bf8a97997b489b8522a1
1 =========================================================
2 NVIDIA Tegra SoC Uncore Performance Monitoring Unit (PMU)
3 =========================================================
5 The NVIDIA Tegra SoC includes various system PMUs to measure key performance
6 metrics like memory bandwidth, latency, and utilization:
8 * Scalable Coherency Fabric (SCF)
9 * NVLink-C2C0
10 * NVLink-C2C1
11 * CNVLink
12 * PCIE
14 PMU Driver
15 ----------
17 The PMUs in this document are based on ARM CoreSight PMU Architecture as
18 described in document: ARM IHI 0091. Since this is a standard architecture, the
19 PMUs are managed by a common driver "arm-cs-arch-pmu". This driver describes
20 the available events and configuration of each PMU in sysfs. Please see the
21 sections below to get the sysfs path of each PMU. Like other uncore PMU drivers,
22 the driver provides "cpumask" sysfs attribute to show the CPU id used to handle
23 the PMU event. There is also "associated_cpus" sysfs attribute, which contains a
24 list of CPUs associated with the PMU instance.
26 .. _SCF_PMU_Section:
28 SCF PMU
29 -------
31 The SCF PMU monitors system level cache events, CPU traffic, and
32 strongly-ordered (SO) PCIE write traffic to local/remote memory. Please see
33 :ref:`NVIDIA_Uncore_PMU_Traffic_Coverage_Section` for more info about the PMU
34 traffic coverage.
36 The events and configuration options of this PMU device are described in sysfs,
37 see /sys/bus/event_source/devices/nvidia_scf_pmu_<socket-id>.
39 Example usage:
41 * Count event id 0x0 in socket 0::
43    perf stat -a -e nvidia_scf_pmu_0/event=0x0/
45 * Count event id 0x0 in socket 1::
47    perf stat -a -e nvidia_scf_pmu_1/event=0x0/
49 NVLink-C2C0 PMU
50 --------------------
52 The NVLink-C2C0 PMU monitors incoming traffic from a GPU/CPU connected with
53 NVLink-C2C (Chip-2-Chip) interconnect. The type of traffic captured by this PMU
54 varies dependent on the chip configuration:
56 * NVIDIA Grace Hopper Superchip: Hopper GPU is connected with Grace SoC.
58   In this config, the PMU captures GPU ATS translated or EGM traffic from the GPU.
60 * NVIDIA Grace CPU Superchip: two Grace CPU SoCs are connected.
62   In this config, the PMU captures read and relaxed ordered (RO) writes from
63   PCIE device of the remote SoC.
65 Please see :ref:`NVIDIA_Uncore_PMU_Traffic_Coverage_Section` for more info about
66 the PMU traffic coverage.
68 The events and configuration options of this PMU device are described in sysfs,
69 see /sys/bus/event_source/devices/nvidia_nvlink_c2c0_pmu_<socket-id>.
71 Example usage:
73 * Count event id 0x0 from the GPU/CPU connected with socket 0::
75    perf stat -a -e nvidia_nvlink_c2c0_pmu_0/event=0x0/
77 * Count event id 0x0 from the GPU/CPU connected with socket 1::
79    perf stat -a -e nvidia_nvlink_c2c0_pmu_1/event=0x0/
81 * Count event id 0x0 from the GPU/CPU connected with socket 2::
83    perf stat -a -e nvidia_nvlink_c2c0_pmu_2/event=0x0/
85 * Count event id 0x0 from the GPU/CPU connected with socket 3::
87    perf stat -a -e nvidia_nvlink_c2c0_pmu_3/event=0x0/
89 The NVLink-C2C has two ports that can be connected to one GPU (occupying both
90 ports) or to two GPUs (one GPU per port). The user can use "port" bitmap
91 parameter to select the port(s) to monitor. Each bit represents the port number,
92 e.g. "port=0x1" corresponds to port 0 and "port=0x3" is for port 0 and 1. The
93 PMU will monitor both ports by default if not specified.
95 Example for port filtering:
97 * Count event id 0x0 from the GPU connected with socket 0 on port 0::
99    perf stat -a -e nvidia_nvlink_c2c0_pmu_0/event=0x0,port=0x1/
101 * Count event id 0x0 from the GPUs connected with socket 0 on port 0 and port 1::
103    perf stat -a -e nvidia_nvlink_c2c0_pmu_0/event=0x0,port=0x3/
105 NVLink-C2C1 PMU
106 -------------------
108 The NVLink-C2C1 PMU monitors incoming traffic from a GPU connected with
109 NVLink-C2C (Chip-2-Chip) interconnect. This PMU captures untranslated GPU
110 traffic, in contrast with NvLink-C2C0 PMU that captures ATS translated traffic.
111 Please see :ref:`NVIDIA_Uncore_PMU_Traffic_Coverage_Section` for more info about
112 the PMU traffic coverage.
114 The events and configuration options of this PMU device are described in sysfs,
115 see /sys/bus/event_source/devices/nvidia_nvlink_c2c1_pmu_<socket-id>.
117 Example usage:
119 * Count event id 0x0 from the GPU connected with socket 0::
121    perf stat -a -e nvidia_nvlink_c2c1_pmu_0/event=0x0/
123 * Count event id 0x0 from the GPU connected with socket 1::
125    perf stat -a -e nvidia_nvlink_c2c1_pmu_1/event=0x0/
127 * Count event id 0x0 from the GPU connected with socket 2::
129    perf stat -a -e nvidia_nvlink_c2c1_pmu_2/event=0x0/
131 * Count event id 0x0 from the GPU connected with socket 3::
133    perf stat -a -e nvidia_nvlink_c2c1_pmu_3/event=0x0/
135 The NVLink-C2C has two ports that can be connected to one GPU (occupying both
136 ports) or to two GPUs (one GPU per port). The user can use "port" bitmap
137 parameter to select the port(s) to monitor. Each bit represents the port number,
138 e.g. "port=0x1" corresponds to port 0 and "port=0x3" is for port 0 and 1. The
139 PMU will monitor both ports by default if not specified.
141 Example for port filtering:
143 * Count event id 0x0 from the GPU connected with socket 0 on port 0::
145    perf stat -a -e nvidia_nvlink_c2c1_pmu_0/event=0x0,port=0x1/
147 * Count event id 0x0 from the GPUs connected with socket 0 on port 0 and port 1::
149    perf stat -a -e nvidia_nvlink_c2c1_pmu_0/event=0x0,port=0x3/
151 CNVLink PMU
152 ---------------
154 The CNVLink PMU monitors traffic from GPU and PCIE device on remote sockets
155 to local memory. For PCIE traffic, this PMU captures read and relaxed ordered
156 (RO) write traffic. Please see :ref:`NVIDIA_Uncore_PMU_Traffic_Coverage_Section`
157 for more info about the PMU traffic coverage.
159 The events and configuration options of this PMU device are described in sysfs,
160 see /sys/bus/event_source/devices/nvidia_cnvlink_pmu_<socket-id>.
162 Each SoC socket can be connected to one or more sockets via CNVLink. The user can
163 use "rem_socket" bitmap parameter to select the remote socket(s) to monitor.
164 Each bit represents the socket number, e.g. "rem_socket=0xE" corresponds to
165 socket 1 to 3. The PMU will monitor all remote sockets by default if not
166 specified.
167 /sys/bus/event_source/devices/nvidia_cnvlink_pmu_<socket-id>/format/rem_socket
168 shows the valid bits that can be set in the "rem_socket" parameter.
170 The PMU can not distinguish the remote traffic initiator, therefore it does not
171 provide filter to select the traffic source to monitor. It reports combined
172 traffic from remote GPU and PCIE devices.
174 Example usage:
176 * Count event id 0x0 for the traffic from remote socket 1, 2, and 3 to socket 0::
178    perf stat -a -e nvidia_cnvlink_pmu_0/event=0x0,rem_socket=0xE/
180 * Count event id 0x0 for the traffic from remote socket 0, 2, and 3 to socket 1::
182    perf stat -a -e nvidia_cnvlink_pmu_1/event=0x0,rem_socket=0xD/
184 * Count event id 0x0 for the traffic from remote socket 0, 1, and 3 to socket 2::
186    perf stat -a -e nvidia_cnvlink_pmu_2/event=0x0,rem_socket=0xB/
188 * Count event id 0x0 for the traffic from remote socket 0, 1, and 2 to socket 3::
190    perf stat -a -e nvidia_cnvlink_pmu_3/event=0x0,rem_socket=0x7/
193 PCIE PMU
194 ------------
196 The PCIE PMU monitors all read/write traffic from PCIE root ports to
197 local/remote memory. Please see :ref:`NVIDIA_Uncore_PMU_Traffic_Coverage_Section`
198 for more info about the PMU traffic coverage.
200 The events and configuration options of this PMU device are described in sysfs,
201 see /sys/bus/event_source/devices/nvidia_pcie_pmu_<socket-id>.
203 Each SoC socket can support multiple root ports. The user can use
204 "root_port" bitmap parameter to select the port(s) to monitor, i.e.
205 "root_port=0xF" corresponds to root port 0 to 3. The PMU will monitor all root
206 ports by default if not specified.
207 /sys/bus/event_source/devices/nvidia_pcie_pmu_<socket-id>/format/root_port
208 shows the valid bits that can be set in the "root_port" parameter.
210 Example usage:
212 * Count event id 0x0 from root port 0 and 1 of socket 0::
214    perf stat -a -e nvidia_pcie_pmu_0/event=0x0,root_port=0x3/
216 * Count event id 0x0 from root port 0 and 1 of socket 1::
218    perf stat -a -e nvidia_pcie_pmu_1/event=0x0,root_port=0x3/
220 .. _NVIDIA_Uncore_PMU_Traffic_Coverage_Section:
222 Traffic Coverage
223 ----------------
225 The PMU traffic coverage may vary dependent on the chip configuration:
227 * **NVIDIA Grace Hopper Superchip**: Hopper GPU is connected with Grace SoC.
229   Example configuration with two Grace SoCs::
231    *********************************          *********************************
232    * SOCKET-A                      *          * SOCKET-B                      *
233    *                               *          *                               *
234    *                     ::::::::  *          *  ::::::::                     *
235    *                     : PCIE :  *          *  : PCIE :                     *
236    *                     ::::::::  *          *  ::::::::                     *
237    *                         |     *          *      |                        *
238    *                         |     *          *      |                        *
239    *  :::::::            ::::::::: *          *  :::::::::            ::::::: *
240    *  :     :            :       : *          *  :       :            :     : *
241    *  : GPU :<--NVLink-->: Grace :<---CNVLink--->: Grace :<--NVLink-->: GPU : *
242    *  :     :    C2C     :  SoC  : *          *  :  SoC  :    C2C     :     : *
243    *  :::::::            ::::::::: *          *  :::::::::            ::::::: *
244    *     |                   |     *          *      |                   |    *
245    *     |                   |     *          *      |                   |    *
246    *  &&&&&&&&           &&&&&&&&  *          *   &&&&&&&&           &&&&&&&& *
247    *  & GMEM &           & CMEM &  *          *   & CMEM &           & GMEM & *
248    *  &&&&&&&&           &&&&&&&&  *          *   &&&&&&&&           &&&&&&&& *
249    *                               *          *                               *
250    *********************************          *********************************
252    GMEM = GPU Memory (e.g. HBM)
253    CMEM = CPU Memory (e.g. LPDDR5X)
255   |
256   | Following table contains traffic coverage of Grace SoC PMU in socket-A:
258   ::
260    +--------------+-------+-----------+-----------+-----+----------+----------+
261    |              |                        Source                             |
262    +              +-------+-----------+-----------+-----+----------+----------+
263    | Destination  |       |GPU ATS    |GPU Not-ATS|     | Socket-B | Socket-B |
264    |              |PCI R/W|Translated,|Translated | CPU | CPU/PCIE1| GPU/PCIE2|
265    |              |       |EGM        |           |     |          |          |
266    +==============+=======+===========+===========+=====+==========+==========+
267    | Local        | PCIE  |NVLink-C2C0|NVLink-C2C1| SCF | SCF PMU  | CNVLink  |
268    | SYSRAM/CMEM  | PMU   |PMU        |PMU        | PMU |          | PMU      |
269    +--------------+-------+-----------+-----------+-----+----------+----------+
270    | Local GMEM   | PCIE  |    N/A    |NVLink-C2C1| SCF | SCF PMU  | CNVLink  |
271    |              | PMU   |           |PMU        | PMU |          | PMU      |
272    +--------------+-------+-----------+-----------+-----+----------+----------+
273    | Remote       | PCIE  |NVLink-C2C0|NVLink-C2C1| SCF |          |          |
274    | SYSRAM/CMEM  | PMU   |PMU        |PMU        | PMU |   N/A    |   N/A    |
275    | over CNVLink |       |           |           |     |          |          |
276    +--------------+-------+-----------+-----------+-----+----------+----------+
277    | Remote GMEM  | PCIE  |NVLink-C2C0|NVLink-C2C1| SCF |          |          |
278    | over CNVLink | PMU   |PMU        |PMU        | PMU |   N/A    |   N/A    |
279    +--------------+-------+-----------+-----------+-----+----------+----------+
281    PCIE1 traffic represents strongly ordered (SO) writes.
282    PCIE2 traffic represents reads and relaxed ordered (RO) writes.
284 * **NVIDIA Grace CPU Superchip**: two Grace CPU SoCs are connected.
286   Example configuration with two Grace SoCs::
288    *******************             *******************
289    * SOCKET-A        *             * SOCKET-B        *
290    *                 *             *                 *
291    *    ::::::::     *             *    ::::::::     *
292    *    : PCIE :     *             *    : PCIE :     *
293    *    ::::::::     *             *    ::::::::     *
294    *        |        *             *        |        *
295    *        |        *             *        |        *
296    *    :::::::::    *             *    :::::::::    *
297    *    :       :    *             *    :       :    *
298    *    : Grace :<--------NVLink------->: Grace :    *
299    *    :  SoC  :    *     C2C     *    :  SoC  :    *
300    *    :::::::::    *             *    :::::::::    *
301    *        |        *             *        |        *
302    *        |        *             *        |        *
303    *     &&&&&&&&    *             *     &&&&&&&&    *
304    *     & CMEM &    *             *     & CMEM &    *
305    *     &&&&&&&&    *             *     &&&&&&&&    *
306    *                 *             *                 *
307    *******************             *******************
309    GMEM = GPU Memory (e.g. HBM)
310    CMEM = CPU Memory (e.g. LPDDR5X)
312   |
313   | Following table contains traffic coverage of Grace SoC PMU in socket-A:
315   ::
317    +-----------------+-----------+---------+----------+-------------+
318    |                 |                      Source                  |
319    +                 +-----------+---------+----------+-------------+
320    | Destination     |           |         | Socket-B | Socket-B    |
321    |                 |  PCI R/W  |   CPU   | CPU/PCIE1| PCIE2       |
322    |                 |           |         |          |             |
323    +=================+===========+=========+==========+=============+
324    | Local           |  PCIE PMU | SCF PMU | SCF PMU  | NVLink-C2C0 |
325    | SYSRAM/CMEM     |           |         |          | PMU         |
326    +-----------------+-----------+---------+----------+-------------+
327    | Remote          |           |         |          |             |
328    | SYSRAM/CMEM     |  PCIE PMU | SCF PMU |   N/A    |     N/A     |
329    | over NVLink-C2C |           |         |          |             |
330    +-----------------+-----------+---------+----------+-------------+
332    PCIE1 traffic represents strongly ordered (SO) writes.
333    PCIE2 traffic represents reads and relaxed ordered (RO) writes.