tudor
Posts: 11
Joined: Wed Apr 09, 2014 12:07 pm

raspberry pi 3B underclock

Sun Jun 16, 2019 2:06 pm

Hello,

I would like to reduce the temperature and power consumption of a raspberry pi 3b.
I has a reasonably good heatsink.

I think I have identified a bug in frequency scaling code, at least for my use-case.

config.txt has:

Code: Select all

arm_freq=900
gpu_freq=250
core_freq=250
disable_auto_turbo=1
With a long - 20 minutes compilation on all 4 cores the temperature will eventually go over 75C.
Around 75-80C, instead of reducing the frequency,

Code: Select all

/vcgencmd measure_clock arm
will instead show 1,1 Ghz. The temperature will quickly go up, it will overheat and reduce to 920Mhz or even 870Mhz, but go up again after.

Is there a way/setting to tell it to never go above 900Mhz, especially when already overheated?

Regards,

jahboater
Posts: 4595
Joined: Wed Feb 04, 2015 6:38 pm

Re: raspberry pi 3B underclock

Sun Jun 16, 2019 3:51 pm

Its not an answer, but can I suggest getting a Pi3B+ (with the plus) ?

This revision of the Pi3 has extensive changes to improve the thermal management.
There is a heat spreader on the SoC chip and the PCB ground plane itself is designed to conduct away heat from the SoC.

In addition, changes to the power supply paths to each core have also improved stability for heavy loads.

Without a fan, mine runs at 1.4Ghz all the time even during long builds with all four cores maxed out.
A decent passive heat sink helps of course.

tudor
Posts: 11
Joined: Wed Apr 09, 2014 12:07 pm

Re: raspberry pi 3B underclock

Sun Jun 16, 2019 4:28 pm

The heat-sink is not compatible with 3b+.
I do have 3b+'s but they use even more power than 3b and on this case i don't use ethernet, so no advantage.
The stability is ok, it works even at 1,1ghz.

My issue is that it:
- uses more power than asked
- produces more heat than asked

jahboater
Posts: 4595
Joined: Wed Feb 04, 2015 6:38 pm

Re: raspberry pi 3B underclock

Sun Jun 16, 2019 5:33 pm

tudor wrote:
Sun Jun 16, 2019 4:28 pm
My issue is that it:
- uses more power than asked
- produces more heat than asked
The heat is easily dealt with:-

https://www.kintaro.co/products/kintaro-custom-heatsink

For power consumption, arm_freq=800 or something should also reduce the core voltage.
For example, Pi Zero's come with a factory overclock that is perfectly stable, but I run mine at
800MHz and 1.2V (over_voltage=-6).

Here is a useful script that will check your settings and monitor temps/voltages etc

Code: Select all

#!/bin/bash
vcgencmd get_config int
Counter=14
DisplayHeader="Time      Temp    CPU          Health         Vcore"
while true ; do
  let ++Counter
  if [ ${Counter} -eq 15 ]; then
	echo -e "${DisplayHeader}"
	Counter=0
  fi
  Health=$(perl -e "printf \"%19b\n\", $(vcgencmd get_throttled | cut -f2 -d=)")
  Temp=$(vcgencmd measure_temp | cut -f2 -d=)
  Clockspeed=$(vcgencmd measure_clock arm | awk -F"=" '{printf ("%0.0f",$2/1000000); }' )
  CoreVolt=$(vcgencmd measure_volts | cut -f2 -d= | sed 's/000//')
  echo -e "$(date '+%H:%M:%S') ${Temp} $(printf '%4s' ${Clockspeed})MHz $(printf '%020u' ${Health}) ${CoreVolt}"
  sleep 5
done
Run it in another window whilst your large build is in progress!

tudor
Posts: 11
Joined: Wed Apr 09, 2014 12:07 pm

Re: raspberry pi 3B underclock

Sun Jun 16, 2019 8:11 pm

The heat sink is very similar with kintaro, but allows hats (is not as tall). I didn't find a reasonable price for kintaro in europe yet.
(shipping more expensive than heat-sink)

Code: Select all

