User Tools

Site Tools


linux:notes:amd_graphics

Information

  • Diagnostic commands for AMD graphics cards

AMDGPU

References

TODO

Query

Power Info

sudo watch --interval '0.5' cat '/sys/kernel/debug/dri/0/amdgpu_pm_info'

Power Sates

cat '/sys/class/drm/card0/device/pp_od_clk_voltage'

Overclock

SCLK

  • 7 is the highest available PSTATE for SCLK
  • 1386 is the value for SCLK for that PSTATE
  • 1155 is the voltage/VDDC for the specified SCLK for that PSTATE
  • When the highest PSTATE is used, the GPU Core will run at 1386MHz @ 1155mV
  • :!: This does not take effect immediately
echo 's 7 1386 1155' | sudo tee '/sys/class/drm/card0/device/pp_od_clk_voltage'

MCLK

  • 2 is the highest available PSTATE for MCLK
  • 2025 is the value for MCLK for that PSTATE
  • 955 is the voltage/VDDC for the specified MCLK for that PSTATE
  • When the highest PSTATE is used, the GPU Memory will run at 2025MHz @ 955mV
  • :!: This does not take effect immediately
echo 'm 2 2025 955' | sudo tee '/sys/class/drm/card0/device/pp_od_clk_voltage'

Verify Values

  • :!: Check if the specified values look alright
cat '/sys/class/drm/card0/device/pp_od_clk_voltage'

Commit

  • :!: Be absolutely certain the values above looked alright
  • :!: It is very well possible to destroy hardware with this if the values are too high
echo 'c' | sudo tee '/sys/class/drm/card0/device/pp_od_clk_voltage'

Verify Clocks

  • Runs glxgears without VSync, thus allowing the GPU to enter the highest PSTATE automatically
  • Queries power info live every 0.5s
vblank_mode='0' glxgears
sudo watch --interval '0.5' cat '/sys/kernel/debug/dri/0/amdgpu_pm_info'

Reset Clocks

  • Sets all CLKs and VDDCs to card defaults and commits it
echo 'r' | sudo tee '/sys/class/drm/card0/device/pp_od_clk_voltage' && echo 'c' | sudo tee '/sys/class/drm/card0/device/pp_od_clk_voltage'

PSTATE Control

Manual Controls

  • PSTATE will be manually controllable
  • TODO: auto makes sense as the default for this?
echo 'manual' | sudo tee '/sys/class/drm/card0/device/power_dpm_force_performance_level'
cat '/sys/class/drm/card0/device/power_dpm_force_performance_level'

SCLK

  • Can allow either a single PSTATE, or multiple to be automatically selected for SCLK based on GPU load
echo '7' | sudo tee '/sys/class/drm/card0/device/pp_dpm_sclk'
echo '5 6 7' | sudo tee '/sys/class/drm/card0/device/pp_dpm_sclk'

MCLK

  • Can allow either a single PSTATE, or multiple to be automatically selected for MCLK based on GPU load
echo '2' | sudo tee '/sys/class/drm/card0/device/pp_dpm_mclk'
echo '1 2' | sudo tee '/sys/class/drm/card0/device/pp_dpm_mclk'

Power Limit

Query

cat '/sys/class/drm/card0/device/hwmon/hwmon'*'/power1_cap'

Get Max

cat '/sys/class/drm/card0/device/hwmon/hwmon'*'/power1_cap_max'

Set

  • :!: This makes fun assumptions, but theoretically shouldn't allow the power cap to go above levels stated in the firmware; might not be dangerous
echo "$(cat '/sys/class/drm/card0/device/hwmon/hwmon'*'/power1_cap_max')" | sudo tee '/sys/class/drm/card0/device/hwmon/hwmon'*'/power1_cap' > '/dev/null'
echo "$(cat '/sys/class/drm/card1/device/hwmon/hwmon'*'/power1_cap_max')" | sudo tee '/sys/class/drm/card1/device/hwmon/hwmon'*'/power1_cap' > '/dev/null'
/usr/local/www/wiki/data/pages/linux/notes/amd_graphics.txt · Last modified: by 127.0.0.1