ubuntu:gpu:amd_gpu:overclocking:increase_power_on_amd_gpus
Differences
This shows you the differences between two versions of the page.
Next revision | Previous revision | ||
ubuntu:gpu:amd_gpu:overclocking:increase_power_on_amd_gpus [2023/06/27 10:04] – created peter | ubuntu:gpu:amd_gpu:overclocking:increase_power_on_amd_gpus [2023/06/27 13:45] (current) – [Set the Voltage] peter | ||
---|---|---|---|
Line 4: | Line 4: | ||
* This should increase performance. | * This should increase performance. | ||
+ | |||
+ | |||
+ | <WRAP alert> | ||
+ | **ALERT: | ||
+ | |||
+ | * 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! | ||
+ | |||
+ | </ | ||
+ | |||
+ | <WRAP info> | ||
+ | **NOTE: | ||
+ | |||
+ | * This can be done by running your 3D games/ | ||
+ | * If the adjustments made above causes stability issues, then restore factory default settings. | ||
+ | |||
+ | </ | ||
+ | |||
+ | <WRAP info> | ||
+ | **NOTE: | ||
+ | </ | ||
---- | ---- | ||
- | Append **amdgpu.ppfeaturemask=0xffffffff** to the GRUB configuration file. | + | ===== Edit GRUB Config ===== |
- | Appending this parameter will also allow us to have “full control” of the GPU; we’ll have more advanced options to choose from in CoreCtrl as far as voltage, GPU min/max frequency, and memory | + | ==== Make a Backup of GRUB ==== |
+ | |||
+ | <code bash> | ||
+ | sudo cp / | ||
+ | </ | ||
+ | |||
+ | <WRAP info> | ||
+ | **NOTE: | ||
+ | </ | ||
+ | |||
+ | ---- | ||
+ | |||
+ | ==== Edit GRUB Configuration ==== | ||
+ | |||
+ | Edit **/ | ||
+ | |||
+ | Change: | ||
+ | |||
+ | <file bash / | ||
+ | ... | ||
+ | GRUB_CMDLINE_LINUX_DEFAULT=" | ||
+ | ... | ||
+ | </ | ||
+ | |||
+ | to | ||
+ | |||
+ | <file bash / | ||
+ | ... | ||
+ | GRUB_CMDLINE_LINUX_DEFAULT=" | ||
+ | ... | ||
+ | </ | ||
+ | |||
+ | <WRAP info> | ||
+ | **NOTE: | ||
+ | |||
+ | * This will allow more advanced options to be chosen for Voltage, GPU min/max frequency, and Memory | ||
+ | |||
+ | </ | ||
+ | |||
+ | ---- | ||
+ | |||
+ | ==== Regenerate Bootloader Configuration ==== | ||
+ | |||
+ | <code bash> | ||
+ | sudo update-grub | ||
+ | |||
+ | or | ||
+ | |||
+ | sudo grub-mkconfig -o / | ||
+ | </ | ||
+ | |||
+ | <WRAP info> | ||
+ | **NOTE: | ||
+ | |||
+ | <code bash> | ||
+ | sudo grub2-mkconfig -o / | ||
+ | </ | ||
+ | |||
+ | </ | ||
+ | |||
+ | ---- | ||
+ | |||
+ | ==== Reboot ==== | ||
+ | |||
+ | After rebooting, check the Changes. | ||
+ | |||
+ | Verify the current featuremask after reboot by checking here: | ||
+ | |||
+ | <code bash> | ||
+ | printf " | ||
+ | </ | ||
+ | |||
+ | ---- | ||
+ | |||
+ | ===== Check the current performance levels ===== | ||
+ | |||
+ | <code bash> | ||
+ | cat / | ||
+ | </ | ||
+ | |||
+ | returns: | ||
+ | |||
+ | <code bash> | ||
+ | auto | ||
+ | </ | ||
+ | |||
+ | <WRAP info> | ||
+ | **NOTE: | ||
+ | |||
+ | * If not, then the following error will be seen: **Invalid argument errors when writing clock values of you don' | ||
+ | |||
+ | </ | ||
+ | |||
+ | ---- | ||
+ | |||
+ | ===== Set manual control ===== | ||
+ | |||
+ | <code bash> | ||
+ | echo " | ||
+ | </ | ||
+ | |||
+ | <WRAP info> | ||
+ | **NOTE: | ||
+ | |||
+ | * **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**, | ||
+ | * 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 ===== | ||
+ | |||
+ | <code bash> | ||
+ | readlink -f / | ||
+ | </ | ||
+ | |||
+ | returns: | ||
+ | |||
+ | <code bash> | ||
+ | / | ||
+ | </ | ||
+ | |||
+ | ---- | ||
+ | |||
+ | ===== Set the Voltage ===== | ||
+ | |||
+ | <WRAP info> | ||
+ | **NOTE: | ||
+ | |||
+ | * P0 is the lowest, when the system is idle, as normally do not need higher voltage and frequency. | ||
+ | * P6/P7 are what are used when gaming, | ||
+ | * P7 is the highest, when very heavy GPU usage is used. | ||
+ | * But note that P7 uses more voltage and higher frequency; which results in more heat. | ||
+ | * Often P7 is not needed. | ||
+ | |||
+ | </ | ||
+ | |||
+ | 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 **/ | ||
+ | |||
+ | <file bash / | ||
+ | sudo sh -c "echo 's 7 1450 1150' > / | ||
+ | sudo sh -c "echo 'm 2 2065 950' > / | ||
+ | </ | ||
+ | |||
+ | <WRAP info> | ||
+ | **NOTE: | ||
+ | |||
+ | * 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/ | ||
+ | </ | ||
+ | |||
+ | ---- | ||
+ | |||
+ | ===== Apply the changes ===== | ||
<WRAP alert> | <WRAP alert> | ||
- | **ALERT** This will effectively overclock | + | **WARNING:** Double check the entered values, as mistakes might instantly cause fatal hardware damage! |
+ | </ | ||
- | * This may result in erratic behavior being seen on the system (i.e. frequent crashing). | + | <code bash> |
- | * If so, restore the GRUB file back to what it was before! | + | echo " |
+ | </ | ||
+ | To check if it worked out, read out clocks and voltage under 3D load: | ||
+ | |||
+ | <code bash> | ||
+ | sudo watch -n 0.5 cat / | ||
+ | </ | ||
+ | |||
+ | |||
+ | <WRAP info> | ||
+ | **NOTE: | ||
+ | |||
+ | <code bash> | ||
+ | echo " | ||
+ | </ | ||
</ | </ | ||
+ | ---- | ||
+ | |||
+ | ===== Forbid the driver to switch to certain P-states ===== | ||
+ | |||
+ | 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: | ||
+ | |||
+ | <code bash> | ||
+ | echo " | ||
+ | echo " | ||
+ | </ | ||
+ | |||
+ | Allow only the three highest GPU P-states: | ||
+ | |||
+ | <code bash> | ||
+ | echo "5 6 7" > / | ||
+ | </ | ||
+ | |||
+ | To set the allowed maximum power consumption of the GPU to e.g. 50 Watts: | ||
+ | |||
+ | <code bash> | ||
+ | echo 50000000 > / | ||
+ | </ | ||
+ | |||
+ | ---- | ||
+ | |||
+ | ===== Across boots ===== | ||
+ | |||
+ | To enable these changes to carry over across boots create a script and systemd service. | ||
+ | |||
+ | * Use the values that have been tested to work and the file path to the GPU. | ||
+ | |||
+ | ---- | ||
+ | |||
+ | ==== Create a script ==== | ||
+ | |||
+ | <code bash> | ||
+ | #!/bin/sh | ||
+ | sudo sh -c "echo 's 7 <Your desired values here>' | ||
+ | sudo sh -c "echo 'm 2 <Your desired values here' > / | ||
+ | sudo sh -c "echo ' | ||
+ | </ | ||
+ | |||
+ | * Save this script in **/ | ||
+ | |||
+ | |||
+ | Create a file in **/ | ||
+ | |||
+ | <file bash undervolt.service> | ||
+ | [Unit] | ||
+ | Description=Undervolting GPU | ||
+ | |||
+ | [Service] | ||
+ | Type=oneshot | ||
+ | ExecStart=/ | ||
+ | |||
+ | [Install] | ||
+ | WantedBy=multi-user.target | ||
+ | </ | ||
+ | |||
+ | ---- | ||
+ | |||
+ | ==== Enable the service ==== | ||
+ | |||
+ | <code bash> | ||
+ | sudo systemctl enable undervolt.service | ||
+ | </ | ||
+ | |||
+ | ---- | ||
+ | |||
+ | ==== Reboot ==== | ||
+ | |||
+ | ---- | ||
+ | |||
+ | ==== Verify ==== | ||
+ | |||
+ | <code bash> | ||
+ | cat / | ||
+ | </ | ||
+ | |||
+ | <WRAP info> | ||
+ | **NOTE: | ||
+ | </ | ||
+ | |||
+ | ---- | ||
ubuntu/gpu/amd_gpu/overclocking/increase_power_on_amd_gpus.1687860261.txt.gz · Last modified: 2023/06/27 10:04 by peter