[email protected]:~/personal/scripts/raspi $ ./info.sh
aphy_params_current=819
arm_freq=900
audio_pwm_mode=514
config_hdmi_boost=5
core_freq=250
desired_osc_freq=0x36ee80
disable_auto_turbo=1
disable_commandline_tags=2
disable_l2cache=1
display_default_lcd=1
display_hdmi_rotate=-1
display_lcd_rotate=-1
dphy_params_current=547
force_eeprom_read=1
force_pwm_open=1
framebuffer_ignore_alpha=1
framebuffer_swap=1
gpu_freq=250
hdmi_force_cec_address=65535
init_uart_clock=0x2dc6c00
lcd_framerate=60
over_voltage_avs=0x186a0
pause_burst_frames=1
program_serial_random=1
sdram_freq=450
Time      Temp    CPU          Health         Vcore
22:02:31 79.5'C  900MHz 00100000000000000000 1.3V
22:02:36 79.5'C  900MHz 00100000000000000000 1.3V
22:02:41 79.5'C  900MHz 00100000000000000000 1.3V
22:02:47 79.5'C  900MHz 00100000000000000000 1.3V
22:02:52 78.4'C  900MHz 00100000000000000000 1.3V
22:02:57 79.0'C  900MHz 00100000000000000000 1.3V
22:03:02 79.5'C  900MHz 00100000000000000000 1.3V
22:03:08 79.5'C  900MHz 00100000000000000000 1.3V
22:03:13 79.0'C  900MHz 00100000000000000000 1.3V
22:03:18 79.0'C  900MHz 00100000000000000000 1.3V
22:03:23 79.5'C  900MHz 00100000000000000000 1.3V
22:03:29 79.5'C  900MHz 00100000000000000000 1.3V
22:03:34 79.5'C 1195MHz 00100000000000000010 1.3V
22:03:39 80.6'C 1141MHz 00100000000000000010 1.3V
22:03:44 81.7'C 1141MHz 00100000000000000010 1.3V
Time      Temp    CPU          Health         Vcore
22:03:49 81.1'C 1141MHz 00100000000000000010 1.3V
22:03:54 81.1'C 1087MHz 00100000000000000010 1.3V

For power consumption, arm_freq=800 or something should also reduce the core voltage.
This is exactly what i'm trying to do and doesn't work!

User avatar
Imperf3kt
Posts: 2559
Joined: Tue Jun 20, 2017 12:16 am
Location: Australia

Re: raspberry pi 3B underclock

Sun Jun 16, 2019 9:31 pm

It's odd that a mere 20 minute compile job would cause your Pi to get so hot and throttle.

The last time I compiled something on my Pi3b it took in excess of three hours and never went above 65°C
At the time I had no heatsink on my Pi at all.


Something seems unusual about your Pi.
55:55:44:44:4C
52:4C:52:42:41

tudor
Posts: 11
Joined: Wed Apr 09, 2014 12:07 pm

Re: raspberry pi 3B underclock

Sun Jun 16, 2019 9:43 pm

The pi is in a box. The current source does not have undervoltage.
With a different source it's almost all the time at 600mhz and 50-60C.

The bug that i'm trying to get help is:
1. temperature and current consumption ok (the chosen 900mhz)
2. when the intensive use of the cpu raises the temperature to 80C it goes crazy
3. when it gets to idle after compilation/intensive use finished it's ok again

I would like especially when the pi is used at it's max to have the temperature and frequency limited. It seems to limit it at all other times :roll:

jahboater
Posts: 4595
Joined: Wed Feb 04, 2015 6:38 pm

Re: raspberry pi 3B underclock

Sun Jun 16, 2019 10:12 pm

tudor wrote:
Sun Jun 16, 2019 9:43 pm
The pi is in a box.
Time to let it out!

This is my Pi3B+. The first program run starting at 23:05:01 was one core flat out. As you can see the temp barely rises.
The second job starting at 23:05:41 was a deliberate pathological stress test that uses NEON on all four cores. Given time the temp will rise to around 70C and maybe start to throttle. This test would likely have crashed the old Pi3, the new plus model is much more stable.
No normal workload, even compilations using all four cores for several hours, gets it close to throttling.
As you can see the Pi's clock speeds are high.

Code: Select all

