mersenneforum.org  

Go Back   mersenneforum.org > Factoring Projects > GMP-ECM

Reply
 
Thread Tools
Old 2015-05-30, 19:12   #320
Singularity
 
May 2015

316 Posts
Default

[QUOTE=lorgix;402904 but I think you should be using either -gpucurves 48 or 96.[/QUOTE]

Thank you for your answer, why are those two values the only one I should be using ? I thought the program automatically selects the maximum that the card can handle. On your hardware it may well be 96, but on mine it seems to be 64 and as I said any curve number below 32 gets adjusted to 32. Any number strictly above 32 gets adjusted to 64, so I guess those two values are the only possible ones for me.

Regardless, I would be very glad for information with which I could diagnose the problem further, if there is a problem at all (maybe my card can't handle the provided cudakernel and this behaviour is expected).

I could write to the dedicated mailing list at gforge.inria.fr but I don't want to bother developers if the issue is trivial and an answer can be found here.
Singularity is offline   Reply With Quote
Old 2015-05-31, 09:43   #321
lorgix
 
lorgix's Avatar
 
Sep 2010
Scandinavia

3·5·41 Posts
Default

Quote:
Originally Posted by Singularity View Post
Thank you for your answer, why are those two values the only one I should be using ? I thought the program automatically selects the maximum that the card can handle. On your hardware it may well be 96, but on mine it seems to be 64 and as I said any curve number below 32 gets adjusted to 32. Any number strictly above 32 gets adjusted to 64, so I guess those two values are the only possible ones for me.

Regardless, I would be very glad for information with which I could diagnose the problem further, if there is a problem at all (maybe my card can't handle the provided cudakernel and this behaviour is expected).

I could write to the dedicated mailing list at gforge.inria.fr but I don't want to bother developers if the issue is trivial and an answer can be found here.
It should select the maximum if you don't tell it otherwise.
I thought GT525M had two "blocks" of 48 cores, but maybe it has three "blocks" of 32 like you say.
From what I can see it has 48 cores per SM, and in my experience that decides what number of concurrent curves makes the most sense. But I'm not 100% on this.
lorgix is offline   Reply With Quote
Old 2015-06-02, 04:23   #322
wombatman
I moo ablest echo power!
 
wombatman's Avatar
 
May 2013

33658 Posts
Default

Anybody know how to resolve this error:

Code:
unresolved external symbol mpn_mul_fft referenced in function __ecm_mpres_mul
It seems to be caused by MPIR not having "mpn_mul_fft" defined or mapped or something. But MPIR works so well on windows.
wombatman is offline   Reply With Quote
Old 2015-06-03, 15:30   #323
Brian Gladman
 
Brian Gladman's Avatar
 
May 2008
Worcester, United Kingdom

22·7·19 Posts
Default

Quote:
Originally Posted by wombatman View Post
Anybody know how to resolve this error:

Code:
unresolved external symbol mpn_mul_fft referenced in function __ecm_mpres_mul
It seems to be caused by MPIR not having "mpn_mul_fft" defined or mapped or something. But MPIR works so well on windows.

MPIR does have this function and, since GMP-ECM builds fine with MSVC, this seems to be a problem specific to your build environment. How are you building GMP-ECM?
Brian Gladman is offline   Reply With Quote
Old 2015-06-05, 05:05   #324
wombatman
I moo ablest echo power!
 
wombatman's Avatar
 
May 2013

13·137 Posts
Default

Building in VS 2012 with MPIR 2.7.0 (also built in VS 2012) as 64-bit using CUDA 7.0.

The definition is supposed to be here:
Code:
#if defined( __MPIR_RELEASE ) && __MPIR_RELEASE >= 20600

#if __MPIR_RELEASE == 20600
#error MPIR 2.6 does not support GMP-ECM, please use an alternative version
#endif
/* WARNING - the following two defintions map the internal interface
   of the new FFT in MPIR 2.6 (and later) to the GMP FFT interface -
   they work in this context but the parameters for mpn_fft_next_size
   and fft_adjust_limbs have different semantics, which means that
   these definitions may fail if used in other circumstances 
*/
#  define mpn_fft_best_k(n, k)             (0) 
#  define mpn_fft_next_size(n, k)          fft_adjust_limbs(n)

#else

#define mpn_mul_fft __gmpn_mul_fft
mp_limb_t __gmpn_mul_fft (mp_ptr, mp_size_t, mp_srcptr, mp_size_t, mp_srcptr, 
                          mp_size_t, int);

#define mpn_mulmod_bnm1 __gmpn_mulmod_bnm1
void mpn_mulmod_bnm1 (mp_ptr, mp_size_t, mp_srcptr, mp_size_t, mp_srcptr, 
                      mp_size_t, mp_ptr);

#define mpn_mul_fft_full __gmpn_mul_fft_full
void __gmpn_mul_fft_full (mp_ptr, mp_srcptr, mp_size_t, mp_srcptr, mp_size_t);

#define mpn_fft_next_size __gmpn_fft_next_size
mp_size_t __gmpn_fft_next_size (mp_size_t, int);

#define mpn_mulmod_bnm1_next_size __gmpn_mulmod_bnm1_next_size
mp_size_t mpn_mulmod_bnm1_next_size (mp_size_t);

#define mpn_fft_best_k __gmpn_fft_best_k
int __gmpn_fft_best_k (mp_size_t, int);

#endif
But I think it's not hitting the else like it should?
wombatman is offline   Reply With Quote
Old 2015-06-05, 08:42   #325
Brian Gladman
 
Brian Gladman's Avatar
 
May 2008
Worcester, United Kingdom

53210 Posts
Default

Quote:
Originally Posted by wombatman View Post
Building in VS 2012 with MPIR 2.7.0 (also built in VS 2012) as 64-bit using CUDA 7.0.

The definition is supposed to be here:
Code:
#if defined( __MPIR_RELEASE ) && __MPIR_RELEASE >= 20600

#if __MPIR_RELEASE == 20600
#error MPIR 2.6 does not support GMP-ECM, please use an alternative version
#endif
/* WARNING - the following two defintions map the internal interface
   of the new FFT in MPIR 2.6 (and later) to the GMP FFT interface -
   they work in this context but the parameters for mpn_fft_next_size
   and fft_adjust_limbs have different semantics, which means that
   these definitions may fail if used in other circumstances 
*/
#  define mpn_fft_best_k(n, k)             (0) 
#  define mpn_fft_next_size(n, k)          fft_adjust_limbs(n)

#else

#define mpn_mul_fft __gmpn_mul_fft
mp_limb_t __gmpn_mul_fft (mp_ptr, mp_size_t, mp_srcptr, mp_size_t, mp_srcptr, 
                          mp_size_t, int);

#define mpn_mulmod_bnm1 __gmpn_mulmod_bnm1
void mpn_mulmod_bnm1 (mp_ptr, mp_size_t, mp_srcptr, mp_size_t, mp_srcptr, 
                      mp_size_t, mp_ptr);

#define mpn_mul_fft_full __gmpn_mul_fft_full
void __gmpn_mul_fft_full (mp_ptr, mp_srcptr, mp_size_t, mp_srcptr, mp_size_t);

#define mpn_fft_next_size __gmpn_fft_next_size
mp_size_t __gmpn_fft_next_size (mp_size_t, int);

#define mpn_mulmod_bnm1_next_size __gmpn_mulmod_bnm1_next_size
mp_size_t mpn_mulmod_bnm1_next_size (mp_size_t);

#define mpn_fft_best_k __gmpn_fft_best_k
int __gmpn_fft_best_k (mp_size_t, int);

#endif
But I think it's not hitting the else like it should?
No, that is not the problem, as it shouold NOT take the else branch for MPIR 2.6 and later versions. The missing function declaration (mpn_mul_fft) should be picked up from gmp.h here:
Code:
#define mpn_mul_fft __MPN(mul_fft)
__GMP_DECLSPEC int mpn_mul_fft __GMP_PROTO((mp_ptr rp, mp_size_t rn, mp_srcptr ap, mp_size_t an, mp_srcptr bp, mp_size_t bn, int k));
so we need to work out why this declaration is not being seen (or is failing in some way) during the build of GMP-ECM.
Brian Gladman is offline   Reply With Quote
Old 2015-06-06, 03:20   #326
wombatman
I moo ablest echo power!
 
wombatman's Avatar
 
May 2013

13·137 Posts
Default

I went into my MPIR 2.7.0 folder and found gmp.h. I removed the one in the GMP-ECM VS solution and added that one. That gmp.h doesn't have mpn_mul_fft either.

This is the only bit found when searching gmp.h for "mpn_mul_fft":
Code:
/**************** MPN API for FFT ****************/
#define mpn_mul_fft_main __MPN(mul_fft_main)
__GMP_DECLSPEC void mpn_mul_fft_main __GMP_PROTO ((mp_ptr r1, mp_srcptr i1, mp_size_t n1, mp_srcptr i2, mp_size_t n2));

Last fiddled with by wombatman on 2015-06-06 at 03:23
wombatman is offline   Reply With Quote
Old 2015-06-06, 08:08   #327
Brian Gladman
 
Brian Gladman's Avatar
 
May 2008
Worcester, United Kingdom

22·7·19 Posts
Default

Quote:
Originally Posted by wombatman View Post
I went into my MPIR 2.7.0 folder and found gmp.h. I removed the one in the GMP-ECM VS solution and added that one. That gmp.h doesn't have mpn_mul_fft either.

This is the only bit found when searching gmp.h for "mpn_mul_fft":
Code:
/**************** MPN API for FFT ****************/
#define mpn_mul_fft_main __MPN(mul_fft_main)
__GMP_DECLSPEC void mpn_mul_fft_main __GMP_PROTO ((mp_ptr r1, mp_srcptr i1, mp_size_t n1, mp_srcptr i2, mp_size_t n2));
If gmp.h doesn't have a declaration of mpn_mul_fft, something has gone wrong when MPIR was built. During an MPIR build, the files mpir.h and gmp.h are automatically generated from the file gmp_h.in in the MPIR root directory. If gmp_h.in includes the declaation of mpn_mul_fft, (check this, as it should do so), then it seems that the gmp.h and mpir.h files are not being written correctly when MPIR is built. It would make sense to do a completely clean build of MPIR to see if these files are being generated properly.
Brian Gladman is offline   Reply With Quote
Old 2015-06-06, 17:16   #328
wombatman
I moo ablest echo power!
 
wombatman's Avatar
 
May 2013

13×137 Posts
Default

Will do, and I'll post again when I've had time to do it and see if it works. Thanks for the suggestions.

Edit: Just checked gmp_h.in from my MPIR 2.7.0 source folder, and it only has the "mpn_mul_fft_main" definition as posted above. The file is showing a last modified date of 4-2-2014. Here's the header:

Edit 2: Seems I didn't have a recent enough version. I downloaded the alpha 12 version of 2.7.0 and it has the mpn_mul_fft defined in gmp_h.in. I'll work on rebuilding the GPU-ECM and see it finds everything now.

Edit 3: The mpn_mul_fft unresolved symbols are taken care of. Now I've got
Code:
LNK2001: unresolved external symbol __gmp_bits_per_limb
This exists in the gmp.h that's being included, so I'm not sure what the issue is.

Last fiddled with by wombatman on 2015-06-06 at 17:39
wombatman is offline   Reply With Quote
Old 2015-06-07, 13:50   #329
Brian Gladman
 
Brian Gladman's Avatar
 
May 2008
Worcester, United Kingdom

22×7×19 Posts
Default

Quote:
Originally Posted by wombatman View Post
Will do, and I'll post again when I've had time to do it and see if it works. Thanks for the suggestions.

Edit: Just checked gmp_h.in from my MPIR 2.7.0 source folder, and it only has the "mpn_mul_fft_main" definition as posted above. The file is showing a last modified date of 4-2-2014. Here's the header:

Edit 2: Seems I didn't have a recent enough version. I downloaded the alpha 12 version of 2.7.0 and it has the mpn_mul_fft defined in gmp_h.in. I'll work on rebuilding the GPU-ECM and see it finds everything now.

Edit 3: The mpn_mul_fft unresolved symbols are taken care of. Now I've got
Code:
LNK2001: unresolved external symbol __gmp_bits_per_limb
This exists in the gmp.h that's being included, so I'm not sure what the issue is.
The symbol mp_bits_per_limb is redfined as __gmp_bits_per_limb and is supplied in the MPIR file mp_bpl.c The link failure is odd since I don't think this symbol is used by GMP-ECM anyway (maybe I am wrong about this). If It is used it should be possible to use GMP_LIMB_BITS instead.

Last fiddled with by Brian Gladman on 2015-06-07 at 13:59
Brian Gladman is offline   Reply With Quote
Old 2015-06-07, 15:58   #330
wombatman
I moo ablest echo power!
 
wombatman's Avatar
 
May 2013

13×137 Posts
Default

So to be clear, anywhere "mp_bits_per_limb" is used, I should try substituting GMP_LIMB_BITS? It looks like mp_bits_per_limb only shows up once.

Edit: Felt saucy, so I went ahead and changed the one line where mp_bits_per_limb shows up from
Code:
if (mp_bits_per_limb != GMP_NUMB_BITS)
to
Code:
if (GMP_LIMB_BITS != GMP_NUMB_BITS)
This allows it to compile, although it now needs mpir.dll to be present, which I don't remember needing before. Regardless, it also throws a c0000005 exception when trying to use test.gpuecm. Some progress, though!

Last fiddled with by wombatman on 2015-06-07 at 16:08
wombatman is offline   Reply With Quote
Reply

Thread Tools


Similar Threads
Thread Thread Starter Forum Replies Last Post
Running CUDA on non-Nvidia GPUs Rodrigo GPU Computing 3 2016-05-17 05:43
Error in GMP-ECM 6.4.3 and latest svn ATH GMP-ECM 10 2012-07-29 17:15
latest SVN 1677 ATH GMP-ECM 7 2012-01-07 18:34
Has anyone seen my latest treatise? davieddy Lounge 0 2011-01-21 19:29
Latest version? [CZ]Pegas Software 3 2002-08-23 17:05

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


Fri Aug 6 23:29:32 UTC 2021 up 14 days, 17:58, 1 user, load averages: 3.93, 3.86, 3.95

Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2021, 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.