mersenneforum.org  

Go Back   mersenneforum.org > Great Internet Mersenne Prime Search > Software > Mlucas

Reply
 
Thread Tools
Old 2021-12-12, 12:08   #1
leonardyan96
 
leonardyan96's Avatar
 
"Cassessory"
May 2017
Northern China

41 Posts
Question Pm1 stage 2 can't be done on my android phone

I'm now running pm1 on my retired phone with 4GB ram, using userland as instructed. Mlucas says I only have 400+MB ram available so it won't perform stage 2, but my phone's multitasking screen says it still has more than 2GB of free ram which should be enough. Is this possibly because of android's memory management?
leonardyan96 is offline   Reply With Quote
Old 2021-12-12, 12:12   #2
leonardyan96
 
leonardyan96's Avatar
 
"Cassessory"
May 2017
Northern China

41 Posts
Default

Also, mlucas reported the total amount of ram correctly (nearly 4GB), and said I only have 400+mb of FREE ram.
leonardyan96 is offline   Reply With Quote
Old 2021-12-12, 22:26   #3
ewmayer
2ω=0
 
ewmayer's Avatar
 
Sep 2002
República de California

32×1,303 Posts
Default

Android's memory-managment messes up Mlucas' stage 2 available-memory computation ... you can override it by forcing a specific (maximum) number of stage 2 buffers to be used, via the -pm1_s2_nbuf flag. (The stage 2 buffer-usage must be a multiple of 24 or 40, so the code picks whichever of those yields the largest count <= the one you specify.) If your multitasking screen shows 2GB, use that to figure out what value to supply to the aforementioned option - current-wavefront exponents needing a 6Mdoubles FFT need 48MB per buffer, so you should be able to use -pm1_s2_nbuf 40'. If that runs without any significant swapping occurring, you might be able to up it to 48, but there is very little efficiency gain for 48 vs 40, the next significant speedups to be had are at 72 and 80. Suggest you try one complete stage 2 run at 40, if that goes OK you could try getting more aggressive just to see what happens.
ewmayer is offline   Reply With Quote
Old 2021-12-21, 12:02   #4
leonardyan96
 
leonardyan96's Avatar
 
"Cassessory"
May 2017
Northern China

41 Posts
Default

Quote:
Originally Posted by ewmayer View Post
Android's memory-managment messes up Mlucas' stage 2 available-memory computation ... you can override it by forcing a specific (maximum) number of stage 2 buffers to be used, via the -pm1_s2_nbuf flag. (The stage 2 buffer-usage must be a multiple of 24 or 40, so the code picks whichever of those yields the largest count <= the one you specify.) If your multitasking screen shows 2GB, use that to figure out what value to supply to the aforementioned option - current-wavefront exponents needing a 6Mdoubles FFT need 48MB per buffer, so you should be able to use -pm1_s2_nbuf 40'. If that runs without any significant swapping occurring, you might be able to up it to 48, but there is very little efficiency gain for 48 vs 40, the next significant speedups to be had are at 72 and 80. Suggest you try one complete stage 2 run at 40, if that goes OK you could try getting more aggressive just to see what happens.
I used 40 and stage 2 is now running as desired. Aida64 says there's only 600+MB free RAM and I'm satisfied with this. Then I made a bash alias for this.
Code:
alias docompute="~/Mlucas -cpu 0:7 -pm1_s2_nbuf 40"
Many thanks for your instruction.

Last fiddled with by leonardyan96 on 2021-12-21 at 12:04
leonardyan96 is offline   Reply With Quote
Old 2021-12-22, 03:57   #5
ewmayer
2ω=0
 
ewmayer's Avatar
 
Sep 2002
República de California

267178 Posts
Default

Quote:
Originally Posted by leonardyan96 View Post
I used 40 and stage 2 is now running as desired. Aida64 says there's only 600+MB free RAM and I'm satisfied with this. Then I made a bash alias for this.
Code:
alias docompute="~/Mlucas -cpu 0:7 -pm1_s2_nbuf 40"
Many thanks for your instruction.
Glad to hear it - what model phone is this, and how do your stage 2 per-iteration timings compare to the stage 1 ones?
ewmayer is offline   Reply With Quote
Old 2021-12-23, 15:06   #6
leonardyan96
 
leonardyan96's Avatar
 
"Cassessory"
May 2017
Northern China

4110 Posts
Default