$ ./pistat.sh 
aphy_params_current=819
arm_freq=1400
audio_pwm_mode=514
config_hdmi_boost=5
core_freq=500
desired_osc_freq=0x331df0
desired_osc_freq_boost=0x3c45b0
disable_commandline_tags=2
disable_l2cache=1
disable_splash=1
display_hdmi_rotate=-1
display_lcd_rotate=-1
dphy_params_current=547
force_eeprom_read=1
force_pwm_open=1
framebuffer_depth=16
framebuffer_ignore_alpha=1
framebuffer_swap=1
gpu_freq=250
hdmi_force_cec_address=65535
init_uart_clock=0x2dc6c00
lcd_framerate=60
over_voltage_avs=31250
over_voltage_avs_boost=0x1e848
overscan_bottom=32
overscan_left=32
overscan_right=32
overscan_top=32
pause_burst_frames=1
program_serial_random=1
sdram_freq=500
temp_soft_limit=70
Time      Temp    CPU          Health         Vcore
23:04:41 35.4'C  600MHz 00000000000000000000 1.2V
23:04:46 34.9'C  600MHz 00000000000000000000 1.2V
23:04:51 35.4'C  600MHz 00000000000000000000 1.2V
23:04:56 35.4'C  600MHz 00000000000000000000 1.2V
23:05:01 35.4'C 1400MHz 00000000000000000000 1.3250V
23:05:06 35.4'C 1400MHz 00000000000000000000 1.3250V
23:05:11 35.4'C 1400MHz 00000000000000000000 1.3250V
23:05:16 36.5'C 1400MHz 00000000000000000000 1.3250V
23:05:21 36.5'C 1400MHz 00000000000000000000 1.3250V
23:05:26 36.5'C 1400MHz 00000000000000000000 1.3250V
23:05:31 36.5'C 1400MHz 00000000000000000000 1.3250V
23:05:36 36.5'C  600MHz 00000000000000000000 1.2V
23:05:41 37.0'C 1400MHz 00000000000000000000 1.3250V
23:05:47 40.8'C 1400MHz 00000000000000000000 1.3250V
23:05:52 41.9'C 1400MHz 00000000000000000000 1.3250V
Time      Temp    CPU          Health         Vcore
23:05:57 42.4'C 1400MHz 00000000000000000000 1.3250V
23:06:02 43.5'C 1400MHz 00000000000000000000 1.3250V
23:06:07 44.0'C 1400MHz 00000000000000000000 1.3250V
23:06:13 45.1'C 1400MHz 00000000000000000000 1.3250V
23:06:18 45.6'C 1400MHz 00000000000000000000 1.3250V
23:06:23 46.2'C 1400MHz 00000000000000000000 1.3250V
23:06:28 47.2'C 1400MHz 00000000000000000000 1.3250V
23:06:33 47.8'C 1400MHz 00000000000000000000 1.3250V
23:06:39 48.3'C 1400MHz 00000000000000000000 1.3250V
23:06:44 48.9'C 1400MHz 00000000000000000000 1.3250V
23:06:49 49.4'C 1400MHz 00000000000000000000 1.3250V
23:06:54 49.9'C 1400MHz 00000000000000000000 1.3250V
23:06:59 50.5'C 1400MHz 00000000000000000000 1.3250V
23:07:04 51.5'C 1400MHz 00000000000000000000 1.3250V
23:07:10 51.5'C 1400MHz 00000000000000000000 1.3250V
Time      Temp    CPU          Health         Vcore
23:07:15 52.6'C 1400MHz 00000000000000000000 1.3250V
23:07:20 53.2'C 1400MHz 00000000000000000000 1.3250V
23:07:25 49.9'C  600MHz 00000000000000000000 1.2V
23:07:30 49.4'C  600MHz 00000000000000000000 1.2V
23:07:35 48.9'C  600MHz 00000000000000000000 1.2V
23:07:40 48.3'C  600MHz 00000000000000000000 1.2V
23:07:45 47.2'C  600MHz 00000000000000000000 1.2V
23:07:51 47.2'C  600MHz 00000000000000000000 1.2V
The 3B+ has a different throttling mechanism. It has a soft limit, by default at 60C, where it drops the CPU speed by 200MHz.
You can raise that, and mine is set at 70C. Its quite effective at limiting the temperature.

Moonmarch
Posts: 98
Joined: Thu Mar 07, 2019 1:34 am

Re: raspberry pi 3B underclock

Sun Jun 16, 2019 10:26 pm

Add temp_limit=85 to the bottom of the config.txt file, the default value is 85, change to a different number then reboot to see if the CPU temp stays below the temperature limit, lowering the maximum temperature can lower the CPU speed regardless of the arm_freq value, because higher clock speeds equals higher temperatures, and the computer will require more electricity.

