AMDGPU RAS DEBUGFS CONTROL INTERFACE(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’– AMDGPU RAS debugfs control interface πŸ’–

okay bestie, this is the Kernel API Manual page for the AMDGPU RAS debugfs control interface β€” and yes, it’s giving kernel-internals main character energy. ✨

The control interface accepts struct ras_debug_if, and that struct has two members. First member: ras_debug_if::head or ras_debug_if::inject.

head is used to indicate which IP block will be under control. It has four members, they are block, type, sub_block_index, name.

  • block β€” which IP will be under control.
  • type β€” what kind of error will be enabled/disabled/injected.
  • sub_block_index β€” some IPs have subcomponets. say, GFX, sDMA.
  • name β€” the name of IP.

inject has three more members than head, they are address, value and mask. As their names indicate, inject operation will write the value to the address.

The second member: struct ras_debug_if::op. It has three kinds of operations.

  • 0 β€” disable RAS on the block. Take ::head as its data.
  • 1 β€” enable RAS on the block. Take ::head as its data.
  • 2 β€” inject errors on the block. Take ::inject as its data.

πŸŽ€ How to use the interface? πŸŽ€

In a program: copy the struct ras_debug_if in your code and initialize it. Write the struct to the control interface.

From shell:

echo "disable <block>" > /sys/kernel/debug/dri/<N>/ras/ras_ctrl
echo "enable  <block> <error>" > /sys/kernel/debug/dri/<N>/ras/ras_ctrl
echo "inject  <block> <error> <sub-block> <address> <value> <mask>" > /sys/kernel/debug/dri/<N>/ras/ras_ctrl

Where N, is the card which you want to affect.

"disable" requires only the block. "enable" requires the block and error type. "inject" requires the block, error type, address, and value.

The block is one of: umc, sdma, gfx, etc. see ras_block_string[] for details.

The error type is one of: ue, ce and poison where, ue is multi-uncorrectable, ce is single-correctable, and poison is poison.

The sub-block is the sub-block index β€” pass 0 if there is no sub-block. The address and value are hexadecimal numbers, leading 0x is optional. The mask means instance mask, is optional, default value is 0x1.

For instance,

echo inject umc ue 0x0 0x0 0x0 > /sys/kernel/debug/dri/0/ras/ras_ctrl
echo inject umc ce 0 0 0 3 > /sys/kernel/debug/dri/0/ras/ras_ctrl
echo disable umc > /sys/kernel/debug/dri/0/ras/ras_ctrl

πŸ” How to check the result of the operation? πŸ”

To check disable/enable, see "ras" features at, /sys/class/drm/card[0/1/2...]/device/ras/features

To check inject, see the corresponding error count at, /sys/class/drm/card[0/1/2...]/device/ras/[gfx|sdma|umc|...]_err_count

⚠️ NOTE: Operations are only allowed on blocks which are supported. Check the "ras" mask at /sys/module/amdgpu/parameters/ras_mask to see which blocks support RAS on a particular asic.

πŸ‘€ SEE ALSO πŸ‘€


πŸ’– that’s the whole page, bestie πŸ’– source/version footer: ./drivers/gpu/drm/amd/amdgpu; date: October 2026; footer title: AMDGPU RAS d...ol interface(9). mwah πŸ’‹βœ¨

πŸ“¦ where this page comes from