Folding on Android with UserLAnd and the new Linux ARM build

Moderators: Site Moderators, FAHC Science Team

demorgan
Posts: 18
Joined: Wed Dec 16, 2020 10:29 pm

Folding on Android with UserLAnd and the new Linux ARM build

Post by demorgan »

I was curious to see if I could get folding going on as I have a lot of Android phones and tablets sitting around my house. The answer is yes, if you install UserLAnd on your phone and install the FAHClient package for ARM, it works (UserLAnd runs a choice of stripped down Linux distros inside an Android app, and allows you to connect via VNC or SSH)

The way I did it was to install xfce and installed Chromium from a terminal to browse to the download site here and get the ARM client, but this is not the best way. You could probably just start with SSH instead of VNC and copy and type "wget url_of_arm_linux_fahclient.deb" to download it, type: sudo dpkg -i "name_of_arm_linux_fahclient.deb" to install it, and then it's started, I believe. However, you can't see the progress on the terminal unless you end the UserLAnd program, restart debian in SSH, and type "FAHClient", then you should get the terminal output. There are also ways to re-direct the output of a running process to your ssh terminal, which would probably work too and be a cleaner way of doing it instead of killing UserLAnd from Android and restarting, but that is beyond this post (not because it wouldn't be useful information, but because I haven't ever done it.)

Note: I only discovered that I had this working when I saw that the username of the client "demorganphone" had completed a WU. It did not look like it was running, and no service was found, and starting FAHClient didn't seem to work. But when I restarted UserLAnd and typed "FAHClient" I could see it.

If you start via VNC, you can use the web client in a browser. I didn't have much luck with Firefox, so try Chromium.

I was actually reluctant to post this because I don't think it was intended for the ARM Linux program to be used this way, although I'd be happy to be wrong about this. This is not something you can just carry around with you running in the background on your phone, your phone will lose charge quickly, so have your phone charging with a good charger that provides a lot of current. I tried doing this with my Galaxy S9 plugged into my laptop, the phone started at 4% and actually went out of power and died even though it was charging! Plugging it into the wall worked though. Keep in mind this is basically a stress test on your phone, so don't blame me if your processor melts down or your RAM goes bad or something. With a lot of people working from home and being quarantined, their phones can stay plugged in for a while, so this might give a boost to to activity. I do not think it would be a good idea to do this unless you have many hours on hand to complete a WU, it could clog things up I imagine, so I would just wait until you have time if you don't.

Phones do have non-ARM processors occasionally. ARM is used in about 95% of phones last I read. This will definitely not work on an Android phone or tablet based on another architecture like x86. ARM only!

I should note that I have only tested this on a Samsung Galaxy S9. If anyone has another story, please tell!

I realize this may have not been the best overview, but it's a start. I'd be interested to read others' input on this...
bruce
Posts: 20824
Joined: Thu Nov 29, 2007 10:13 pm
Location: So. Cal.

Re: Folding on Android with UserLAnd and the new Linux ARM b

Post by bruce »

My guess is that this is a stress-test on the battery. Any processor running FAH is a good source of heat and batteries don't like heat.

Thanks for the report. I'm sure others will evaluate it on their hardware.
demorgan
Posts: 18
Joined: Wed Dec 16, 2020 10:29 pm

Re: Folding on Android with UserLAnd and the new Linux ARM b

Post by demorgan »

The issue with the battery I definitely acknowledge...I especially don't recommend letting it run without charging; it would generate a lot of heat around the battery unless there's like zero resistance between the battery and the rest of the phone.

After folding for a few days, I can say that it works, but it is highly recommended by me to run it in "Medium" and not "Full". It folds less, but I had my phone get so hot that Android terminated UserLAnd when it sensed how hot the phone had become. However, when doing it on "medium" I have had 0 issues.
Darth_Peter_dualxeon
Posts: 46
Joined: Fri Mar 20, 2020 3:13 am
Hardware configuration: EVGA SR-2 motherboard
2x Xeon x5670 CPU
64 GB ECC DDR3
Nvidia RTX 2070

Re: Folding on Android with UserLAnd and the new Linux ARM b

Post by Darth_Peter_dualxeon »

Just curious, how much PPD did you get? And how hot was the phone?
If I'm understanding correctly it does not use the GPU of the phones yet?
demorgan wrote: This is not something you can just carry around with you running in the background on your phone, your phone will lose charge quickly, so have your phone charging with a good charger that provides a lot of current. I tried doing this with my Galaxy S9 plugged into my laptop, the phone started at 4% and actually went out of power and died even though it was charging! Plugging it into the wall worked though.
I guess USB2.0 connectors only supply 500 mA, and 3.0 connectors can supply something like 2A. Wall chargers maybe more.
The charging circuit or software in phone can also misunderstand the situation sometimes and don't charge as fast, and then a different cable or a restart may help.
demorgan
Posts: 18
Joined: Wed Dec 16, 2020 10:29 pm

