mersenneforum.org  

Go Back   mersenneforum.org > Great Internet Mersenne Prime Search > Software

Reply
 
Thread Tools
Old 2010-09-25, 19:34   #1
fivemack
(loop (#_fork))
 
fivemack's Avatar
 
Feb 2006
Cambridge, England

22×32×179 Posts
Default trouble building cudpp

So, I'm looking for points on the quartic surfaces a^4+b^4+c^4=Nd^4

( for example, N=227 I have the point {861:1825:2059:601} )

On CPU, I do this by:
loop over residue classes R modulo some P
for a=0..P, find b with a^4+b^4==R (P) and store them in a hash table indexed by (a^4+b^4) modulo some other Q
for c=0..P, find d with N*c^4-d^4==R (P); look up (N*c^4-d^4) mod Q in the hash table, and if there's a match then output [a b c d].

Which is fine; running up to 10^6 takes about a CPU-week.

Obviously, with a hash table, this isn't terribly suited to a CUDA implementation - I'm not at all sure how you do a linked-list with CUDA without ending up with all the threads contending horribly on the next-place-to-allocate pointer - so I'm contemplating writing out the {(a^4+b^4)%Q,a,b} tuples with a^4+b^4==R (P) and explicitly sorting them. cudpp exists and contains a couple of sort implementations.

But I can't compile it: the instructions are straightforward, but when I do 'cd cudpp; make' I get lots of messages which I very much don't understand, of the form

Code:
/usr/include/bits/mathcalls.h:350: error: inline function ‘int __signbit(double)’ cannot be declared weak
which feels as if nvcc is using the system C libraries and that they're incompatible with it. If I google for the error message, the only advice I see is 'install an older version of ubuntu', which doesn't exactly appeal.

Last fiddled with by fivemack on 2010-09-25 at 19:36
fivemack is offline   Reply With Quote
Old 2010-09-25, 20:01   #2
frmky
 
frmky's Avatar
 
Jul 2003
So Cal

32×13×19 Posts
Default

nvcc uses the system gcc/g++ but doesn't yet support version 4.4. Presuming that you are using Ubuntu, you can

sudo apt-get install gcc-4.3 g++-4.3

and you can then use gcc-4.3 rather than gcc, and use the --compiler-bindir option. Perhaps more simply you can use update-alternatives to switch system compilers. Install the options with the commands

sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-4.3 40 --slave /usr/bin/g++ g++ /usr/bin/g++-4.3
sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-4.4 60 --slave /usr/bin/g++ g++ /usr/bin/g++-4.4

then switch between them using

sudo update-alternatives --config gcc
frmky is offline   Reply With Quote
Old 2010-09-25, 20:13   #3
fivemack
(loop (#_fork))
 
fivemack's Avatar
 
Feb 2006
Cambridge, England

22×32×179 Posts
Default

Thanks! I'd tried setting CC=gcc-4.3 in common.mk but that wasn't enough because NVCC doesn't call $(CC); setting

NVCC := nvcc --compiler-bindir /home/nfsslave2/gcc43
and doing 'ln -s /usr/bin/gcc-4.3 /home/nfsslave2/gcc43/gcc' (as suggested by http://www.linux.com/news/software/d...ers-on-the-gpu) makes it all compile nicely. If slowly.

Last fiddled with by fivemack on 2010-09-25 at 20:15
fivemack is offline   Reply With Quote
Old 2010-09-25, 20:37   #4
fivemack
(loop (#_fork))
 
fivemack's Avatar
 
Feb 2006
Cambridge, England

22×32×179 Posts
Default

Is it a good sign if running the cudpp examples makes the power supply capacitors on my GPU play a little tune?
fivemack is offline   Reply With Quote
Old 2010-09-25, 21:34   #5
Karl M Johnson
 
Karl M Johnson's Avatar
 
Mar 2010

1100110112 Posts
Default

Quote:
Originally Posted by fivemack View Post
Is it a good sign if running the cudpp examples makes the power supply capacitors on my GPU play a little tune?
No, but it's not a bad one either.
D'you have GTX 285 ?
They have a funny problem with singin' cards.

Last fiddled with by Karl M Johnson on 2010-09-25 at 21:35 Reason: yes
Karl M Johnson is offline   Reply With Quote
Old 2010-09-26, 03:09   #6
schickel
 
schickel's Avatar
 
"Frank <^>"
Dec 2004
CDP Janesville

2·1,061 Posts
Default

Quote:
Originally Posted by fivemack View Post
Is it a good sign if running the cudpp examples makes the power supply capacitors on my GPU play a little tune?
Does it sound anything like this?
schickel is offline   Reply With Quote
Old 2010-09-26, 03:14   #7
jasonp
Tribal Bullet
 
jasonp's Avatar
 
Oct 2004

3·1,181 Posts
Default

Quote:
Originally Posted by fivemack View Post
Is it a good sign if running the cudpp examples makes the power supply capacitors on my GPU play a little tune?
The alpha that I used to learn software pipelining would emit a very high-pitched tone when optimized code was pounding on memory. It's a sign you're doing well :)
jasonp is offline   Reply With Quote
Reply

Thread Tools


Similar Threads
Thread Thread Starter Forum Replies Last Post
Help building GMP for prime95 29.3 Prime95 Linux 16 2017-08-29 18:02
Building sr1sieve for RPi wombatman Software 14 2017-03-04 16:21
Building MSieve without VS? SWSaunders Msieve 3 2013-04-26 11:19
Building gcc 4.4.0 CRGreathouse Software 1 2009-07-07 22:25
Building on Linux? FenwayFrank Software 4 2002-10-20 21:59

All times are UTC. The time now is 18:54.


Wed Dec 1 18:54:02 UTC 2021 up 131 days, 13:23, 1 user, load averages: 1.47, 1.35, 1.33

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.