![]() |
![]() |
#12 | ||
"Seth"
Apr 2019
24×33 Posts |
![]() Quote:
(2^569-1)/160592976218334727184554268072735638438202191 which has a 42 digit factor Quote:
`git fetch` `git reset --hard origin/gpu_integration` Thanks for confirming you also see the cudaError, I'll investigate more now that multiple people see it. |
||
![]() |
![]() |
![]() |
#13 |
Jul 2003
So Cal
22×3×197 Posts |
![]()
That was a painful configure. I'm using nvhpc rather than the CUDA toolkit, so the directory structure is different and the cuda lib is just a stub so the check for cuInit() fails. I can point to the actual lib, but the version doesn't match the nvhpc version (which is fine, nvhpc doesn't require them to match) but that check fails. Then the check for CGBN ignores the --with-gmp directory so that check fails because it can't find GMP but reports that it can't find cgbn.h. After bypassing all of those checks, I get a working binary. Yay!
Code:
$ echo "(2^499-1)/20959" | ./ecm -gpu -cgbn -sigma 3:1000 20000 0 GMP-ECM 7.0.5-dev [configured with GMP 6.2.1, --enable-asm-redc, --enable-gpu, --enable-assert] [ECM] Input number is (2^499-1)/20959 (146 digits) Using B1=20000, B2=0, sigma=3:1000-3:6119 (5120 curves) Computing 5120 Step 1 took 282ms of CPU time / 705ms of GPU time $ echo "((2^499-1)/20959)" | ./ecm -gpu -cgbn -sigma 3:1000 2000000 0 GMP-ECM 7.0.5-dev [configured with GMP 6.2.1, --enable-asm-redc, --enable-gpu, --enable-assert] [ECM] Input number is ((2^499-1)/20959) (146 digits) Using B1=2000000, B2=0, sigma=3:1000-3:6119 (5120 curves) GPU: factor 1998447222711143545931606352264121 found in Step 1 with curve 2890 (-sigma 3:3890) Computing 5120 Step 1 took 47146ms of CPU time / 112480ms of GPU time ********** Factor found in step 1: 1998447222711143545931606352264121 Found prime factor of 34 digits: 1998447222711143545931606352264121 Prime cofactor (((2^499-1)/20959))/1998447222711143545931606352264121 has 113 digits |
![]() |
![]() |
![]() |
#14 | |
"Seth"
Apr 2019
43210 Posts |
![]() Quote:
I feel for you on setup. I didn't know any automake and how to configure it took me a whole day. If you were willing you could try making this change and seeing if the cgbn.h checks respects the --with_gmp_lib path after it. diff --git a/acinclude.m4 b/acinclude.m4 index fbbf94df..04694003 100644 --- a/acinclude.m4 +++ b/acinclude.m4 @@ -612,7 +612,7 @@ AS_IF([test "x$enable_gpu" = "xyes" ], #include <gmp.h> #include <cgbn.h> ], - [-I$cgbn_include -lgmp], + [-I$cgbn_include $GMPLIB], [AC_MSG_RESULT([yes])], [ AC_MSG_RESULT([no]) @@ -620,7 +620,7 @@ AS_IF([test "x$enable_gpu" = "xyes" ], ] ) AC_DEFINE([HAVE_CGBN_H], [1], [Define to 1 if cgbn.h exists]) - NVCCFLAGS="-I$with_cgbn_include -lgmp $NVCCFLAGS" + NVCCFLAGS="-I$with_cgbn_include $GMPLIB $NVCCFLAGS" want_cgbn="yes" ]) ]) Last fiddled with by SethTro on 2021-08-28 at 09:55 |
|
![]() |
![]() |
![]() |
#15 |
"Seth"
Apr 2019
24·33 Posts |
![]()
I made a fairly large change so that the GPU kernel is called in much smaller batches. This helps with system responsiveness also gives a progress status.
|
![]() |
![]() |
![]() |
#16 |
Sep 2009
2×1,163 Posts |
![]()
After further testing on the system I was trying it on I'm fairly sure it won't work because the GPU is sm_30 (Fermi architecture) and CGBN needs sm_35 (Kepler) or higher. I had to look in the Makefiles shipped with CGBN to find out what sm_.. corresponds to what marketing name Nvidia use.
I have a newer GPU which is sm_52. But that system has an old version of the CUDA Toolkit and runtime (7.5/7.5). And that doesn't support CGBN. So I'll have to upgrade CUDA on that system. Which will take a while. I've just used git clone 'https://github.com/sethtroisi/gmp-ecm.git' to grab a clean copy of the latest code instead of downloading gmp-ecm-gpu_integration.zip from the web site. I assume that's the best way to get it. PS. git clone 'https://github.com/sethtroisi/gmp-ecm.git' isn't right, it doesn't include cgbn_stage1.* So what should I use? Last fiddled with by chris2be8 on 2021-08-28 at 16:28 Reason: Added PS. |
![]() |
![]() |
![]() |
#17 | |
"Ed Hall"
Dec 2009
Adirondack Mtns
119716 Posts |
![]() Quote:
|
|
![]() |
![]() |
![]() |
#18 |
Just call me Henry
"David"
Sep 2007
Liverpool (GMT/BST)
598410 Posts |
![]()
There still seems to be cudaDeviceSynchronize issues although I get it at a very different line number.
Code:
echo "(2^499-1)/20959" | ./ecm -gpu -cgbn -gpucurves 3584 -sigma 3:1000 20000 GMP-ECM 7.0.5-dev [configured with GMP 6.2.99, --enable-asm-redc, --enable-gpu, --enable-assert, --enable-openmp] [ECM] Input number is (2^499-1)/20959 (146 digits) Using B1=20000, B2=3804582, sigma=3:1000-3:4583 (3584 curves) CUDA error occurred: unknown error While running cudaDeviceSynchronize() (file cgbn_stage1.cu, line 733) I have managed to get the non-cgbn code working under WSL2 although this required updating windows to 21H2 to enable gpu support which is only available as a preview so far. |
![]() |
![]() |
![]() |
#19 |
Sep 2009
91616 Posts |
![]()
My system with that card has CUDA 9.1 on it. So if you can "upgrade" to that level ecm and msieve should build.
|
![]() |
![]() |
![]() |
#20 | |
"Evan"
Dec 2020
Montreal
23×32 Posts |
![]() Quote:
The correct command to download the CGBN branch should be git clone https://github.com/sethtroisi/gmp-ecm/ -b gpu_integration folder_name. PS: Also receiving the same CUDA error as chris2be8, $ echo "2^997-1" | ./ecm -gpu -cgbn -sigma 3:1000 20000 0 GMP-ECM 7.0.5-dev [configured with GMP 6.2.1, --enable-asm-redc, --enable-gpu, --enable-assert] [ECM] Input number is 2^997-1 (301 digits) Using B1=20000, B2=0, sigma=3:1000-3:1639 (640 curves) CUDA error occurred: cannot set while device is active in this process While running cudaSetDeviceFlags (cudaDeviceScheduleBlockingSync) (file cgbn_stage1.cu, line 600) Last fiddled with by Plutie on 2021-08-28 at 17:14 Reason: additional note |
|
![]() |
![]() |
![]() |
#21 |
"Seth"
Apr 2019
1B016 Posts |
![]()
WraithX proposed a patch which will hopefully resolve the `CUDA error occurred: cannot set while device is active in this process` error. Hopefully it will be checked in later today / tonight.
Last fiddled with by SethTro on 2021-08-28 at 20:08 |
![]() |
![]() |
![]() |
#22 |
Just call me Henry
"David"
Sep 2007
Liverpool (GMT/BST)
25·11·17 Posts |
![]()
With Wraith's patch(with the header fixed) I now get:
Code:
echo "(2^499-1)/20959" | ./ecm -gpu -cgbn -gpucurves 3584 -sigma 3:1000 2000 GMP-ECM 7.0.5-dev [configured with GMP 6.2.99, --enable-asm-redc, --enable-gpu, --enable-assert, --enable-openmp] [ECM] Input number is (2^499-1)/20959 (146 digits) Using B1=2000, B2=147396, sigma=3:1000-3:4583 (3584 curves) Computing 3584 Step 1 took 1863ms of CPU time / 2291ms of GPU time Computing 3584 Step 2 on CPU took 12404ms echo "(2^499-1)/20959" | ./ecm -gpu -gpucurves 3584 -sigma 3:1000 2000 GMP-ECM 7.0.5-dev [configured with GMP 6.2.99, --enable-asm-redc, --enable-gpu, --enable-assert, --enable-openmp] [ECM] Input number is (2^499-1)/20959 (146 digits) Using B1=2000, B2=147396, sigma=3:1000-3:4583 (3584 curves) GPU: Block: 32x32x1 Grid: 112x1x1 (3584 parallel curves) Computing 3584 Step 1 took 3668ms of CPU time / 6199ms of GPU time Computing 3584 Step 2 on CPU took 12445ms Code:
echo "(2^499-1)/20959" | ./ecm -gpu -cgbn -gpucurves 3584 -sigma 3:1000 20000 GMP-ECM 7.0.5-dev [configured with GMP 6.2.99, --enable-asm-redc, --enable-gpu, --enable-assert, --enable-openmp] [ECM] Input number is (2^499-1)/20959 (146 digits) Using B1=20000, B2=3804582, sigma=3:1000-3:4583 (3584 curves) CUDA error (702) occurred: the launch timed out and was terminated While running cudaDeviceSynchronize() (file cgbn_stage1.cu, line 731) |
![]() |
![]() |
![]() |
Thread Tools | |
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
NTT faster than FFT? | moytrage | Software | 50 | 2021-07-21 05:55 |
PRP on gpu is faster that on cpu | indomit | Information & Answers | 4 | 2020-10-07 10:50 |
faster than LL? | paulunderwood | Miscellaneous Math | 13 | 2016-08-02 00:05 |
My CPU is getting faster and faster ;-) | lidocorc | Software | 2 | 2008-11-08 09:26 |
Faster than LL? | clowns789 | Miscellaneous Math | 3 | 2004-05-27 23:39 |