User Tools

Site Tools


ubuntu:gpu:amd_gpu:overclocking:increase_power_on_amd_gpus

This is an old revision of the document!


Ubuntu - GPU - AMD GPU - Overclocking - Increase Power on AMD GPUs

It is possible to increase the number of watts supplied to the GPU.

  • This should increase performance.

ALERT This will effectively overclock the GPU.

  • This may result in erratic behavior being seen on the system (i.e. frequent crashing).
  • If so, restore the GRUB file back to what it was before!

Edit GRUB Config

Make a Backup of GRUB

sudo cp /etc/default/grub /etc/default/grub.bak

NOTE: If the system somehow breaks, this can be used to restore the backup file.


Edit GRUB Configuration

Edit /etc/default/grub.

Change:

/etc/default/grub
...
GRUB_CMDLINE_LINUX_DEFAULT="quiet splash"
...

to

/etc/default/grub
...
GRUB_CMDLINE_LINUX_DEFAULT="quiet splash amdgpu.ppfeaturemask=0xffffffff"
...

NOTE: Appending this parameter will give “full control” of the GPU.

  • This will allow more advanced options to be chosen for Voltage, GPU min/max frequency, and Memory speed.

Regenerate Bootloader Configuration

sudo update-grub
 
or
 
sudo grub-mkconfig -o /boot/grub/grub.cfg

NOTE: On a Fedora or openSUSE distro use:

sudo grub2-mkconfig -o /boot/grub2/grub.cfg

Reboot

After rebooting, check the Changes.

Verify the current featuremask after reboot by checking here:

printf "0x%08x\n" $(cat /sys/module/amdgpu/parameters/ppfeaturemask)

Check the current performance levels

cat /sys/class/drm/card0/device/power_dpm_force_performance_level

returns:

auto

NOTE: To allow changing the performance, this has to be set to manual control.

  • If not, then the following error will be seen: Invalid argument errors when writing clock values of you don't.

Set manual control

echo "manual" > /sys/class/drm/card0/device/power_dpm_force_performance_level

NOTE: The available power_dpm_force_performance_level settings other than manual are:

  • auto: Drivers chooses automatically.
  • low: Forces the lowest possible clock and locks the GPU there.
  • high: Forces the highest possible clock and locks the GPU there.
  • profile_standard, profile_min_sclk, profile_min_mclk, profile_peak: “When the profiling modes are selected, clock and power gating are disabled and the clocks are set for different profiling cases.
    • This mode is recommended for profiling specific work loads where you do not want clock or power gating for clock fluctuation to interfere with your results.
    • profile_standard sets the clocks to a fixed clock level which varies from asic to asic.
    • profile_min_sclk forces the sclk to the lowest level.
    • profile_min_mclk forces the mclk to the lowest level.
    • profile_peak sets all clocks (mclk, sclk, pcie) to the highest levels.

Find the GPU device location

readlink -f /sys/class/drm/card0/device

returns:

/sys/devices/pci0000:00/0000:00:03.1/0000:0a:00.0/0000:0b:00.0/0000:0c:00.0

—-

Set the Voltage

To edit the P-state #7 for the core and #2 for the VRAM, as those are the values that our GPU is going to run at while under load.

Edit /sys/class/drm/card0/device/pp_od_clk_voltage:

/sys/class/drm/card0/device/pp_od_clk_voltage
sudo sh -c "echo 's 7 1450 1150' > /sys/devices/pci0000:00/0000:00:03.1/0000:0a:00.0/0000:0b:00.0/0000:0c:00.0/pp_od_clk_voltage"
sudo sh -c "echo 'm 2 2065 950' > /sys/devices/pci0000:00/0000:00:03.1/0000:0a:00.0/0000:0b:00.0/0000:0c:00.0/pp_od_clk_voltage"

NOTE: Ensure that the file path is correct per the previous command to discover the path.

  • The values for the clock speeds and voltages will also be different for each GPU.
  • To undervolt, change each P-State voltage for core and VRAM to be less than the default values.
  • The clock speeds might be able to be kept the same, but in some cases this will also have to be reduced.
    • This is where stability testing and benchmarking the GPU comes into play/
ubuntu/gpu/amd_gpu/overclocking/increase_power_on_amd_gpus.1687867665.txt.gz · Last modified: 2023/06/27 12:07 by peter

Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki