Difference between revisions of "Overclocking"

Jump to navigation Jump to search
(→‎CPU: I veto that information. Configuration depends on distribution, heat damages already supposedly occurred and defaults may be higher than that. Style fixes)
(More fixes)
Line 7: Line 7:
= A64-based devices =
= A64-based devices =


{{note|These instructions are targeting the Pinephone to simplify the explanation, however they can be used to also overclock other devices such as the Pinetab if you modify the proper DTB files.}}
{{note|These instructions are targeting the PinePhone to simplify the explanation, however they can be used to also overclock other devices such as the Pinetab if you modify the proper DTB files.}}


== Editing the Pinephone DTS ==
== Editing the PinePhone DTS ==


In order to overclock the Pinephone you will have to first convert the DTB file in <code>/boot/dtbs/allwinner/</code> to a DTS file. You will see <code>sun50i-a64-pinephone-1.2.dtb</code>, and also two other files with different pinephone mainboard revisions (1.1 and 1.0). You will want to select the correct file for your pinephone (Only choose 1.1 if you have a braveheart, As all other consumer pinephones use the 1.2 DTS).
In order to overclock the PinePhone you will have to first convert the DTB file in <code>/boot/dtbs/allwinner/</code> to a DTS file. You will see <code>sun50i-a64-pinephone-1.2.dtb</code>, and also two other files with different PinePhone mainboard revisions (1.1 and 1.0). You will want to select the correct file for your PinePhone (Only choose 1.1 if you have a Braveheart, As all other consumer PinePhones use the 1.2 DTS).


Once you've found the file, you can run the following command to convert the DTB to DTS:
Once you've found the file, you can run the following command to convert the DTB to DTS:
Line 33: Line 33:
The <code>assigned-clock-rates</code> line should be set to <code>432000000</code>, this means that the GPU is clocked at 432MHz by default. So if you want 500MHz, set the value to <code>500000000</code>.
The <code>assigned-clock-rates</code> line should be set to <code>432000000</code>, this means that the GPU is clocked at 432MHz by default. So if you want 500MHz, set the value to <code>500000000</code>.


Save the dts file, and recompile the DTB. In order to check if the overclock was successfully applied you can run: <code>sudo cat /sys/kernel/debug/clk/clk_summary</code>.
Save the DTS file, and recompile the DTB. In order to check if the overclock was successfully applied you can run: <code>sudo cat /sys/kernel/debug/clk/clk_summary</code>.


{{note|The file may be slightly different and you may need to enter the values as hexidecimals}}
{{note|The file may be slightly different and you may need to enter the values as hexadecimals}}
{{hint|The GPU appears to run stable overclocked to 540 Mhz, however more testing with a wider group of devices is needed.}}
{{hint|The GPU appears to run stable overclocked to 540 Mhz, however more testing with a wider group of devices is needed.}}
{{hint|Remember to run a benchmark tool (such as glmark2-es2) to help check stability.}}
{{hint|Remember to run a benchmark tool (such as glmark2-es2) to help check stability.}}
Line 63: Line 63:
The table above contains measurements created in postmarketOS (SWMO/SXMO - postmarketOS 21.12 SP1) with the screen on (set to 50% brightness) under a single threaded load.
The table above contains measurements created in postmarketOS (SWMO/SXMO - postmarketOS 21.12 SP1) with the screen on (set to 50% brightness) under a single threaded load.


{{note|The user '''somefoo''' was able to undervolt the PinePhone at each frequency operation point by at least -100mv. The A64 set to 1.152Ghz runs at 1.18v instead of the standard 1.3v, dropping the power usage by ~0.7w under full single threaded load! The silicon lottery will dictate how well you can undervolt.}}
{{note|The user ''somefoo'' was able to undervolt the PinePhone at each frequency operation point by at least -100mv. The A64 set to 1.152Ghz runs at 1.18v instead of the standard 1.3v, dropping the power usage by ~0.7w under full single threaded load! The silicon lottery will dictate how well you can undervolt.}}
{{hint|The exact voltages and frequencies that you can achieve will depend on your device. Make sure to run stress tests (such as '''stress-ng''') to ensure stability.}}
{{hint|The exact voltages and frequencies that you can achieve will depend on your device. Make sure to run stress tests (such as ''stress-ng'') to ensure stability.}}


== DRAM ==
== DRAM ==
Line 73: Line 73:
When overclocking the GPU, it is a good idea to also overclock the DRAM, as the main bottleneck of the A64 SOC is the memory. The A64's maximum ram clockspeed falls just short of 667MHz. This may be unstable on your device however.  
When overclocking the GPU, it is a good idea to also overclock the DRAM, as the main bottleneck of the A64 SOC is the memory. The A64's maximum ram clockspeed falls just short of 667MHz. This may be unstable on your device however.  


Around 600 MHz (PC-1200) should work fine, however some people have reported instability at lower clockspeeds. Arch Linux Arm uses a default clockspeed of 552MHz, with uboot builds available to easily switch out for a higher (624) or lower (492) DRAM clockspeed.
Around 600 MHz (PC-1200) should work fine, however some people have reported instability at lower clockspeeds. Arch Linux Arm uses a default clockspeed of 552MHz, with U-Boot builds available to easily switch out for a higher (624) or lower (492) DRAM clockspeed.


It is possible that by reverse engineering the DRAM driver from allwinner that auto tuning can be accomplished to get the best performance.
It is possible that by reverse engineering the DRAM driver from Allwinner that auto tuning can be accomplished to get the best performance.


Setting the DRAM clock is accomplished by modifying pinephone_defconfig in uboot (https://gitlab.com/pine64-org/u-boot/-/blob/crust/configs/pinephone_defconfig)
Setting the DRAM clock is accomplished by modifying pinephone_defconfig in U-Boot (https://gitlab.com/pine64-org/u-boot/-/blob/crust/configs/pinephone_defconfig)


You can find simple instructions on doing so here: [[Uboot]]
You can find simple instructions on doing so here: [[Uboot]]
Line 93: Line 93:
Overclocking cedrus is achieved by modifying the kernel source code: https://elixir.bootlin.com/linux/latest/source/drivers/staging/media/sunxi/cedrus/cedrus.c#L507
Overclocking cedrus is achieved by modifying the kernel source code: https://elixir.bootlin.com/linux/latest/source/drivers/staging/media/sunxi/cedrus/cedrus.c#L507


{{note|I'm (33yn2) not particularly sure if this makes any difference, or if it might infact have a negative impact. Probably not worth messing with.}}
{{note|User ''33yn2'' is not particularly sure if this makes any difference, or if it might in fact have a negative impact. Probably not worth messing with.}}


= RK3399-based devices =
= RK3399-based devices =
Line 99: Line 99:


More optimised voltages and clocks can be found in [https://github.com/torvalds/linux/blob/master/arch/arm64/boot/dts/rockchip/rk3399-op1-opp.dtsi arch/arm64/boot/dts/rockchip/rk3399-op1-opp.dtsi]
More optimised voltages and clocks can be found in [https://github.com/torvalds/linux/blob/master/arch/arm64/boot/dts/rockchip/rk3399-op1-opp.dtsi arch/arm64/boot/dts/rockchip/rk3399-op1-opp.dtsi]
These include a slight overclock and undervolt, they are intended for the OP1 CPU found in many chromebooks but have worked fine in all recorded cases on regular RK3399 SOCs in other devices.
These include a slight overclock and undervolt, they are intended for the OP1 CPU found in many Chromebooks but have worked fine in all recorded cases on regular RK3399 SoCs in other devices.


==GPU==
==GPU==