xref: /linux/Documentation/gpu/amdgpu/debugfs.rst (revision ab93e0dd72c37d378dd936f031ffb83ff2bd87ce)
1==============
2AMDGPU DebugFS
3==============
4
5The amdgpu driver provides a number of debugfs files to aid in debugging
6issues in the driver.  These are usually found in
7/sys/kernel/debug/dri/<num>.
8
9DebugFS Files
10=============
11
12amdgpu_benchmark
13----------------
14
15Run benchmarks using the DMA engine the driver uses for GPU memory paging.
16Write a number to the file to run the test.  The results are written to the
17kernel log.  VRAM is on device memory (dGPUs) or carve out (APUs) and GTT
18(Graphics Translation Tables) is system memory that is accessible by the GPU.
19The following tests are available:
20
21- 1: simple test, VRAM to GTT and GTT to VRAM
22- 2: simple test, VRAM to VRAM
23- 3: GTT to VRAM, buffer size sweep, powers of 2
24- 4: VRAM to GTT, buffer size sweep, powers of 2
25- 5: VRAM to VRAM, buffer size sweep, powers of 2
26- 6: GTT to VRAM, buffer size sweep, common display sizes
27- 7: VRAM to GTT, buffer size sweep, common display sizes
28- 8: VRAM to VRAM, buffer size sweep, common display sizes
29
30amdgpu_test_ib
31--------------
32
33Read this file to run simple IB (Indirect Buffer) tests on all kernel managed
34rings.  IBs are command buffers usually generated by userspace applications
35which are submitted to the kernel for execution on an particular GPU engine.
36This just runs the simple IB tests included in the kernel.  These tests
37are engine specific and verify that IB submission works.
38
39amdgpu_discovery
40----------------
41
42Provides raw access to the IP discovery binary provided by the GPU.  Read this
43file to access the raw binary.  This is useful for verifying the contents of
44the IP discovery table.  It is chip specific.
45
46amdgpu_vbios
47------------
48
49Provides raw access to the ROM binary image from the GPU.  Read this file to
50access the raw binary.  This is useful for verifying the contents of the
51video BIOS ROM.  It is board specific.
52
53amdgpu_evict_gtt
54----------------
55
56Evict all buffers from the GTT memory pool.  Read this file to evict all
57buffers from this pool.
58
59amdgpu_evict_vram
60-----------------
61
62Evict all buffers from the VRAM memory pool.  Read this file to evict all
63buffers from this pool.
64
65amdgpu_gpu_recover
66------------------
67
68Trigger a GPU reset.  Read this file to trigger reset the entire GPU.
69All work currently running  on the GPU will be lost.
70
71amdgpu_ring_<name>
72------------------
73
74Provides read access to the kernel managed ring buffers for each ring <name>.
75These are useful for debugging problems on a particular ring.  The ring buffer
76is how the CPU sends commands to the GPU.  The CPU writes commands into the
77buffer and then asks the GPU engine to process it.  This is the raw binary
78contents of the ring buffer.  Use a tool like UMR to decode the rings into human
79readable form.
80
81amdgpu_mqd_<name>
82-----------------
83
84Provides read access to the kernel managed MQD (Memory Queue Descriptor) for
85ring <name> managed by the kernel driver.  MQDs define the features of the ring
86and are used to store the ring's state when it is not connected to hardware.
87The driver writes the requested ring features and metadata (GPU addresses of
88the ring itself and associated buffers) to the MQD and the firmware uses the MQD
89to populate the hardware when the ring is mapped to a hardware slot.  Only
90available on engines which use MQDs.  This provides access to the raw MQD
91binary.
92
93amdgpu_error_<name>
94-------------------
95
96Provides an interface to set an error code on the dma fences associated with
97ring <name>.  The error code specified is propogated to all fences associated
98with the ring.  Use this to inject a fence error into a ring.
99
100amdgpu_pm_info
101--------------
102
103Provides human readable information about the power management features
104and state of the GPU.  This includes current GFX clock, Memory clock,
105voltages, average SoC power, temperature, GFX load, Memory load, SMU
106feature mask, VCN power state, clock and power gating features.
107
108amdgpu_firmware_info
109--------------------
110
111Lists the firmware versions for all firmwares used by the GPU.  Only
112entries with a non-0 version are valid.  If the version is 0, the firmware
113is not valid for the GPU.
114
115amdgpu_fence_info
116-----------------
117
118Shows the last signalled and emitted fence sequence numbers for each
119kernel driver managed ring.  Fences are associated with submissions
120to the engine.  Emitted fences have been submitted to the ring
121and signalled fences have been signalled by the GPU.  Rings with a
122larger emitted fence value have outstanding work that is still being
123processed by the engine that owns that ring.  When the emitted and
124signalled fence values are equal, the ring is idle.
125
126amdgpu_gem_info
127---------------
128
129Lists all of the PIDs using the GPU and the GPU buffers that they have
130allocated.  This lists the buffer size, pool (VRAM, GTT, etc.), and buffer
131attributes (CPU access required, CPU cache attributes, etc.).
132
133amdgpu_vm_info
134--------------
135
136Lists all of the PIDs using the GPU and the GPU buffers that they have
137allocated as well as the status of those buffers relative to that process'
138GPU virtual address space (e.g., evicted, idle, invalidated, etc.).
139
140amdgpu_sa_info
141--------------
142
143Prints out all of the suballocations (sa) by the suballocation manager in the
144kernel driver.  Prints the GPU address, size, and fence info associated
145with each suballocation.  The suballocations are used internally within
146the kernel driver for various things.
147
148amdgpu_<pool>_mm
149----------------
150
151Prints TTM information about the memory pool <pool>.
152
153amdgpu_vram
154-----------
155
156Provides direct access to VRAM.  Used by tools like UMR to inspect
157objects in VRAM.
158
159amdgpu_iomem
160------------
161
162Provides direct access to GTT memory.  Used by tools like UMR to inspect
163GTT memory.
164
165amdgpu_regs_*
166-------------
167
168Provides direct access to various register aperatures on the GPU.  Used
169by tools like UMR to access GPU registers.
170
171amdgpu_regs2
172------------
173
174Provides an IOCTL interface used by UMR for interacting with GPU registers.
175
176
177amdgpu_sensors
178--------------
179
180Provides an interface to query GPU power metrics (temperature, average
181power, etc.).  Used by tools like UMR to query GPU power metrics.
182
183
184amdgpu_gca_config
185-----------------
186
187Provides an interface to query GPU details (Graphics/Compute Array config,
188PCI config, GPU family, etc.).  Used by tools like UMR to query GPU details.
189
190amdgpu_wave
191-----------
192
193Used to query GFX/compute wave information from the hardware.  Used by tools
194like UMR to query GFX/compute wave information.
195
196amdgpu_gpr
197----------
198
199Used to query GFX/compute GPR (General Purpose Register) information from the
200hardware.  Used by tools like UMR to query GPRs when debugging shaders.
201
202amdgpu_gprwave
203--------------
204
205Provides an IOCTL interface used by UMR for interacting with shader waves.
206
207amdgpu_fw_attestation
208---------------------
209
210Provides an interface for reading back firmware attestation records.
211