It's a LAVA (an Indian brand) LE9820 featuring a MediaTek Helio P22 (MT6762V). I bought this second-hand phone for 450CNY (~70USD), then used it for half a year. Its build quality is so terrible that I can easily rip off its back cover.
Stage 1 is nearly 200 ms/iter while stage 2 is about 230, with all 8 cores involved.
I'm going to add an Essential Phone PH1 with Snapdragon 835.
leonardyan96 is offline   Reply With Quote
Old 2021-12-24, 06:47   #7
leonardyan96
 
leonardyan96's Avatar
 
"Cassessory"
May 2017
Northern China

518 Posts
Default

Quote:
Originally Posted by ewmayer View Post
Glad to hear it - what model phone is this, and how do your stage 2 per-iteration timings compare to the stage 1 ones?
I learned you have used Galaxy S7s for Mlucas. These phones use Snapdragon 820 for North America version, so are they burning hot? I have used a 821. It gets extremely hot when I use some resource-demanding apps. 835 and later would be much better.
leonardyan96 is offline   Reply With Quote
Old 2021-12-24, 20:23   #8
ewmayer
2ω=0
 
ewmayer's Avatar
 
Sep 2002
República de California

101101110011112 Posts
Default

Quote:
Originally Posted by leonardyan96 View Post
I learned you have used Galaxy S7s for Mlucas. These phones use Snapdragon 820 for North America version, so are they burning hot? I have used a 821. It gets extremely hot when I use some resource-demanding apps. 835 and later would be much better.
The S7s have a highly sophisticated internal cooling system, but still get hot running an FPU-heavy 24/7 application like Mlucas. I needed external cooling to keep the from auto-throttling, as in the pic on the Android-phone readme page with several phones in a USB charging stand and a USB fan blowing air over them. Was going to ask you what if anything you do by way of external cooling.

All my S7s save one are now retired (trying to flog them off on eBay for-parts) due to battery-swelling, which occurs under heavy loads like this - you'll want to keep an eye on that. The sole survivor only gets turned on occasionally to test new-code builds.

Last fiddled with by ewmayer on 2021-12-24 at 20:26
ewmayer is offline   Reply With Quote
Old 2021-12-25, 01:54   #9
leonardyan96
 
leonardyan96's Avatar
 
"Cassessory"
May 2017
Northern China

1010012 Posts
Default

Quote:
Originally Posted by ewmayer View Post
Glad to hear it - what model phone is this, and how do your stage 2 per-iteration timings compare to the stage 1 ones?
It's a LAVA (an Indian brand) LE9820 featuring a MediaTek Helio P22 (MT6762V). I bought this second-hand phone for 450CNY (~70USD), then used it for half a year. Its build quality is so terrible that I can easily rip off its back cover.
Stage 1 is nearly 200 ms/iter while stage 2 is about 230, with all 8 cores involved.
I'm going to add an Essential Phone PH1 with Snapdragon 835.

(I'm posting again in case you didn't see that. Last time I didn't quote you since I'm not familiar with vBulletin.)
leonardyan96 is offline   Reply With Quote
Old 2021-12-25, 02:05   #10
leonardyan96
 
leonardyan96's Avatar
 
"Cassessory"
May 2017
Northern China

41 Posts
Default

Quote:
Originally Posted by ewmayer View Post
The S7s have a highly sophisticated internal cooling system, but still get hot running an FPU-heavy 24/7 application like Mlucas. I needed external cooling to keep the from auto-throttling, as in the pic on the Android-phone readme page with several phones in a USB charging stand and a USB fan blowing air over them. Was going to ask you what if anything you do by way of external cooling.

All my S7s save one are now retired (trying to flog them off on eBay for-parts) due to battery-swelling, which occurs under heavy loads like this - you'll want to keep an eye on that. The sole survivor only gets turned on occasionally to test new-code builds.
The SoC of mine doesn't seem to produce a lot of heat. There isn't any visible thermal throttling since all cores keep running in their highest freq when running Mlucas, and the back of my phone feels only a bit warm. Thus I don't use any external cooling.

Also I'm now trying -pm1_s2_nbuf 48 since the stage 2 timing looks good.
leonardyan96 is offline   Reply With Quote
Old 2021-12-25, 20:46   #11
ewmayer
2ω=0
 
ewmayer's Avatar
 
Sep 2002
República de California

32·1,303 Posts
Default

Quote:
Originally Posted by leonardyan96 View Post
The SoC of mine doesn't seem to produce a lot of heat. There isn't any visible thermal throttling since all cores keep running in their highest freq when running Mlucas, and the back of my phone feels only a bit warm. Thus I don't use any external cooling.

Also I'm now trying -pm1_s2_nbuf 48 since the stage 2 timing looks good.
Yes, I saw your first note re. your Indian phone's chipset - do you run it with the back cover off, or on? On the S7 the back cover is part of the cooling system, one of my S7s had a broken one, I stuck little Aluminum finned mini-heat-sinks on the chips to help with cooling.

