18ae1a4eeSAlex Deucher============== 28ae1a4eeSAlex DeucherAMDGPU DebugFS 38ae1a4eeSAlex Deucher============== 48ae1a4eeSAlex Deucher 58ae1a4eeSAlex DeucherThe amdgpu driver provides a number of debugfs files to aid in debugging 68ae1a4eeSAlex Deucherissues in the driver. These are usually found in 78ae1a4eeSAlex Deucher/sys/kernel/debug/dri/<num>. 88ae1a4eeSAlex Deucher 98ae1a4eeSAlex DeucherDebugFS Files 108ae1a4eeSAlex Deucher============= 118ae1a4eeSAlex Deucher 128ae1a4eeSAlex Deucheramdgpu_benchmark 138ae1a4eeSAlex Deucher---------------- 148ae1a4eeSAlex Deucher 158ae1a4eeSAlex DeucherRun benchmarks using the DMA engine the driver uses for GPU memory paging. 168ae1a4eeSAlex DeucherWrite a number to the file to run the test. The results are written to the 179040e657SAlex Deucherkernel log. VRAM is on device memory (dGPUs) or carve out (APUs) and GTT 188ae1a4eeSAlex Deucher(Graphics Translation Tables) is system memory that is accessible by the GPU. 198ae1a4eeSAlex DeucherThe following tests are available: 208ae1a4eeSAlex Deucher 218ae1a4eeSAlex Deucher- 1: simple test, VRAM to GTT and GTT to VRAM 228ae1a4eeSAlex Deucher- 2: simple test, VRAM to VRAM 238ae1a4eeSAlex Deucher- 3: GTT to VRAM, buffer size sweep, powers of 2 248ae1a4eeSAlex Deucher- 4: VRAM to GTT, buffer size sweep, powers of 2 258ae1a4eeSAlex Deucher- 5: VRAM to VRAM, buffer size sweep, powers of 2 268ae1a4eeSAlex Deucher- 6: GTT to VRAM, buffer size sweep, common display sizes 278ae1a4eeSAlex Deucher- 7: VRAM to GTT, buffer size sweep, common display sizes 288ae1a4eeSAlex Deucher- 8: VRAM to VRAM, buffer size sweep, common display sizes 298ae1a4eeSAlex Deucher 308ae1a4eeSAlex Deucheramdgpu_test_ib 318ae1a4eeSAlex Deucher-------------- 328ae1a4eeSAlex Deucher 338ae1a4eeSAlex DeucherRead this file to run simple IB (Indirect Buffer) tests on all kernel managed 348ae1a4eeSAlex Deucherrings. IBs are command buffers usually generated by userspace applications 358ae1a4eeSAlex Deucherwhich are submitted to the kernel for execution on an particular GPU engine. 368ae1a4eeSAlex DeucherThis just runs the simple IB tests included in the kernel. These tests 378ae1a4eeSAlex Deucherare engine specific and verify that IB submission works. 388ae1a4eeSAlex Deucher 398ae1a4eeSAlex Deucheramdgpu_discovery 408ae1a4eeSAlex Deucher---------------- 418ae1a4eeSAlex Deucher 428ae1a4eeSAlex DeucherProvides raw access to the IP discovery binary provided by the GPU. Read this 438ae1a4eeSAlex Deucherfile to access the raw binary. This is useful for verifying the contents of 448ae1a4eeSAlex Deucherthe IP discovery table. It is chip specific. 458ae1a4eeSAlex Deucher 468ae1a4eeSAlex Deucheramdgpu_vbios 478ae1a4eeSAlex Deucher------------ 488ae1a4eeSAlex Deucher 498ae1a4eeSAlex DeucherProvides raw access to the ROM binary image from the GPU. Read this file to 508ae1a4eeSAlex Deucheraccess the raw binary. This is useful for verifying the contents of the 518ae1a4eeSAlex Deuchervideo BIOS ROM. It is board specific. 528ae1a4eeSAlex Deucher 538ae1a4eeSAlex Deucheramdgpu_evict_gtt 548ae1a4eeSAlex Deucher---------------- 558ae1a4eeSAlex Deucher 568ae1a4eeSAlex DeucherEvict all buffers from the GTT memory pool. Read this file to evict all 578ae1a4eeSAlex Deucherbuffers from this pool. 588ae1a4eeSAlex Deucher 598ae1a4eeSAlex Deucheramdgpu_evict_vram 608ae1a4eeSAlex Deucher----------------- 618ae1a4eeSAlex Deucher 628ae1a4eeSAlex DeucherEvict all buffers from the VRAM memory pool. Read this file to evict all 638ae1a4eeSAlex Deucherbuffers from this pool. 648ae1a4eeSAlex Deucher 658ae1a4eeSAlex Deucheramdgpu_gpu_recover 668ae1a4eeSAlex Deucher------------------ 678ae1a4eeSAlex Deucher 688ae1a4eeSAlex DeucherTrigger a GPU reset. Read this file to trigger reset the entire GPU. 698ae1a4eeSAlex DeucherAll work currently running on the GPU will be lost. 708ae1a4eeSAlex Deucher 718ae1a4eeSAlex Deucheramdgpu_ring_<name> 728ae1a4eeSAlex Deucher------------------ 738ae1a4eeSAlex Deucher 748ae1a4eeSAlex DeucherProvides read access to the kernel managed ring buffers for each ring <name>. 758ae1a4eeSAlex DeucherThese are useful for debugging problems on a particular ring. The ring buffer 768ae1a4eeSAlex Deucheris how the CPU sends commands to the GPU. The CPU writes commands into the 778ae1a4eeSAlex Deucherbuffer and then asks the GPU engine to process it. This is the raw binary 788ae1a4eeSAlex Deuchercontents of the ring buffer. Use a tool like UMR to decode the rings into human 798ae1a4eeSAlex Deucherreadable form. 808ae1a4eeSAlex Deucher 818ae1a4eeSAlex Deucheramdgpu_mqd_<name> 828ae1a4eeSAlex Deucher----------------- 838ae1a4eeSAlex Deucher 848ae1a4eeSAlex DeucherProvides read access to the kernel managed MQD (Memory Queue Descriptor) for 858ae1a4eeSAlex Deucherring <name> managed by the kernel driver. MQDs define the features of the ring 868ae1a4eeSAlex Deucherand are used to store the ring's state when it is not connected to hardware. 878ae1a4eeSAlex DeucherThe driver writes the requested ring features and metadata (GPU addresses of 888ae1a4eeSAlex Deucherthe ring itself and associated buffers) to the MQD and the firmware uses the MQD 898ae1a4eeSAlex Deucherto populate the hardware when the ring is mapped to a hardware slot. Only 908ae1a4eeSAlex Deucheravailable on engines which use MQDs. This provides access to the raw MQD 918ae1a4eeSAlex Deucherbinary. 928ae1a4eeSAlex Deucher 938ae1a4eeSAlex Deucheramdgpu_error_<name> 948ae1a4eeSAlex Deucher------------------- 958ae1a4eeSAlex Deucher 968ae1a4eeSAlex DeucherProvides an interface to set an error code on the dma fences associated with 97*cbf3a5d6SRakuram Eswaranring <name>. The error code specified is propagated to all fences associated 988ae1a4eeSAlex Deucherwith the ring. Use this to inject a fence error into a ring. 998ae1a4eeSAlex Deucher 1008ae1a4eeSAlex Deucheramdgpu_pm_info 1018ae1a4eeSAlex Deucher-------------- 1028ae1a4eeSAlex Deucher 1038ae1a4eeSAlex DeucherProvides human readable information about the power management features 1048ae1a4eeSAlex Deucherand state of the GPU. This includes current GFX clock, Memory clock, 1058ae1a4eeSAlex Deuchervoltages, average SoC power, temperature, GFX load, Memory load, SMU 1068ae1a4eeSAlex Deucherfeature mask, VCN power state, clock and power gating features. 1078ae1a4eeSAlex Deucher 1088ae1a4eeSAlex Deucheramdgpu_firmware_info 1098ae1a4eeSAlex Deucher-------------------- 1108ae1a4eeSAlex Deucher 1118ae1a4eeSAlex DeucherLists the firmware versions for all firmwares used by the GPU. Only 1128ae1a4eeSAlex Deucherentries with a non-0 version are valid. If the version is 0, the firmware 1138ae1a4eeSAlex Deucheris not valid for the GPU. 1148ae1a4eeSAlex Deucher 1158ae1a4eeSAlex Deucheramdgpu_fence_info 1168ae1a4eeSAlex Deucher----------------- 1178ae1a4eeSAlex Deucher 1188ae1a4eeSAlex DeucherShows the last signalled and emitted fence sequence numbers for each 1198ae1a4eeSAlex Deucherkernel driver managed ring. Fences are associated with submissions 1208ae1a4eeSAlex Deucherto the engine. Emitted fences have been submitted to the ring 1218ae1a4eeSAlex Deucherand signalled fences have been signalled by the GPU. Rings with a 1228ae1a4eeSAlex Deucherlarger emitted fence value have outstanding work that is still being 1238ae1a4eeSAlex Deucherprocessed by the engine that owns that ring. When the emitted and 1248ae1a4eeSAlex Deuchersignalled fence values are equal, the ring is idle. 1258ae1a4eeSAlex Deucher 1268ae1a4eeSAlex Deucheramdgpu_gem_info 1278ae1a4eeSAlex Deucher--------------- 1288ae1a4eeSAlex Deucher 1298ae1a4eeSAlex DeucherLists all of the PIDs using the GPU and the GPU buffers that they have 1308ae1a4eeSAlex Deucherallocated. This lists the buffer size, pool (VRAM, GTT, etc.), and buffer 1318ae1a4eeSAlex Deucherattributes (CPU access required, CPU cache attributes, etc.). 1328ae1a4eeSAlex Deucher 1338ae1a4eeSAlex Deucheramdgpu_vm_info 1348ae1a4eeSAlex Deucher-------------- 1358ae1a4eeSAlex Deucher 1368ae1a4eeSAlex DeucherLists all of the PIDs using the GPU and the GPU buffers that they have 1378ae1a4eeSAlex Deucherallocated as well as the status of those buffers relative to that process' 1388ae1a4eeSAlex DeucherGPU virtual address space (e.g., evicted, idle, invalidated, etc.). 1398ae1a4eeSAlex Deucher 1408ae1a4eeSAlex Deucheramdgpu_sa_info 1418ae1a4eeSAlex Deucher-------------- 1428ae1a4eeSAlex Deucher 1438ae1a4eeSAlex DeucherPrints out all of the suballocations (sa) by the suballocation manager in the 1448ae1a4eeSAlex Deucherkernel driver. Prints the GPU address, size, and fence info associated 1458ae1a4eeSAlex Deucherwith each suballocation. The suballocations are used internally within 1468ae1a4eeSAlex Deucherthe kernel driver for various things. 1478ae1a4eeSAlex Deucher 1488ae1a4eeSAlex Deucheramdgpu_<pool>_mm 1498ae1a4eeSAlex Deucher---------------- 1508ae1a4eeSAlex Deucher 1518ae1a4eeSAlex DeucherPrints TTM information about the memory pool <pool>. 1528ae1a4eeSAlex Deucher 1538ae1a4eeSAlex Deucheramdgpu_vram 1548ae1a4eeSAlex Deucher----------- 1558ae1a4eeSAlex Deucher 1568ae1a4eeSAlex DeucherProvides direct access to VRAM. Used by tools like UMR to inspect 1578ae1a4eeSAlex Deucherobjects in VRAM. 1588ae1a4eeSAlex Deucher 1598ae1a4eeSAlex Deucheramdgpu_iomem 1608ae1a4eeSAlex Deucher------------ 1618ae1a4eeSAlex Deucher 1628ae1a4eeSAlex DeucherProvides direct access to GTT memory. Used by tools like UMR to inspect 1638ae1a4eeSAlex DeucherGTT memory. 1648ae1a4eeSAlex Deucher 1658ae1a4eeSAlex Deucheramdgpu_regs_* 1668ae1a4eeSAlex Deucher------------- 1678ae1a4eeSAlex Deucher 168*cbf3a5d6SRakuram EswaranProvides direct access to various register apertures on the GPU. Used 1698ae1a4eeSAlex Deucherby tools like UMR to access GPU registers. 1708ae1a4eeSAlex Deucher 1718ae1a4eeSAlex Deucheramdgpu_regs2 1728ae1a4eeSAlex Deucher------------ 1738ae1a4eeSAlex Deucher 1748ae1a4eeSAlex DeucherProvides an IOCTL interface used by UMR for interacting with GPU registers. 1758ae1a4eeSAlex Deucher 1768ae1a4eeSAlex Deucher 1778ae1a4eeSAlex Deucheramdgpu_sensors 1788ae1a4eeSAlex Deucher-------------- 1798ae1a4eeSAlex Deucher 1808ae1a4eeSAlex DeucherProvides an interface to query GPU power metrics (temperature, average 1818ae1a4eeSAlex Deucherpower, etc.). Used by tools like UMR to query GPU power metrics. 1828ae1a4eeSAlex Deucher 1838ae1a4eeSAlex Deucher 1848ae1a4eeSAlex Deucheramdgpu_gca_config 1858ae1a4eeSAlex Deucher----------------- 1868ae1a4eeSAlex Deucher 1878ae1a4eeSAlex DeucherProvides an interface to query GPU details (Graphics/Compute Array config, 1888ae1a4eeSAlex DeucherPCI config, GPU family, etc.). Used by tools like UMR to query GPU details. 1898ae1a4eeSAlex Deucher 1908ae1a4eeSAlex Deucheramdgpu_wave 1918ae1a4eeSAlex Deucher----------- 1928ae1a4eeSAlex Deucher 1938ae1a4eeSAlex DeucherUsed to query GFX/compute wave information from the hardware. Used by tools 1948ae1a4eeSAlex Deucherlike UMR to query GFX/compute wave information. 1958ae1a4eeSAlex Deucher 1968ae1a4eeSAlex Deucheramdgpu_gpr 1978ae1a4eeSAlex Deucher---------- 1988ae1a4eeSAlex Deucher 1998ae1a4eeSAlex DeucherUsed to query GFX/compute GPR (General Purpose Register) information from the 2008ae1a4eeSAlex Deucherhardware. Used by tools like UMR to query GPRs when debugging shaders. 2018ae1a4eeSAlex Deucher 2028ae1a4eeSAlex Deucheramdgpu_gprwave 2038ae1a4eeSAlex Deucher-------------- 2048ae1a4eeSAlex Deucher 2058ae1a4eeSAlex DeucherProvides an IOCTL interface used by UMR for interacting with shader waves. 2068ae1a4eeSAlex Deucher 2078ae1a4eeSAlex Deucheramdgpu_fw_attestation 2088ae1a4eeSAlex Deucher--------------------- 2098ae1a4eeSAlex Deucher 2108ae1a4eeSAlex DeucherProvides an interface for reading back firmware attestation records. 211