mersenneforum.org

mersenneforum.org (https://www.mersenneforum.org/index.php)
-   GMP-ECM (https://www.mersenneforum.org/forumdisplay.php?f=55)
-   -   ECM for CUDA GPUs in latest GMP-ECM ? (https://www.mersenneforum.org/showthread.php?t=16480)

wombatman 2014-06-19 01:40

1 Attachment(s)
I'm at a loss. Is it possible that the RAM on your card is insufficient? Mine has 1.2GB (1280 MB).

I have attached a file with the binary compiled with CUDA 5.5 (labelled as such).

Have you ever run the ECM-GPU with the standard 2^1018-1 limit before? I'm just trying to figure out if it might be an issue with the size of the arrays or something.

The only other thing I can think of is to try update the driver as well.

wombatman 2014-06-21 01:30

Any updates with the newest CUDA 5.5 one? I'd definitely like to get this sorted out.

WraithX 2014-06-21 15:06

1 Attachment(s)
[QUOTE=wombatman;376334]Any updates with the newest CUDA 5.5 one? I'd definitely like to get this sorted out.[/QUOTE]

It seems like both the CUDA 5.5 and CUDA 6.0 are behaving the same. I might even guess the crash is happening after the CUDA code, somewhere in stage 2 in the cpu code. I have updated my nVidia driver to 337.88 and am still getting the same results, test1 and test2 pass, and test3 and test4 crash. However, one piece of good news is that when I now run the test script with "./test.gpuecm ecm.exe" it no longer crashes right away, it gets through the first two tests and crashes on the third. Progress!

I've done a little testing and narrowed down where the code crashes for me. test4 looks like:
echo "2^349-1" | ecm_gpu_winxp -sigma 3:13 587 1261

Where that last 1261 is the B2 bound for ecm. This test crashes for me. I can decrease that all the way down to 709 and the program will still crash. But, when I set it to 708, the program will then run to completion without any errors.
echo "2^349-1" | ecm_gpu_winxp -sigma 3:13 587 708 (passes)
echo "2^349-1" | ecm_gpu_winxp -sigma 3:13 587 709 (crashes)

With the -v (verbose) command line option, I can track down the crash to somewhere in the stage2.c file. If you would still like to help me track down this problem, I have created a modified version of this file that prints out some extra info to help narrow down where the crash is occurring. If you could compile a new test version with this new stage2.c file and post* it, I can test it out to try to better narrow down where this crash is happening.

*Actually, if you do still want to help, let me know and I can PM you details to log in to my ftp server so you can put the test version there. This way we won't clutter up the forum with extra files. Actually, speaking of clutter, perhaps we should ask a mod to move these troubleshooting posts to their own thread so regular users of gmp-ecm w/cuda don't have to see all this?

Again, let me know if you'd like to continue to troubleshoot for this old OS, or if we should just say this is a Win7+ only program.

wombatman 2014-06-21 15:44

I'll PM you.

wombatman 2014-06-23 23:48

Another question for those smarter than me. For the GPU Stage 1, the actual B1 (appears to) start well above the set value. For example, I set B1=110e6, but by putting in a print statement that uses the same starting counter for the PRINT_REMAINING_ITER variable, I find that the counter starts at B1=158,705,535. This amounts to about 33% more iterations than expected, which for a large number, makes a pretty significant difference in terms of time.

Can anybody help me confirm whether the GPU-based Stage 1 is actually running this many iterations?

fivemack 2014-06-24 06:41

I believe that ecm-7.0 starts by multiplying together all the primes and then does a single elliptic-curve multiply-by-bignum operation; the 158-million-ish figure that you mention is very close to the number of bits in the product of the primes less than 110 million (by the Prime Number Theorem, this product is essentially exp(110 million))

LaurV 2014-06-24 07:00

Indeed. With the exception that the primes are taken at their largest power less than B1. Same as cudaPM1 program, if you check it, when you select B1=600000, it will do 2^19*3^12*5^8*.... which has [B]865771[/B] bits. This is the "lcm" of all numbers (including non-primes) less than B1, which is [URL="http://www.mersennewiki.org/index.php/P-1_Factorization_Method"]referred here[/URL] as "E" (see step 1), and that is the number of "iterations" that have to be done (each iteration is "square, if the bit is 1, multiply by 2", to compute b^E, "normal" modular exponentiation). You can see P-1 as a "single ECM curve" with some special properties.

edit2:

[code]
gp > b1=110000000; m=0.0; cnt=0; forprime(p=2,b1,i=1; while(p^i<b1,m+=log(p); i++); if(cnt++%10000==0, cnt=0; printf("...%d...%c",p,13))); ceil(m/log(2))
...109938667...
%2 = 158705536
gp >
[/code]

wombatman 2014-06-24 15:07

Awesome! Thanks for the answers. I still have a ton to learn about ECM.

houding 2014-07-15 11:45

I'm starting to play with the GPU-ecm program.

In post #253, there is a zip file which I downloaded.

If I use the exe in normal gmp-ecm format on (2^541-1) which has been factored, I do get some of the factors (used small B1).

If I use the exe in GPU-ecm format, I do not get any factors, even if I use the same B1 as in normal mode, with 10000+ curves. I even used the same sigma as for the normal mode.

Am I missing something? :question:

Or is this not the correct exe to use?

VBCurtis 2014-07-15 17:36

[QUOTE=houding;378127]I'm starting to play with the GPU-ecm program.

In post #253, there is a zip file which I downloaded.

If I use the exe in normal gmp-ecm format on (2^541-1) which has been factored, I do get some of the factors (used small B1).

If I use the exe in GPU-ecm format, I do not get any factors, even if I use the same B1 as in normal mode, with 10000+ curves. I even used the same sigma as for the normal mode.

Am I missing something? :question:

Or is this not the correct exe to use?[/QUOTE]

What specific invocation did you use? What flags? What GPU?
Post 253 has an experimental version for ECM on large (up to 4090-bit) numbers. The regular version is good only up to 1018 bits.

wombatman 2014-07-16 03:31

Yeah, if you can post the full command line you used, we can try and diagnose it. I'm out of town, but returning tomorrow, and I can try to factor the same number, since I've had no issues with the exe.

Edit: Also, if you run the test.gpuecm, does it pass without issue? It does on my laptop.

Edit part 2: I ran the following command: [CODE]echo "2^541-1" | ecm_gpu_4096.exe -v -gpu -savea test_file.txt 500000 0[/CODE] and get the following results from part 1: [CODE]********** Factor found in step 1: 6115209994009
Found probable prime factor of 13 digits: 6115209994009
Composite cofactor (2^541-1)/6115209994009 has 151 digits
********** Factor found in step 1: 4312790327
Found probable prime factor of 10 digits: 4312790327
Composite cofactor ((2^541-1)/6115209994009)/4312790327 has 141 digits[/CODE]

Edit part 3: Using [CODE]ecm_gpu_4096.exe -one -resume test_file.txt 1000000
(I did a run of 910 curves with B1=1e6)[/CODE] I get [CODE]********** Factor found in step 2: 77146448294831869472151022106713
Found probable prime factor of 32 digits: 77146448294831869472151022106713
SIGMA=817374218[/CODE]


All times are UTC. The time now is 22:06.

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