mersenneforum.org  

Go Back   mersenneforum.org > Great Internet Mersenne Prime Search > Hardware > GPU Computing

Reply
 
Thread Tools
Old 2012-06-05, 18:57   #1387
flashjh
 
flashjh's Avatar
 
"Jerry"
Nov 2011
Vancouver, WA

1,123 Posts
Default CUDALucas 2.03 x64 Source

CUDALucas 2.03 x64 Source with updated makefile.win
Attached Files
File Type: zip CUDALucas2.03.src.zip (23.1 KB, 79 views)
flashjh is offline   Reply With Quote
Old 2012-06-05, 19:09   #1388
flashjh
 
flashjh's Avatar
 
"Jerry"
Nov 2011
Vancouver, WA

1,123 Posts
Default CUDALucas 2.03 x64 Binaries

CUDALucas 2.03 x64

This is for GTX 680 with CUDA 4.2 | sm_30. If someone has a 680, can you test this with other versions and let me know how it works?

Thanks
Attached Files
File Type: zip CUDALucas2.03.4.2x64.zip (84.2 KB, 76 views)
flashjh is offline   Reply With Quote
Old 2012-06-05, 19:09   #1389
ET_
Banned
 
ET_'s Avatar
 
"Luigi"
Aug 2002
Team Italia

2·3·11·73 Posts
Default