Re: Folding on Android with UserLAnd and the new Linux ARM b

Post by demorgan »

My PPD on my S9 right now is 1153, on medium setting using 7 cores of the Snapdragon out of 8. I have, I think, 8 devices going total, all but two using various Debian-based Linux distros, mostly computers and laptops between 2010 and 2018 except for a Raspberry Pi 4 (just got that working) and the Galaxy S9. The S9 is the third fastest. There are, however, no GPUs that are supported on any of the devices yet (just bought a few GPUs off ebay though), so...

The phone, when going on full, is quite hot. It's so hot you wouldn't want to hold it, even. However, when on medium it's just a little hot. The GPU is not supported, and I'm not sure it would be possible to interface with the hardware directly like would be needed if UserLAnd is being used.

What you said about USB is true, here's an article about USB power differences; it's a quite complex issue when it comes to determining how much power you get to your phone (the ads may annoy, but the information is useful):

https://www.extremetech.com/computing/1 ... blowing-up
bruce
Posts: 20824
Joined: Thu Nov 29, 2007 10:13 pm
Location: So. Cal.

Re: Folding on Android with UserLAnd and the new Linux ARM b

Post by bruce »

My S9 is still my primary phone, so I'm not interested in it getting too hot. I do have some older equipment around. Before I start experimenting, what is the oldest hardware and/or Android that would be supported by UserLAnd+Linux?
demorgan
Posts: 18
Joined: Wed Dec 16, 2020 10:29 pm

Re: Folding on Android with UserLAnd and the new Linux ARM b

Post by demorgan »

I contacted the email given for UserLAnd support asking for what would be the minimum hardware requirements, but they have not gotten back to me yet. The minimum version of Android stated on the Google Play store is 5.0.
PantherX
Site Moderator
Posts: 6986
Joined: Wed Dec 23, 2009 9:33 am
Hardware configuration: V7.6.21 -> Multi-purpose 24/7
Windows 10 64-bit
CPU:2/3/4/6 -> Intel i7-6700K
GPU:1 -> Nvidia GTX 1080 Ti
§
Retired:
2x Nvidia GTX 1070
Nvidia GTX 675M
Nvidia GTX 660 Ti
Nvidia GTX 650 SC
Nvidia GTX 260 896 MB SOC
Nvidia 9600GT 1 GB OC
Nvidia 9500M GS
Nvidia 8800GTS 320 MB

Intel Core i7-860
Intel Core i7-3840QM
Intel i3-3240
Intel Core 2 Duo E8200
Intel Core 2 Duo E6550
Intel Core 2 Duo T8300
Intel Pentium E5500
Intel Pentium E5400
Location: Land Of The Long White Cloud
Contact:

Re: Folding on Android with UserLAnd and the new Linux ARM b

Post by PantherX »

FYI, you may find that on ARM architectures that use BIG.little CPUs, setting the value of threads that is equal to BIG CPUs might provide a boost in PPD. That would work well since you can get higher PPD without generating too much heat.

Reason for that is if you're using all CPUs in BIG.little, then the BIG CPUs would wait for the little CPUs to finish before things are synced up. Hence, the boost in PPD even though you're using fewer CPUs.
ETA:
Now ↞ Very Soon ↔ Soon ↔ Soon-ish ↔ Not Soon ↠ End Of Time

Welcome To The F@H Support Forum Ӂ Troubleshooting Bad WUs Ӂ Troubleshooting Server Connectivity Issues
bruce
Posts: 20824
Joined: Thu Nov 29, 2007 10:13 pm
Location: So. Cal.

Re: Folding on Android with UserLAnd and the new Linux ARM b

Post by bruce »

In a perfect world, it would be nice to be able to run one WU on the BIG CPUs and a separate one on the LITTLE cores. That's a complex challenge for somebody who understands how to set affinity (Falsely assuming that heat would not be a problem.)
demorgan
Posts: 18
Joined: Wed Dec 16, 2020 10:29 pm

Re: Folding on Android with UserLAnd and the new Linux ARM b

Post by demorgan »

