compiling (large) programs on pbp
Hi there,

To my understanding, pine book pro is using battery when it needs to even if I plug in the laptop to AC. I wouldn't mind about this behavior; it is happening even if I just do web browsing; I see the battery suddenly dropping to 91% but charging while I am on AC.

However, the issue is when I try to compile heavy programs. With sagemath, it seems impossible to finish the compilation without draining the battery. I have also tried to compile a linux kernel using pbp-tools, which narrowly finished before the battery dropped below 15%. I was flipping coins and making bets whether the kernel will compile first or the battery will drain first.

My question is: Is there any way that I can compile these kind of software without concerns on draining the battery? Also, is there anything I can do to prevent pbp using battery even when I browse?
A few small tricks:
- ccache
- low brightness sub-20% (if it's compiling on all threads available, you can even turn off the monitor and check periodically) - the screen is big sucker of juice

- Use slight undeclock so that the charging circuit won't trip (for whatever reason, if you push it hard for long enough the charging LED starts flashing and the PBP won't charge until rebooted)

Device: Pinebook Pro 128GB No:246 / MainOS: Manjaro ARM
Godot and Flutter - creating something can be fun with the right tools!
You can disconnect the battery, but this means taking the bottom cover off when you want to disconnect or reconnect the battery. In any case if you do this, follow the directions. There are very specific directions to follow.

The charging circuit in the PBP is inadequate. If I ever get to the point where I'm running out of battery, I'll probably figure out an alternative solution. Hopefully someone else does first.
Part of the problem is that Pine64 have allowed somewhat aggressive over-clocking of the CPUs. This means that under higher load, the CPU will draw more power than is expected. The only place to get the extra power is the battery. This is perfectly fine for a burst of shorter term activity. For example compiling a small program, or re-calculating a spreadsheet. For other longer running tasks that will drain the battery completely, this over-clocking is bad.

What I think we need, is a software package that:
  • Detects external power is plugged in
  • CPU is busy and has been busy for a while, (like 2nd entry in uptime)
  • Battery is draining, (meaning it's noticeably dropping charge like 10%)
When those conditions are met, throttle the CPUs some. If conditions still exist later, throttle more until the battery is no longer draining.

This will cause the long running task(s), (like the kernel compile), to take longer, but, it will finish. Instead of crashing. The alternative is simply to run those long compiles on another computer.

I have an interest in this as I prefer Gentoo Linux, which compiles most / all the packages from source. This has the advantage of allowing specific options for each package, (for example allowing SCTP for OpenSSH). But, their is zero chance I can perform an update as is, as several hours compiling would likely drain the battery and cause the PBP to crash. So, so for the moment I am using Manjaro and the default Debian.
Arwen Evenstar
Princess of Rivendale
throttle the max cpu frequency with cpupower. i do this with the pbp-config-cpupower script in pbp-tools.
(09-06-2020, 08:31 AM)pine76 Wrote: Is there any way that I can compile these kind of software without concerns on draining the battery?

If you have a non-PBP computer to offload compilation to, you can use distcc. I created some docker images for this and would appreciate some testers. I wrote up a short tutorial here:
I often leave mine to compile for a week (not exaggerating). So it is possible. I'm not running Linux, I'm running NetBSD; I have control over the CPU speeds. And, it seems like the current version of NetBSD isn't really taking full advantage of the CPU yet. But I expect that with throttling the same should be possible with Linux.
the linux build script in pbp-tools also supports crossbuild (CROSSBUILD=yes) to build on an amd64 computer -- i use my old i7 home server. there are other power saving scripts in pbp-tools, just poke around.

"sudo powertop --auto-tune" is also your friend.

Possibly Related Threads…
Thread Author Replies Views Last Post
  RAM deficiency after recent large Manjaro update? stozi 1 1,018 11-12-2021, 06:19 AM
Last Post: maxjrh
Smile Easy cross-compiling elijahr 4 4,113 09-25-2020, 12:27 PM
Last Post: Paulie420
  Frequent segfaults etc. while compiling mfritsche 13 10,743 07-15-2020, 04:12 PM
Last Post: mfritsche
  Compiling WireGuard (and other things requiring linux-headers) on Debian+Mate Dendrocalamus64 1 2,708 04-02-2020, 07:07 PM
Last Post: Dendrocalamus64

Forum Jump:

Users browsing this thread: 1 Guest(s)