There are a number of settings you can include in the config.txt file located in the /boot directory, here is the overclocking guide from the RPI website:

https://www.raspberrypi.org/documentati ... locking.md

If you use the over_voltage command line, you can set the over_voltage value ranging from -16 to 8, here is how you add this command line to config.txt:

Code: Select all

over_voltage=2
After editing the config.txt file, save the file then reboot the computer, you can edit the config.txt file during the boot cycle, press the shift key when you see the RPI logo.

tudor
Posts: 11
Joined: Wed Apr 09, 2014 12:07 pm

Re: raspberry pi 3B underclock

Mon Jun 17, 2019 7:00 am

The pi is in a box.
Time to let it out!
This is not helpful. This case is very nice, it's a finished product:
https://thepihut.com/products/raspberry ... 5155531396
It protects the pi and i haven't seen an aluminium option yet.
This topic is about underclocking, not overclocking.
Add temp_limit=85
This topic is about underclocking, using a pi with batteries and using it longer between charges.
For overclocking I know very well how to do it with 3b+ with flirc aluminium case.

The question is why the pi will overheat at maximum possible frequency and go beyond the asked frequency.
The setting was put at 900mhz, why would it go to 1100mhz?

User avatar
bensimmo
Posts: 4129
Joined: Sun Dec 28, 2014 3:02 pm
Location: East Yorkshire

Re: raspberry pi 3B underclock

Mon Jun 17, 2019 7:41 am

tudor wrote:
Sun Jun 16, 2019 8:11 pm
The heat sink is very similar with kintaro, but allows hats (is not as tall). I didn't find a reasonable price for kintaro in europe yet.
(shipping more expensive than heat-sink)

Code: Select all

[email protected]:~/personal/scripts/raspi $ ./info.sh
aphy_params_current=819
arm_freq=900
audio_pwm_mode=514
config_hdmi_boost=5
core_freq=250
desired_osc_freq=0x36ee80
disable_auto_turbo=1
disable_commandline_tags=2
disable_l2cache=1
display_default_lcd=1
display_hdmi_rotate=-1
display_lcd_rotate=-1
dphy_params_current=547
force_eeprom_read=1
force_pwm_open=1
framebuffer_ignore_alpha=1
framebuffer_swap=1
gpu_freq=250
hdmi_force_cec_address=65535
init_uart_clock=0x2dc6c00
lcd_framerate=60
over_voltage_avs=0x186a0
pause_burst_frames=1
program_serial_random=1
sdram_freq=450
Time      Temp    CPU          Health         Vcore
22:02:31 79.5'C  900MHz 00100000000000000000 1.3V
22:02:36 79.5'C  900MHz 00100000000000000000 1.3V
22:02:41 79.5'C  900MHz 00100000000000000000 1.3V
22:02:47 79.5'C  900MHz 00100000000000000000 1.3V
22:02:52 78.4'C  900MHz 00100000000000000000 1.3V
22:02:57 79.0'C  900MHz 00100000000000000000 1.3V
22:03:02 79.5'C  900MHz 00100000000000000000 1.3V
22:03:08 79.5'C  900MHz 00100000000000000000 1.3V
22:03:13 79.0'C  900MHz 00100000000000000000 1.3V
22:03:18 79.0'C  900MHz 00100000000000000000 1.3V
22:03:23 79.5'C  900MHz 00100000000000000000 1.3V
22:03:29 79.5'C  900MHz 00100000000000000000 1.3V
22:03:34 79.5'C 1195MHz 00100000000000000010 1.3V
22:03:39 80.6'C 1141MHz 00100000000000000010 1.3V
22:03:44 81.7'C 1141MHz 00100000000000000010 1.3V
Time      Temp    CPU          Health         Vcore
22:03:49 81.1'C 1141MHz 00100000000000000010 1.3V
22:03:54 81.1'C 1087MHz 00100000000000000010 1.3V

For power consumption, arm_freq=800 or something should also reduce the core voltage.
This is exactly what i'm trying to do and doesn't work!
I think this needs the engineer team to look at it.
This is the point it goes wrong, as you know
That second bit from the end goes to 1 and starts to override the settings, as though it's now *allowed* max frequency, hit 80.0C and throttles back.

Code: Select all

22:03:29 79.5'C  900MHz 00100000000000000000 1.3V
22:03:34 79.5'C 1195MHz 00100000000000000010 1.3V

