It is possible to increase the number of watts supplied to the GPU.
ALERT: This will effectively overclock the GPU.
NOTE: It is a best practice to increase voltage in small increments and then test for stability.
NOTE: Voltages are not shared between GPU and Memory Clocks; both are set independently.
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 /etc/default/grub.
Change:
... GRUB_CMDLINE_LINUX_DEFAULT="quiet splash" ...
to
... GRUB_CMDLINE_LINUX_DEFAULT="quiet splash amdgpu.ppfeaturemask=0xffffffff" ...
NOTE: Appending this parameter will give “full control” of the GPU.
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
After rebooting, check the Changes.
Verify the current featuremask after reboot by checking here:
printf "0x%08x\n" $(cat /sys/module/amdgpu/parameters/ppfeaturemask)
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.
echo "manual" > /sys/class/drm/card0/device/power_dpm_force_performance_level
NOTE: Other available power_dpm_force_performance_level settings are:
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
NOTE: P-states (Power States) are levels, L0 to L7. that indicate the frequency and voltage of the GPU processor at that state.
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:
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.
WARNING: Double check the entered values, as mistakes might instantly cause fatal hardware damage!
echo "c" > /sys/class/drm/card0/device/pp_od_clk_voltage
To check if it worked out, read out clocks and voltage under 3D load:
sudo watch -n 0.5 cat /sys/kernel/debug/dri/0/amdgpu_pm_info
NOTE: The default values can be reset:
echo "r" > /sys/class/drm/card0/device/pp_od_clk_voltage
This can be used to workaround problems with deep powersaving P-states like flickering artifacts or stutter.
To force the highest VRAM P-state on a Polaris RX 5xx card, while still allowing the GPU itself to run with lower clocks:
echo "manual" > /sys/class/drm/card0/device/power_dpm_force_performance_level echo "2" > /sys/class/drm/card0/device/pp_dpm_mclk
Allow only the three highest GPU P-states:
echo "5 6 7" > /sys/class/drm/card0/device/pp_dpm_sclk
To set the allowed maximum power consumption of the GPU to e.g. 50 Watts:
echo 50000000 > /sys/class/drm/card0/device/hwmon/hwmon0/power1_cap
To enable these changes to carry over across boots create a script and systemd service.
#!/bin/sh sudo sh -c "echo 's 7 <Your desired values here>' > /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 <Your desired values here' > /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 'c' > /sys/devices/pci0000:00/0000:00:03.1/0000:0a:00.0/0000:0b:00.0/0000:0c:00.0/pp_od_clk_voltage"
Create a file in /etc/systemd/system/ like undervolt.service:
[Unit] Description=Undervolting GPU [Service] Type=oneshot ExecStart=/Path/To/Script.sh [Install] WantedBy=multi-user.target
sudo systemctl enable undervolt.service
cat /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: It is recommended to make a similar script to revert things to default values.