debugging.rst 2.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980
  1. ===============
  2. GPU Debugging
  3. ===============
  4. GPUVM Debugging
  5. ===============
  6. To aid in debugging GPU virtual memory related problems, the driver supports a
  7. number of options module parameters:
  8. `vm_fault_stop` - If non-0, halt the GPU memory controller on a GPU page fault.
  9. `vm_update_mode` - If non-0, use the CPU to update GPU page tables rather than
  10. the GPU.
  11. Decoding a GPUVM Page Fault
  12. ===========================
  13. If you see a GPU page fault in the kernel log, you can decode it to figure
  14. out what is going wrong in your application. A page fault in your kernel
  15. log may look something like this:
  16. ::
  17. [gfxhub0] no-retry page fault (src_id:0 ring:24 vmid:3 pasid:32777, for process glxinfo pid 2424 thread glxinfo:cs0 pid 2425)
  18. in page starting at address 0x0000800102800000 from IH client 0x1b (UTCL2)
  19. VM_L2_PROTECTION_FAULT_STATUS:0x00301030
  20. Faulty UTCL2 client ID: TCP (0x8)
  21. MORE_FAULTS: 0x0
  22. WALKER_ERROR: 0x0
  23. PERMISSION_FAULTS: 0x3
  24. MAPPING_ERROR: 0x0
  25. RW: 0x0
  26. First you have the memory hub, gfxhub and mmhub. gfxhub is the memory
  27. hub used for graphics, compute, and sdma on some chips. mmhub is the
  28. memory hub used for multi-media and sdma on some chips.
  29. Next you have the vmid and pasid. If the vmid is 0, this fault was likely
  30. caused by the kernel driver or firmware. If the vmid is non-0, it is generally
  31. a fault in a user application. The pasid is used to link a vmid to a system
  32. process id. If the process is active when the fault happens, the process
  33. information will be printed.
  34. The GPU virtual address that caused the fault comes next.
  35. The client ID indicates the GPU block that caused the fault.
  36. Some common client IDs:
  37. - CB/DB: The color/depth backend of the graphics pipe
  38. - CPF: Command Processor Frontend
  39. - CPC: Command Processor Compute
  40. - CPG: Command Processor Graphics
  41. - TCP/SQC/SQG: Shaders
  42. - SDMA: SDMA engines
  43. - VCN: Video encode/decode engines
  44. - JPEG: JPEG engines
  45. PERMISSION_FAULTS describe what faults were encountered:
  46. - bit 0: the PTE was not valid
  47. - bit 1: the PTE read bit was not set
  48. - bit 2: the PTE write bit was not set
  49. - bit 3: the PTE execute bit was not set
  50. Finally, RW, indicates whether the access was a read (0) or a write (1).
  51. In the example above, a shader (cliend id = TCP) generated a read (RW = 0x0) to
  52. an invalid page (PERMISSION_FAULTS = 0x3) at GPU virtual address
  53. 0x0000800102800000. The user can then inspect their shader code and resource
  54. descriptor state to determine what caused the GPU page fault.
  55. UMR
  56. ===
  57. `umr <https://gitlab.freedesktop.org/tomstdenis/umr>`_ is a general purpose
  58. GPU debugging and diagnostics tool. Please see the umr
  59. `documentation <https://umr.readthedocs.io/en/main/>`_ for more information
  60. about its capabilities.