ubuntu:gpu:amd_gpu:overclocking:increase_power_on_amd_gpus
Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
ubuntu:gpu:amd_gpu:overclocking:increase_power_on_amd_gpus [2023/06/27 10:44] – peter | ubuntu:gpu:amd_gpu:overclocking:increase_power_on_amd_gpus [2023/06/27 13:45] (current) – [Set the Voltage] peter | ||
---|---|---|---|
Line 7: | Line 7: | ||
<WRAP alert> | <WRAP alert> | ||
- | **ALERT** | + | **ALERT:** This will effectively overclock the GPU. |
* This may result in erratic behavior being seen on the system (i.e. frequent crashing). | * 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! | * 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: | ||
</ | </ | ||
Line 120: | Line 132: | ||
<WRAP info> | <WRAP info> | ||
- | **NOTE: | + | **NOTE: |
* **auto**: Drivers chooses automatically. | * **auto**: Drivers chooses automatically. | ||
* **low**: Forces the lowest possible clock and locks the GPU there. | * **low**: Forces the lowest possible clock and locks the GPU there. | ||
* **high**: Forces the highest possible clock and locks the GPU there. | * **high**: Forces the highest possible clock and locks the GPU there. | ||
- | * **profile_standard**, | + | * **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. | * 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_standard** sets the clocks to a fixed clock level which varies from asic to asic. | ||
Line 135: | Line 147: | ||
---- | ---- | ||
+ | ===== 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> | ||
+ | **WARNING: | ||
+ | </ | ||
+ | |||
+ | <code bash> | ||
+ | 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.1687862643.txt.gz · Last modified: 2023/06/27 10:44 by peter