![]() |
[QUOTE=kriesel;498660]
Possibly Cubox might help in some way. [URL]https://www.mersenneforum.org/showpost.php?p=481663&postcount=552[/URL] [/QUOTE] Sorry, studies kept me busy and I completely forgot the project. I might give it a try again, but no promises. Any areas that need a look, that I can start into? Something I can't really break if possible :P |
Checking the source very quickly I see this: [url]https://github.com/ah42/cuda-p1/blob/ffe52b53c3c2955f1750574e62d80eba3ed6d455/CUDAPm1.cu#L2635[/url]
This is the kind of rusting I can find fun to polish |
[QUOTE=Cubox;510952]Checking the source very quickly I see this: [URL]https://github.com/ah42/cuda-p1/blob/ffe52b53c3c2955f1750574e62d80eba3ed6d455/CUDAPm1.cu#L2635[/URL]
This is the kind of rusting I can find fun to polish[/QUOTE] Good one, I hadn't seen that. Welcome back. There's lots to pick from. See posts 676 & 677 of this thread, and the full bug and wish list (attachment in post 3 of [URL]https://www.mersenneforum.org/showthread.php?t=23389[/URL]) My personal preference would be addition of ISO style date and time to one-second or better precision to screen output, elapsed time on gcds, optional logging of stdout and stderr, and progress on 676 & 677. See also 653; those silent halts in stage 2 can be a bit maddening. Aaron implemented some and deferred some of what I offered in [URL]https://www.mersenneforum.org/showpost.php?p=499685&postcount=612[/URL] First step would be to get a development and build environment going, and confirm the ability to build a small CUDA example and then either v0.20 (requires gmp I think) or preferably v0.22 (requires MPIR as I recall) before attempting further changes. |
Noted.
Would it be OK to try to rearrange the source code a bit? Right now the main .cu file is huge and difficult to navigate, I'd like to clean up a bit. Moving "math" functions into separate files, leaving startup and config/argument list parsing into the main file. I saw references to LL in the code, maybe remove unused code. I'm not going to touch any function that does math, such as the stage2 function. Don't want to break anything. But it might be more easy to navigate into the source if it's more clean. |
Also, the binary won't run without the cudart and cufft DLLs present. Won't even give any error message on the command line.
If nothing can be done to print an error (if Windows won't start the binary we can't do anything about it), it should be documented for people wanting to try for themselves. Or maybe package them with the binaries? Same for the ini file. I will try to get a build environment. Hopefully without Visual Studio I can build v0.22 (no point in trying 0.20). Are Github pull requests alright for submitting changes? Cheers |
[QUOTE=Cubox;510972]Noted.
Would it be OK to try to rearrange the source code a bit? Right now the main .cu file is huge and difficult to navigate, I'd like to clean up a bit. Moving "math" functions into separate files, leaving startup and config/argument list parsing into the main file. I saw references to LL in the code, maybe remove unused code. I'm not going to touch any function that does math, such as the stage2 function. Don't want to break anything. But it might be more easy to navigate into the source if it's more clean.[/QUOTE] What blocks of code do you think can be removed? I wouldn't bet on those "references to LL" being a reliable indicator of what may be unused and deletable, or there being much that can be entirely stripped. For example, I think part of a comment section at CUDAPm1.cu ~line 1399 " * End LL/GPU Functions, Begin Utility/CPU Functions *" just didn't get changed to "End P-1/GPU Functions...". Or parse.c ~line 544: case NO_TEST_EQUAL: printf("doesn't begin with Test= or DoubleCheck=.\n");break; The message should be about "doesn't begin with PFactor=" There are lots of references to the variables LL_tests or LL_saved. Those are legitimate variables and code for P-1, involved in determining what are good P-1 bounds to run. (I'd rather state here a thing or two that might already be obvious to you, than have you miss something and use your time inefficiently as a result. And I've probably left a lot out too so be careful.) The CUDAPm1 program was probably created from a complete copy of some earlier version of CUDALucas. Some comments, print statements, etc., did not get changed along with the rest of the code. Similarly, the editing of the readme file and ini file were not completed then. Will you be working mainly in linux or Windows? It will be much easier for me to test Windows executables, CUDA 5.0 - 8.0 range only currently. Re github use, please take that up with Aaron Haviland, as it's his repo. The necessity for the dlls, ini file etc can be addressed in the readme and may already be. |
[QUOTE=kriesel;510991]What blocks of code do you think can be removed?
I wouldn't bet on those "references to LL" being a reliable indicator of what may be unused and deletable, or there being much that can be entirely stripped. For example, I think part of a comment section at CUDAPm1.cu ~line 1399 " * End LL/GPU Functions, Begin Utility/CPU Functions *" just didn't get changed to "End P-1/GPU Functions...". Or parse.c ~line 544: case NO_TEST_EQUAL: printf("doesn't begin with Test= or DoubleCheck=.\n");break; The message should be about "doesn't begin with PFactor=" There are lots of references to the variables LL_tests or LL_saved. Those are legitimate variables and code for P-1, involved in determining what are good P-1 bounds to run. (I'd rather state here a thing or two that might already be obvious to you, than have you miss something and use your time inefficiently as a result. And I've probably left a lot out too so be careful.) [/QUOTE] I have not identified any code at all yet, but I am willing to go and check if I can find any. I will obviously not remove anything before making sure it is not necessary. [QUOTE=kriesel;510991] Will you be working mainly in linux or Windows? It will be much easier for me to test Windows executables, CUDA 5.0 - 8.0 range only currently. [/QUOTE] Windows, latest (Enterprise edition). With a GTX 1070, so 6.1. Don't have anything else. |
[QUOTE=Cubox;510994]I have not identified any code at all yet, but I am willing to go and check if I can find any.
I will obviously not remove anything before making sure it is not necessary. Windows, latest (Enterprise edition). With a GTX 1070, so 6.1. Don't have anything else.[/QUOTE]Excellent. Nice card. When you get to that point, please build for CC 2.0 and up if practical. Something I found confusing early on, and still find inconvenient, is the difference between Compute Capability, CUDA level, and the multiple ways of expressing driver versions. I can run anything from CUDA4.0 to CUDA8.0 on a Compute Capability 2.0 gpu such as Quadro 4000, if I'm careful, but not if too high a driver version is installed, such as 24.21.14.1195 (411.95), which was ok with CC3.0 but not 2.0. Too high a driver level can make a low Compute Capability card disappear as far as CUDA apps are concerned. I haven't found a good CC/CUDA/driver min and max limits scorecard for what works with what yet. Wading through specs and SDK documentation to find it is tedious. And then there is the whole model name/ family name connection. |
I'm still working on having the project build, but close.
In the meantime, is it OK to ask some (sometimes basic) questions about P-1 and how it is implemented for GIMPS? It's not directly related to the project, so feel free to tell me where to ask elsewhere. |
Build successful!
[url]https://cubox.me/files/gimps/CUDAPm1-23032019.zip[/url] With Cuda 10.1 which is higher than the release binary on Github I think. I'll see about compute capabilities |
I am seeing big gains on speed between my binary compiled for 6.1 compute capability, versus the binary from GitHub, which is compiled for 3.5 compute capability:
[C]Iteration 5000 M61408363, 0xb18fee1c5cbbc536, n = 3360K, CUDAPm1 v0.22 err = 0.17188 (0:27 real, 5.3726 ms/iter, ETA 1:17:04) Iteration 10000 M61408363, 0x717c9ea7258d4438, n = 3360K, CUDAPm1 v0.22 err = 0.16406 (0:26 real, 5.3408 ms/iter, ETA 1:16:10) Iteration 15000 M61408363, 0xdf4aaa1700855aac, n = 3360K, CUDAPm1 v0.22 err = 0.17188 (0:27 real, 5.3603 ms/iter, ETA 1:16:00)[/C] VS [C]Iteration 5000 M61408363, 0xb18fee1c5cbbc536, n = 3360K, CUDAPm1 v0.22 err = 0.17969 (0:21 real, 4.0929 ms/iter, ETA 58:43) Iteration 10000 M61408363, 0x717c9ea7258d4438, n = 3360K, CUDAPm1 v0.22 err = 0.17188 (0:20 real, 4.0922 ms/iter, ETA 58:22) Iteration 15000 M61408363, 0xdf4aaa1700855aac, n = 3360K, CUDAPm1 v0.22 err = 0.16602 (0:20 real, 4.0929 ms/iter, ETA 58:02)[/C] The 6.1 binary: [url]https://cubox.me/files/gimps/CUDAPm1.exe[/url] |
| All times are UTC. The time now is 23:19. |
Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2021, Jelsoft Enterprises Ltd.