For Linux, I think a script could almost be made using a program called "taskset" if one knew how the cores were numbered (which is the next thing I'm looking at):

https://www.looklinux.com/how-to-run-pr ... -in-linux/

However, it would require running more than one instance of fahclient.

Edit: No, wait, that wouldn't work since fahclient itself sets cores?
bruce
Posts: 20824
Joined: Thu Nov 29, 2007 10:13 pm
Location: So. Cal.

Re: Folding on Android with UserLAnd and the new Linux ARM b

Post by bruce »

demorgan wrote:No, wait, that wouldn't work since fahclient itself sets cores?
Possibly ... or maybe it's the Wrapper.

In WIndows you have a choice of "idle" and "low"
gunnarre
Posts: 559
Joined: Sun May 24, 2020 7:23 pm
Location: Norway

Re: Folding on Android with UserLAnd and the new Linux ARM b

Post by gunnarre »

You just need to run two CPU slots in one client. If you can find a mask for big and little cores, put it into this script:

Code: Select all

#!/bin/bash
CPUPROCESSES=$(pgrep FahCore_a)
BIGMASK="f"
LITTLEMASK="f"

i=1
for pid in $CPUPROCESSES; do
    if (($i % 2)); then
        taskset -a -p $BIGMASK $pid >/dev/null
    else
        taskset -a -p $LITTLEMASK $pid >/dev/null
    fi
    ((i=i+1))
done
And run it via the cron command

Code: Select all

bash /usr/local/sbin/FahCore-taskset.sh >/dev/null
Edit: Note that this script only sets every other CPU slot to a different mask; it gives you no control over which one of the slots is given each mask - it just assigns the BIGMASK mask to folding CPU core with the lowest process ID. If you need to set a particular slot to a particular mask, then I wonder if "extra-core-options" in FAH can be used somehow?
Last edited by gunnarre on Fri Mar 25, 2022 3:30 pm, edited 1 time in total.
Image
Online: GTX 1660 Super + occasional CPU folding in the cold.
Offline: Radeon HD 7770, GTX 1050 Ti 4G OC, RX580
manalog
Posts: 9
Joined: Thu Sep 17, 2015 3:08 pm

Re: Folding on Android with UserLAnd and the new Linux ARM b

Post by manalog »

I am doing the same on my Motorola G5S+ (Qualcomm MSM8953), Lineage OS, Userland and remote control enabled in order to control FAHClient running on the smartphone from my computer.
It seems to run very smoothly, PPD is around 5000 and I think it is a very good number for a mobile device. The smartphone now it's pretty hot but not extremely hot; I think that a fan would be enough to keep temperatures low. CPU temp without fan is 70°, battery 37,5°; my house is old at the moment (17°-18°). All cores are used at around 80%, don't know why they aren't used 100% but I think it is an Android limitation (remember the same with Boinc).

Yesterday I installed FAHClient also on my SBC Orange Pi 4, based on Rockchip RK3399 and it seems it is doing the same PPD as the smartphone.
Neil-B
Posts: 1996
Joined: Sun Mar 22, 2020 5:52 pm
Hardware configuration: 1: 2x Xeon [email protected], 512GB DDR4 LRDIMM, SSD Raid, Win10 Ent 20H2, Quadro K420 1GB, FAH 7.6.21
2: Xeon [email protected], 32GB DDR4, NVME, Win10 Pro 20H2, Quadro M1000M 2GB, FAH 7.6.21 (actually have two of these)
3: [email protected], 12GB DDR3, SSD, Win10 Pro 20H2, GTX 750Ti 2GB, GTX 1080Ti 11GB, FAH 7.6.21
Location: UK

Re: Folding on Android with UserLAnd and the new Linux ARM b

Post by Neil-B »

manalog wrote:I am doing the same on my Motorola G5S+ (Qualcomm MSM8953), Lineage OS, Userland and remote control enabled in order to control FAHClient running on the smartphone from my computer.
It seems to run very smoothly, PPD is around 5000 and I think it is a very good number for a mobile device. The smartphone now it's pretty hot but not extremely hot; I think that a fan would be enough to keep temperatures low. CPU temp without fan is 70°, battery 37,5°; my house is old at the moment (17°-18°). All cores are used at around 80%, don't know why they aren't used 100% but I think it is an Android limitation (remember the same with Boinc).

Yesterday I installed FAHClient also on my SBC Orange Pi 4, based on Rockchip RK3399 and it seems it is doing the same PPD as the smartphone.
Are any of these able to complete the wus within the timeout or expriry deadlines ... the client may estimate 5000ppd but if the wu isnt completed before the expiry date it will be dumped and 0 points awarded - it will also be worse than useless for the science as it will put a delay loop into the completion of that wu by something that can complete it within the deadline.
2x Xeon E5-2697v3, 512GB DDR4 LRDIMM, SSD Raid, W10-Ent, Quadro K420
Xeon E3-1505Mv5, 32GB DDR4, NVME, W10-Pro, Quadro M1000M
i7-960, 12GB DDR3, SSD, W10-Pro, GTX1080Ti
i9-10850K, 64GB DDR4, NVME, W11-Pro, RTX3070

(Green/Bold = Active)
manalog
Posts: 9
Joined: Thu Sep 17, 2015 3:08 pm

Re: Folding on Android with UserLAnd and the new Linux ARM b

Post by manalog »

Yes, started folding yesterday and both the device were able to stay inside the "timeout" mark. The Motorola already finished a WU.

I don't know if soon or later they will get wu that stay inside "expire" but not "timeout". This, curiously, happened to me not on arm devices rather on a powerful Ryzen 5 laptop. In this case it is better to continue crunching the WU or abort it?

By the way starting from yesterday I've seen 3WUs in my "ARM Cluster", 1 completed, 2 in progress, 100% completed or predicted to be completed widely under the "Timeout" deadline.
Post Reply