AFAICT, there is no diffrence in the math section between 2.01 and 2.03 (I'm on Linux)

Am I correct?

Luigi
ET_ is offline   Reply With Quote
Old 2012-06-05, 19:53   #1390
Redarm
 
Redarm's Avatar
 
Apr 2012
Berlin Germany

3·17 Posts
Default

Quote:
Originally Posted by flashjh View Post
CUDALucas 2.03 x64

This is for GTX 680 with CUDA 4.2 | sm_30. If someone has a 680, can you test this with other versions and let me know how it works?

Thanks
Code:
 
Continuing work from a partial result of M65xxxxxx fft length = 3670016 iteration = 280001
Iteration 290000 M( 65434657 )C, 0x32166eaa07042500, n = 3670016, CUDALucas v2.03 err = 0.1731 (1:07 real, 6.7
623 ms/iter, ETA 122:21:37)
Redarm is offline   Reply With Quote
Old 2012-06-05, 20:51   #1391
Dubslow
Basketry That Evening!
 
Dubslow's Avatar
 
"Bunslow the Bold"
Jun 2011
40<A<43 -89<O<-88

3×29×83 Posts
Default

Quote:
Originally Posted by ET_ View Post
AFAICT, there is no diffrence in the math section between 2.01 and 2.03 (I'm on Linux)

Am I correct?

Luigi
Yep
I'm so glad this works now.

Last fiddled with by Dubslow on 2012-06-05 at 21:33
Dubslow is offline   Reply With Quote
Old 2012-06-06, 13:00   #1392
kjaget
 
kjaget's Avatar
 
Jun 2005

3×43 Posts
Default

Quote:
Originally Posted by flashjh View Post
I still need /Tp for now
For this you have a choice. Either keep the /Tp in (no harm I can see) or you need to declare every function prototype called from cu files as extern "C" blah().

I think what's going on is this. .cu files end up being compiled as C++ files on Windows. Thus, when it sees a prototype it expects it to use C++ linkage & name mangling. But when you build .c files, MSVC assumes it's just regular C so the mangling and so on doesn't happen. That's why the missing function names at link time look like C++ mangled names - that's what they're being translated to in the .cu file.

But the short version is I don't see any harm in just building everything as C++ code using /Tp

Last fiddled with by kjaget on 2012-06-06 at 13:00
kjaget is offline   Reply With Quote
Old 2012-06-06, 16:27   #1393
LaurV
Romulan Interpreter
 
LaurV's Avatar
 
Jun 2011
Thailand

72·197 Posts
Default

Quote:
Originally Posted by Dubslow View Post
Yep
I'm so glad this works now.
Have anyone created a worktodo file with more then two exponents (lines)?
Something fake, which will finish very fast, like:

Code:
Test=N/A,150001,69,1
Test=N/A,150003,69,1
Test=N/A,150007,69,1
Test=N/A,150009,69,1
or simpler
Code:
Test=150001
Test=150003
Test=150007
Test=150009
Then run cl_2.03 on it?
After SECOND exponent finishes (17-20 seconds on gtx580), the file will look like
Code:
Test=150003Test=150007Test=150009
And a parsing error is issued. Something close to:
Code:
Warning: ignoring line 1: "Test=N/A,150003,69,1Test=N/A,150007,69,1Test=N/A,150009,69,1" in "worktodo_1.txt". Reason: invalid format.
No valid assignment found.
It seems like the CR/LF characters are lost...

Looking summarily into the source of parse.c, around the lines 473, 480, it does not seem that variable called "line" contains the "\n" character. One "\n" should be printed in "%s\n" format specifier... Or not?**

edit: and by the way, another 2 good residues with v2.02, making the score 4 to 0.

Code:
Processing result: M( 26299261 )C, 0x7a7f02229ab66f20, n = 1474560, CUDALucas v2.02 
LL test successfully completes double-check of M26299261 
Processing result: M( 26331001 )C, 0xfc7b1d44c505c281, n = 1474560, CUDALucas v2.02 
LL test successfully completes double-check of M26331001
I switched to 2.03 in this evening (half hour ago, another two expos ETA ~18h).

---------------
***(edit 2: I saw the ini file only has LF at the end of the lines, it occurs to me that \n in windows is in fact \r\n, that is a 0x0D followed by a 0x0A, or CR followed by LF. In linux seems like a LF is enough. If I deleted all 0x0A characters from the worktodo, using programmer's notepad (PN2), it then worked ok. This could be a real problem, as all worktodo files generated by gpu272 or primenet have CR+LF as eol terminators, and I don't see myself doing manual replacement all the time. PN2 and Eclipse have autoreplace, "set eol as LF only", but still need open the file and then save the file by hand... Now this made me curious how mfaktc deal with this, because there I never had any problem of such)

Last fiddled with by LaurV on 2012-06-06 at 17:07
LaurV is offline   Reply With Quote
Old 2012-06-06, 19:00   #1394
Batalov
 
Batalov's Avatar
 
"Serge"
Mar 2008
Phi(4,2^7658614+1)/2

2·47·101 Posts
Default

Oh, the usual CR/LF/\r\n thing. (Note that Mac's end-of-line is simply \r.)
A portable code(r) needs to know these things.
It's a good thing that this code is not widely used. ::
Makes it a good candidate for sandbox coding. ::razz again::

Seriously though! This project seems to have outgrown the ad hoc posting-and-tons-of-spaggetti-code stage. Pick a respectable admin (possibly the original author), start a git/svn repository, start real life tracking of bugs, rollbacks, code reviews. Just a suggestion. Of course you can continue doing what you are doing.
Batalov is offline   Reply With Quote
Old 2012-06-06, 19:11   #1395
ET_
Banned
 
ET_'s Avatar
 
"Luigi"
Aug 2002
Team Italia

10010110100102 Posts
Default

M( 26200729 )C, 0x02c4c8ac57869fae, n = 1572864, CUDALucas v2.01
M( 26227489 )C, 0x8e52cc33256a5bca, n = 1572864, CUDALucas v2.01

Both confirmed.

Luigi
ET_ is offline   Reply With Quote
Old 2012-06-06, 20:06   #1396
flashjh
 
flashjh's Avatar
 
"Jerry"
Nov 2011
Vancouver, WA

21438 Posts
Default Updated 2.03 x64 binaries

Quote:
Originally Posted by kjaget View Post
For this you have a choice. Either keep the /Tp in (no harm I can see) or you need to declare every function prototype called from cu files as extern "C" blah().

I think what's going on is this. .cu files end up being compiled as C++ files on Windows. Thus, when it sees a prototype it expects it to use C++ linkage & name mangling. But when you build .c files, MSVC assumes it's just regular C so the mangling and so on doesn't happen. That's why the missing function names at link time look like C++ mangled names - that's what they're being translated to in the .cu file.

But the short version is I don't see any harm in just building everything as C++ code using /Tp
I plan to fix it when I get more time

Quote:
Originally Posted by LaurV View Post
Have anyone created a worktodo file with more then two exponents (lines)?
Something fake, which will finish very fast, like:

Code:
Test=N/A,150001,69,1
Test=N/A,150003,69,1
Test=N/A,150007,69,1
Test=N/A,150009,69,1
or simpler
Code:
Test=150001
Test=150003
Test=150007
Test=150009
Then run cl_2.03 on it?
After SECOND exponent finishes (17-20 seconds on gtx580), the file will look like
Code:
Test=150003Test=150007Test=150009
And a parsing error is issued. Something close to:
Code:
Warning: ignoring line 1: "Test=N/A,150003,69,1Test=N/A,150007,69,1Test=N/A,150009,69,1" in "worktodo_1.txt". Reason: invalid format.
No valid assignment found.
It seems like the CR/LF characters are lost...

Looking summarily into the source of parse.c, around the lines 473, 480, it does not seem that variable called "line" contains the "\n" character. One "\n" should be printed in "%s\n" format specifier... Or not?**
You are correct. The \n is needed for Windows, but Linux will compile it correctly also. In Linux the file will contain a single LF to indicate the newline; under windows, it will contain a CRLF.

Attached updated 2.03 to correct error - tested, but please test again ;)

Quote:
Originally Posted by Batalov View Post
...

Seriously though! This project seems to have outgrown the ad hoc posting-and-tons-of-spaggetti-code stage. Pick a respectable admin (possibly the original author), start a git/svn repository, start real life tracking of bugs, rollbacks, code reviews. Just a suggestion. Of course you can continue doing what you are doing.
I agree. msft, dubslow, myself are all possible. I plan to be around for a while.

@Dubslow and msft, any ideas?

Attached file is .zip. Inside are all source files (with updated parse.c) and all CUDA builds. I used .7z (7-zip) because it compresses a lot better for the binaries. In the future, I'll use that if the files are too big (or until we move to a repository).

Included CUDALucas x64 binaries:

CUDA 3.2 | sm_13
CUDA 4.0 | sm_20
CUDA 4.0 | sm_21
CUDA 4.1 | sm_21
CUDA 4.2 | sm_30
Attached Files
File Type: zip CUDALucas2.03.x64.zip (153.5 KB, 79 views)

Last fiddled with by flashjh on 2012-06-06 at 20:49
flashjh is offline   Reply With Quote
Old 2012-06-06, 20:22   #1397
Dubslow
Basketry That Evening!
 
Dubslow's Avatar
 
"Bunslow the Bold"
Jun 2011
40<A<43 -89<O<-88

3·29·83 Posts
Default

Actually, '\n' as a format specifier guarantees that the proper line endings will be filled in by the compiler. gcc will literally do just '\n', whereas MSVC will use a literal '\r\n' whenever a '\n' is specified in print statements. The problem is, when you parse_worktodo_value() in line 432, one of the arguments is a pointer to a copy of the line; however, I changed that copy going from 2.02 to 2.03 to not include the '\n' because I wanted to be able to print the line-copy in warning messages without the newline, e.g. line 365
Code:
ignoring line %u: \"%s\" in \"%s\".
With a newline in the string, that message would look bad, so I removed it (lines 206-207) without realizing it was used in clear_assignment(). The solution is in fact to add a '\n' as LaurV suggested, and the compilers will take care of any platform specific line endings. (Furthermore, when a line is read in that ends with '\r\n', it is automatically converted to simply '\n' in memory, so any and all code only needs to bother with '\n's. Also Batalov, hasn't Apple switched from the '\r' a while ago? Edit: The Wiki article below says they switched after Mac OS 9.)

flash's fix is correct, however, considering my n00bosity, a SourceForge would be a good idea. msft, do you have any particular cares about setting one up?

http://en.wikipedia.org/wiki/Newline
Quote:
Originally Posted by Wikipedia/Newline
The C programming language provides the escape sequences '\n' (newline) and '\r' (carriage return). However, these are not required to be equivalent to the ASCII LF and CR control characters. The C standard only guarantees two things:

2. When writing a file in text mode, '\n' is transparently translated to the native newline sequence used by the system, which may be longer than one character. When reading in text mode, the native newline sequence is translated back to '\n'. In binary mode, no translation is performed, and the internal representation produced by '\n' is output directly.
Edit: I forgot the other big thread there

Regarding the C/C++ thing, kjaget is exactly right, and that's why #ifdef linux then all the functions are declared that way; the url in the comments of that section has basically the same explanation. I didn't realize that it only worked on Windows because it thought it was C++. Are there any dangers in our code where a C++ compiler would miscompile valid C? I know they're not entirely compatible, and that some incompatibilities exist, and therefore we should watch out for them.

Last fiddled with by Dubslow on 2012-06-06 at 20:41
Dubslow is offline   Reply With Quote
Reply

Thread Tools


Similar Threads
Thread Thread Starter Forum Replies Last Post
Don't DC/LL them with CudaLucas LaurV Data 131 2017-05-02 18:41
CUDALucas / cuFFT Performance on CUDA 7 / 7.5 / 8 Brain GPU Computing 13 2016-02-19 15:53
CUDALucas: which binary to use? Karl M Johnson GPU Computing 15 2015-10-13 04:44
settings for cudaLucas fairsky GPU Computing 11 2013-11-03 02:08
Trying to run CUDALucas on Windows 8 CP Rodrigo GPU Computing 12 2012-03-07 23:20

All times are UTC. The time now is 07:24.


Mon Aug 2 07:24:45 UTC 2021 up 10 days, 1:53, 0 users, load averages: 1.01, 1.17, 1.41

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.