Moonmarch
Posts: 98
Joined: Thu Mar 07, 2019 1:34 am

Re: raspberry pi 3B underclock

Mon Jun 17, 2019 5:26 pm

I said change the temperature limit to a lower number if you need lower CPU temperature, the default is 85 and you can't increase the temperature limit over 85, disabling auto turbo is only relevant to the GPU according to the guide, how about changing the CPU governor, the default CPU governor is on demand.

For the RPI 3 the minimum CPU frequency should be 600, if you set the arm_freq value to 900, the RPI should only boost to 900, if the max CPU temperature is causing the CPU to throttle over 900 MHz, then the temperature is the problem, you can even consider lowering the CPU speed to lower the CPU temperature if necessary, or design a new heatsink.

tudor
Posts: 11
Joined: Wed Apr 09, 2014 12:07 pm

Re: raspberry pi 3B underclock

Mon Jun 17, 2019 10:06 pm

bensimmo wrote:
Mon Jun 17, 2019 7:41 am

I think this needs the engineer team to look at it.
This is the point it goes wrong, as you know
That second bit from the end goes to 1 and starts to override the settings, as though it's now *allowed* max frequency, hit 80.0C and throttles back.

Code: Select all

22:03:29 79.5'C  900MHz 00100000000000000000 1.3V
22:03:34 79.5'C 1195MHz 00100000000000000010 1.3V
Thank you!
Could you show this to en engineer?
It's as if inside of throttling condition arm_freq is not taken into account anymore, being supposed superior.
Moonmarch wrote: then the temperature is the problem, you can even consider lowering the CPU speed to lower the CPU temperature if necessary, or design a new heatsink.
You are still asking me to overclock. You ask me to keep the pi at 900mhz 5C more than it should.
At 80C it should have reduced by itself to 600mhz because of the overheat.
What does it do instead? It goes to 1100mhz!
I haven't tried it yet, but I'm sure I can trigger for you this case at 600mhz also! At 500 it got to 76C with cpuburn.
I don't know why you keep insisting about the heat-sink. When the amount of energy is fixed from the battery, the fact that you are able to burn twice the current without overheat is not the point.

User avatar
Imperf3kt
Posts: 2559
Joined: Tue Jun 20, 2017 12:16 am
Location: Australia

Re: raspberry pi 3B underclock

Tue Jun 18, 2019 1:21 am

In still confused as to how you are hitting the Max temp limit at all.

I've only ever hit it once myself, and I was purposefully pushing my Pi far beyond its limits underneath a blanket in order to do so.
55:55:44:44:4C
52:4C:52:42:41

User avatar
bensimmo
Posts: 4129
Joined: Sun Dec 28, 2014 3:02 pm
Location: East Yorkshire

Re: raspberry pi 3B underclock

Tue Jun 18, 2019 8:21 am

tudor wrote:
Mon Jun 17, 2019 10:06 pm
bensimmo wrote:
Mon Jun 17, 2019 7:41 am

I think this needs the engineer team to look at it.
This is the point it goes wrong, as you know
That second bit from the end goes to 1 and starts to override the settings, as though it's now *allowed* max frequency, hit 80.0C and throttles back.

Code: Select all

22:03:29 79.5'C  900MHz 00100000000000000000 1.3V
22:03:34 79.5'C 1195MHz 00100000000000000010 1.3V
Thank you!
Could you show this to en engineer?
It's as if inside of throttling condition arm_freq is not taken into account anymore, being supposed superior.

I can't, they may read this at some point. You may want to add 'bug' to the Topic title to show it's a bug, rather than just asking advice on underclocks.

It may well be a setting you are using that is not doing what you think. I don't know though.

jamesh
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 23083
Joined: Sat Jul 30, 2011 7:41 pm

Re: raspberry pi 3B underclock

Tue Jun 18, 2019 10:07 am

If you are sure there is a bug in here (to me it looks like a HW fault), then please create an issue on our firmware github repo here

https://github.com/raspberrypi/firmware

Eventually we will probably get round to looking at it, but we are VERY busy.
Principal Software Engineer at Raspberry Pi (Trading) Ltd.
Contrary to popular belief, humorous signatures are allowed. Here's an example...
"My grief counseller just died, luckily, he was so good, I didn't care."

Return to “General discussion”