mersenneforum.org

mersenneforum.org (https://www.mersenneforum.org/index.php)
-   GPU Computing (https://www.mersenneforum.org/forumdisplay.php?f=92)
-   -   The P-1 factoring CUDA program (https://www.mersenneforum.org/showthread.php?t=17835)

kriesel 2018-07-19 18:00

[QUOTE=kriesel;492089]anomalous Quadro 5000 m350000071 cudapm1 V0.20 20130923 CUDA 5.5 on Windows, interim stage 2 residues:
End of stage 1 and beginning of stage 2 looked normal. Stage 2 was using 1863MB of 2.5GB on the gpu. At stage 2 wrapup/gcd, it dropped to 746MB.
[CODE]
Iteration 3650000 M350000071, 0xfa26579b34919a34, n = 20412K, CUDAPm1 v0.20 err = 0.12109 (20:01 real, 48.0195 ms/iter, ETA 22:37)
Iteration 3675000 M350000071, 0x3ca8420d52bd5a27, n = 20412K, CUDAPm1 v0.20 err = 0.11719 (20:01 real, 48.0155 ms/iter, ETA 2:37)
M350000071, 0x509e08b93355b407, n = 20412K, CUDAPm1 v0.20
Stage 1 complete, estimated total time = 49:05:07
Starting stage 1 gcd.
M350000071 Stage 1 found no factor (P-1, B1=2550000, B2=31875000, e=0, n=20412K CUDAPm1 v0.20)
Starting stage 2.
Using b1 = 2550000, b2 = 31875000, d = 2310, e = 2, nrp = 4
Zeros: 1527348, Ones: 1520172, Pairs: 260423
Processing 1 - 4 of 480 relative primes.
Inititalizing pass... done. transforms: 198, err = 0.11328, (4.77 real, 24.0679 ms/tran, ETA NA)
Transforms: 50660 M350000071, 0xfffffffbfffffffe, n = 20412K, CUDAPm1 v0.20 err = 0.11328 (21:53 real, 25.9248 ms/tran, ETA 43:39:45)

Processing 5 - 8 of 480 relative primes.
Inititalizing pass... done. transforms: 229, err = 0.10547, (5.98 real, 26.1210 ms/tran, ETA 43:42:27)
Transforms: 50812 M350000071, 0xfff7fffbfffdffff, n = 20412K, CUDAPm1 v0.20 err = 0.10547 (21:57 real, 25.9243 ms/tran, ETA 43:19:29)

Processing 9 - 12 of 480 relative primes.
Inititalizing pass... done. transforms: 231, err = 0.10547, (5.99 real, 25.9324 ms/tran, ETA 43:20:31)
Transforms: 50810 M350000071, 0xfff7fffffffdffff, n = 20412K, CUDAPm1 v0.20 err = 0.10547 (21:57 real, 25.9239 ms/tran, ETA 42:57:55)

Processing 13 - 16 of 480 relative primes.
Inititalizing pass... done. transforms: 241, err = 0.10547, (6.24 real, 25.8988 ms/tran, ETA 42:58:31)
Transforms: 50762 M350000071, 0xfff7fffbfffffffe, n = 20412K, CUDAPm1 v0.20 err = 0.10547 (21:56 real, 25.9241 ms/tran, ETA 42:35:58)

Processing 17 - 20 of 480 relative primes.
Inititalizing pass... done. transforms: 247, err = 0.10547, (6.40 real, 25.9017 ms/tran, ETA 42:36:30)
Transforms: 50814 M350000071, 0xfffffffbfffffffe, n = 20412K, CUDAPm1 v0.20 err = 0.10547 (21:57 real, 25.9239 ms/tran, ETA 42:14:22)
[/CODE]Etc. It concluded with a result line no factor found.[/QUOTE]


As a test, I repeated part of stage 2 from very early, and got the following, on a GTX1050Ti
[CODE]Continuing stage 2 from a partial result of M350000071 fft length = 20412K
Starting stage 2.
Using b1 = 2550000, b2 = 31875000, d = 2310, e = 2, nrp = 4
Zeros: 1527348, Ones: 1520172, Pairs: 260423
Processing 5 - 8 of 480 relative primes.
Inititalizing pass... done. transforms: 229, err = 0.10156, (7.87 real, 34.3738 ms/tran, ETA 43:43:20)
Transforms: 50812 M350000071, 0x45dfef64c039aeff, n = 20412K, CUDAPm1 v0.20 err = 0.11133 (31:04 real, 36.6751 ms/tran, ETA 52:17:38)

Processing 9 - 12 of 480 relative primes.
Inititalizing pass... done. transforms: 231, err = 0.10156, (8.50 real, 36.7856 ms/tran, ETA 52:20:27)
SIGINT caught, writing checkpoint.
Transforms: 3300 M350000071, 0x8eb67bcffa00c096, n = 20412K, CUDAPm1 v0.20 err = 0.10938 (2:02 real, 36.8244 ms/tran, ETA 52:35:45)

Quitting, estimated time spent = 55:18
[/CODE]So I concluded probably every bit of stage 2 on the Quadro 5000 was wrong, and resumed it from directly after stage 1 gcd on the GTX1050Ti. That caused it to select different parameters because of the greater available gpu memory.

[CODE]Using b1 = 2550000, b2 = 62188750, d = 4620, e = 2, nrp = 14
Zeros: 3004088, Ones: 2961352, Pairs: 536666
Processing 1 - 14 of 960 relative primes.[/CODE]

kriesel 2018-08-02 20:01

comments in worktodo for CUDAPm1!
 
While looking for something else, I stumbled across this:
The source of parse.c indicates # or \\ or / are comment characters marking the rest of a line as a comment

I've confirmed by test that # or \\ work; / did not in my test, which placed them at the beginnings of records. I could tell by the line number in warning messages which did not work.

kriesel 2018-08-19 18:41

How to build CUDAPm1 for current CUDA levels, development tools available?
 
Yes, there's a makefile, from 2013, and linux. But my experience is makefiles that work in linux don't work in Windows, even in the msys2/mingw64 environment, as is or with what look like merited edits. Also NVIDIA's compiler nvcc wants Visual Studio not g++. And a lot has changed in the 5 years since there were posted Windows executables.

Presumably various paths would need to be updated for the different OS, different CUDA toolkit version, different c++ compiler version etc.
Also CUFLAGS would need to be updated for new available compute levels to be added, and probably for old ones no longer supported by nvcc to be dropped.

And the CUDAPm1 makefile contains:
L = -lcufft -lcudart -lm -lgmp

Presumably gmp is that of [URL]https://gmplib.org/[/URL] which I've installed.

And the m is this? [URL]https://stackoverflow.com/questions/1033898/why-do-you-have-to-link-the-math-library-in-c[/URL]

henryzz 2018-08-20 15:19

[QUOTE=kriesel;494224]Yes, there's a makefile, from 2013, and linux. But my experience is makefiles that work in linux don't work in Windows, even in the msys2/mingw64 environment, as is or with what look like merited edits. Also NVIDIA's compiler nvcc wants Visual Studio not g++. And a lot has changed in the 5 years since there were posted Windows executables.

Presumably various paths would need to be updated for the different OS, different CUDA toolkit version, different c++ compiler version etc.
Also CUFLAGS would need to be updated for new available compute levels to be added, and probably for old ones no longer supported by nvcc to be dropped.

And the CUDAPm1 makefile contains:
L = -lcufft -lcudart -lm -lgmp

Presumably gmp is that of [URL]https://gmplib.org/[/URL] which I've installed.

And the m is this? [URL]https://stackoverflow.com/questions/1033898/why-do-you-have-to-link-the-math-library-in-c[/URL][/QUOTE]

Is there a reason why Visual Studio is not an option?

kriesel 2018-08-20 17:32

[QUOTE=henryzz;494292]Is there a reason why Visual Studio is not an option?[/QUOTE]
It may be. I'm reluctant to spend a lot. I'm preparing to make a first attempt to build CUDAPm1. It seemed a useful exercise to identify what all code needs to be gathered for compile/link. And the necessary tools. And some understanding (which I'm still working on).

Visual Studio might be part of the process. I have (free) VS 2017 Community Edition installed. Nvcc v9.2 is compatible with VS 2017 but nvcc 8.0 and earlier are not. From what I've read, nvcc preprocesses the CUDA specific stuff and then uses VS's cl.exe to compile and link. A specific version of nvcc is limited in what versions of VS it will work with, and in what compute capability levels are supported. I have a lot of old gpus, 2.x compute capability. Nvcc 9.x (only version compatible with VS 2017) doesn't support CUDA level 2.x or lower. VS availability for free is limited to only the latest flavor (2017, or 15.x currently). A VS Pro license for ~$500 also gets only the latest flavor. To get access to earlier versions, such as VS2012 that is compatible with many versions of CUDA toolkt, including as far back as v5.5, seems to require a Pro subscription $1200 first year, $800 annually thereafter. [URL]https://visualstudio.microsoft.com/vs/pricing/[/URL]. Or there are alternatives like used resold software on eBay.
Or maybe I've misunderstood something while climbing this particular learning curve. If so, please share data/corrections.

kriesel 2018-08-20 19:13

ah42 fork
 
Hi,


I stumbled on this a while back, noted it, forgot about it, and recently had another look. Has anyone compiled and run this? If so, how did it compare to the sourceforge version, which is what's mirrored at mersenne.ca?

[URL]https://github.com/ah42/cuda-p1[/URL]

henryzz 2018-08-20 19:57

[QUOTE=kriesel;494300]It may be. I'm reluctant to spend a lot. I'm preparing to make a first attempt to build CUDAPm1. It seemed a useful exercise to identify what all code needs to be gathered for compile/link. And the necessary tools. And some understanding (which I'm still working on).

Visual Studio might be part of the process. I have (free) VS 2017 Community Edition installed. Nvcc v9.2 is compatible with VS 2017 but nvcc 8.0 and earlier are not. From what I've read, nvcc preprocesses the CUDA specific stuff and then uses VS's cl.exe to compile and link. A specific version of nvcc is limited in what versions of VS it will work with, and in what compute capability levels are supported. I have a lot of old gpus, 2.x compute capability. Nvcc 9.x (only version compatible with VS 2017) doesn't support CUDA level 2.x or lower. VS availability for free is limited to only the latest flavor (2017, or 15.x currently). A VS Pro license for ~$500 also gets only the latest flavor. To get access to earlier versions, such as VS2012 that is compatible with many versions of CUDA toolkt, including as far back as v5.5, seems to require a Pro subscription $1200 first year, $800 annually thereafter. [URL]https://visualstudio.microsoft.com/vs/pricing/[/URL]. Or there are alternatives like used resold software on eBay.
Or maybe I've misunderstood something while climbing this particular learning curve. If so, please share data/corrections.[/QUOTE]
The old installers can be got through [url]https://visualstudio.microsoft.com/vs/older-downloads/[/url]

There are a few hoops as part of this you have to subscribe to the developer essentials package for free which wasn't obvious initially for me.

kriesel 2018-08-29 21:56

[QUOTE=henryzz;494325]The old installers can be got through [URL]https://visualstudio.microsoft.com/vs/older-downloads/[/URL]

There are a few hoops as part of this you have to subscribe to the developer essentials package for free which wasn't obvious initially for me.[/QUOTE]
Thanks for the tip. The earliest version available there is VS 2013. (I'd hoped to be able to get back to VS2010.)

After multiple failed download attempts via my crappy slow costly ISP (768k/128k DSL, 4.8GB 14 hour download projected if things were working well, actual 1.5GB max per attempt, multiple days elapsed), the utility contractor working in my neighborhood to install fiber put an end to it by cutting the neighborhood's telco voice/DSL cable. Driving to another location got the 4.8GB ISO download on the first try in under 3 hours. With such slow and unreliable internet, I tend to go for a full install image that can be put on a local file server, download once, and reuse locally. Crappy-slow-costly-ISP was immediately contacted within 10 minutes of the start of the outage, took an hour of phone time to generate a trouble ticket, and projected beginning to repair after a week of no service, and claimed they would process a bill credit. Service cut was on the first day of the billing cycle. I've already received a bill for a full month's service not received or receivable, beginning the day the cable was cut, and the bill did not include the promised credit for outage. The DSL in this neighborhood runs from the nearest village, miles away, preventing high speed, instead of running from the nearest hut, a half mile away, that could probably provide 25.Mbps.

James Heinrich 2018-08-29 22:39

I've had ISP troubles like that in the past (it once took an ISP 6 weeks of no internet before they fixed whatever was broken), so I can sympathize. I'm happy to be on 250Mbps service now (4.8GB ISO should complete in under 3 mins). I hope your fiber install is completed soon.

kriesel 2018-08-29 23:32

[QUOTE=James Heinrich;494889]I've had ISP troubles like that in the past (it once took an ISP 6 weeks of no internet before they fixed whatever was broken), so I can sympathize. I'm happy to be on 250Mbps service now (4.8GB ISO should complete in under 3 mins). I hope your fiber install is completed soon.[/QUOTE]Ouch, 6 weeks, that would be trouble. What cut my cable was work to bring service being marketed as a choice of 300M/300M, or 1000M/400M fiber service.
I turned road warrior for a week and now have a spreadsheet documenting open hours and speed tests for the nearest free WiFi. It was beginning to get highly inconvenient as various Prime95 workers ran out of work and completed work was spooled up.

There have been times when the ping times to the nearest university are routinely 1 to 4 seconds or longer (normal is under 70msec). There have been times when the ISP's dns server is quite hosed, and I provided tech support to their "tech support" phone drone, and it stayed broken for days or weeks, and I switched to using opendns not theirs. Etc.

My greedy cell provider is another story. Ancient plan as is, any fraction of a MB that's not an SMS message is $3. Outbound SMS text is $0.25 each, which is $1.60 and up per KILOBYTE. Nope, can't just add a decent data option to the existing plan, must switch to a hundreds-per-year-more-costly base plan to add data. (Similar story from 3 different locations I tried. One tried to roll a $200 wireless router purchase in to it also.) Base plan without those charges costs more than double per month, an alternative I've recently discovered, while trying to just add some tide-me-over slow wireless data connecting to one laptop during the DSL outage. If they'd offered something reasonable they could have kept a loyal long term customer who's already paid them several thousand dollars over the years. In my opinion there are only one or two cell providers charging reasonably and offering plans that fit a range of usage levels, while the others are all upselling and gouging. Time to go phone shopping on line.

James Heinrich 2018-08-29 23:48

[QUOTE=kriesel;494893]My greedy cell provider is another story[/QUOTE]Wow, sounds like you live in the backwoods of Elbonia. Or Canada.


All times are UTC. The time now is 23:19.

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