Per the Interwebs, your phone's Helio P22 is 8x 2 GHz Cortex-A53 in a 12nm process, 5W TDP.

The S7's Snapdragon 820 is 4-core Armv8a, custom 14nm Kryo core rather than a Cortex, big.LITTLE with the 2 performance cores @1.6GHz and 2 efficiency cores @2.2GHz. TDP is 11W, so makes sense throttling would be more of an issue. Just ran a couple quick-tests @6M FFT on my remaining working (= battery still takes a charge) S7, a case-intact S7 Active with a siliconized sleeve over sides and back cover: './Mlucas -fft 6M -radset 192,16,32,32 -cpu 0:3 -iters 100|1000', with the phone resting on a closed-window sill, cool location but no airflow to speak of - you can see throttling beginning after less than a minute of 4-core runtime:

100-iter: 137ms
1000-iter: 156ms

I have lm-sensors installed on this device, 'sensors' dump a ton of output, but there are only 2 entries with a (crit = +145.0 C) field (the 145C seems high, but never got close to it), so I used 'sensors|grep crit' to monitor temps with the above 2 runs in background mode. 100-iters didn't even hit 50C, at 1000 things topped out at 56C. Not sure if that's an accurate reflection of the actual CPU hotspot temps, but OK as a relative measure.

Last fiddled with by ewmayer on 2021-12-25 at 20:49
ewmayer is offline   Reply With Quote
Reply

Thread Tools


Similar Threads
Thread Thread Starter Forum Replies Last Post
Want to buy an Android tablet, but also have the Android version be consistently updated. jasong jasong 21 2019-07-14 11:58
IRS Phone Scam wblipp Lounge 0 2014-09-09 18:42
Stage 1 with mprime/prime95, stage 2 with GMP-ECM D. B. Staple Factoring 2 2007-12-14 00:21
Need help to run stage 1 and stage 2 separately jasong GMP-ECM 9 2007-10-25 22:32
Stage 1 and stage 2 tests missing Matthias C. Noc PrimeNet 5 2004-08-25 15:42

All times are UTC. The time now is 01:48.


Wed May 25 01:48:33 UTC 2022 up 40 days, 23:49, 0 users, load averages: 2.32, 2.05, 1.87

Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2022, Jelsoft Enterprises Ltd.

This forum has received and complied with 0 (zero) government requests for information.

Permission is granted to copy, distribute and/or modify this document under the terms of the GNU Free Documentation License, Version 1.2 or any later version published by the Free Software Foundation.
A copy of the license is included in the FAQ.

≠ ± ∓ ÷ × · − √ ‰ ⊗ ⊕ ⊖ ⊘ ⊙ ≤ ≥ ≦ ≧ ≨ ≩ ≺ ≻ ≼ ≽ ⊏ ⊐ ⊑ ⊒ ² ³ °
∠ ∟ ° ≅ ~ ‖ ⟂ ⫛
≡ ≜ ≈ ∝ ∞ ≪ ≫ ⌊⌋ ⌈⌉ ∘ ∏ ∐ ∑ ∧ ∨ ∩ ∪ ⨀ ⊕ ⊗ 𝖕 𝖖 𝖗 ⊲ ⊳
∅ ∖ ∁ ↦ ↣ ∩ ∪ ⊆ ⊂ ⊄ ⊊ ⊇ ⊃ ⊅ ⊋ ⊖ ∈ ∉ ∋ ∌ ℕ ℤ ℚ ℝ ℂ ℵ ℶ ℷ ℸ 𝓟
¬ ∨ ∧ ⊕ → ← ⇒ ⇐ ⇔ ∀ ∃ ∄ ∴ ∵ ⊤ ⊥ ⊢ ⊨ ⫤ ⊣ … ⋯ ⋮ ⋰ ⋱
∫ ∬ ∭ ∮ ∯ ∰ ∇ ∆ δ ∂ ℱ ℒ ℓ
𝛢𝛼 𝛣𝛽 𝛤𝛾 𝛥𝛿 𝛦𝜀𝜖 𝛧𝜁 𝛨𝜂 𝛩𝜃𝜗 𝛪𝜄 𝛫𝜅 𝛬𝜆 𝛭𝜇 𝛮𝜈 𝛯𝜉 𝛰𝜊 𝛱𝜋 𝛲𝜌 𝛴𝜎𝜍 𝛵𝜏 𝛶𝜐 𝛷𝜙𝜑 𝛸𝜒 𝛹𝜓 𝛺𝜔