mersenneforum.org  

Go Back   mersenneforum.org > Factoring Projects > Operazione Doppi Mersennes

Reply
 
Thread Tools
Old 2012-11-17, 19:33   #276
flashjh
 
flashjh's Avatar
 
"Jerry"
Nov 2011
Vancouver, WA

112310 Posts
Default

Quote:
Originally Posted by MattcAnderson View Post
Hi All,
I finally got mmff going on my GPU. The error I had was cudart64_42_9.dll needed. from post # 185 of this thread, I found mmff v 23 with cuda 5.0, which seems to work. This seemed to solve my problem, but the windows 64 download from doublemersenne.org did not. I think this is because it has cuda 4.2. I guess my system requires cuda 5.0 and won't work with cuda 4.2.

Regards,
Matt
CUDA 4.2 version requires the 42 dll files here. Just put them in the mmff directory.
flashjh is offline   Reply With Quote
Old 2012-12-04, 17:54   #277
ET_
Banned
 
ET_'s Avatar
 
"Luigi"
Aug 2002
Team Italia

481510 Posts
Angry mmff doesn't compile...

Ubuntu 11.10 - Linux64, CUDA drivers 5.0, CUDA runtime version 4.1

Code:
uigi@luigi-ubuntu:~$ gcc -v
Using built-in specs.
COLLECT_GCC=gcc
COLLECT_LTO_WRAPPER=/usr/lib/gcc/x86_64-linux-gnu/4.6.1/lto-wrapper
Target: x86_64-linux-gnu
Configured with: ../src/configure -v --with-pkgversion='Ubuntu/Linaro 4.6.1-9ubuntu3' --with-bugurl=file:///usr/share/doc/gcc-4.6/README.Bugs --enable-languages=c,c++,fortran,objc,obj-c++,go --prefix=/usr --program-suffix=-4.6 --enable-shared --enable-linker-build-id --with-system-zlib --libexecdir=/usr/lib --without-included-gettext --enable-threads=posix --with-gxx-include-dir=/usr/include/c++/4.6 --libdir=/usr/lib --enable-nls --with-sysroot=/ --enable-clocale=gnu --enable-libstdcxx-debug --enable-libstdcxx-time=yes --enable-plugin --enable-objc-gc --disable-werror --with-arch-32=i686 --with-tune=generic --enable-checking=release --build=x86_64-linux-gnu --host=x86_64-linux-gnu --target=x86_64-linux-gnu
Thread model: posix
gcc version 4.6.1 (Ubuntu/Linaro 4.6.1-9ubuntu3)

As mmff 0.26 binary is compiled with CUDA runtime version 4.2, I couldn't run it out of the box, and tried recompiling it, but...

I had problems trying to compile mmff It seems that some classical C math functions don't link correctly, even moving the -lm switch on the Makefile at the beginning of the line.

In any case, I am appending the compile log, hoping that someone of good will will throw an eye on it...

Thank you anyway.

Luigi
Attached Files
File Type: zip compile.log.zip (1.8 KB, 102 views)

Last fiddled with by ET_ on 2012-12-04 at 17:56
ET_ is offline   Reply With Quote
Old 2012-12-04, 18:07   #278
akruppa
 
akruppa's Avatar
 
"Nancy"
Aug 2002
Alexandria

2,467 Posts
Default

The GNU linker by default processes object files and libraries in the order as they are specified on the command line, remembers which unresolved references there are from each file it processes, and tries to resolve those references with symbols in object files and libraries that follow. This means putting -lm at the start of the command line has no effect: there are no unsatisfied references to math library functions at that point, and the unresolved references to libm from later files never get resolved because no -lm follows them.

Put -lm at the end, and generally a object/library file which contains functions that another file Y needs after the file Y. If you have circular dependencies, you can use some command line switch (forgot which) to make gnu ld re-scan the objects on the command line until all symbols are resolved, but you rarely need that.
akruppa is offline   Reply With Quote
Old 2012-12-04, 18:26   #279
ET_
Banned
 
ET_'s Avatar
 
"Luigi"
Aug 2002
Team Italia

32×5×107 Posts
Default

Quote:
Originally Posted by akruppa View Post
The GNU linker by default processes object files and libraries in the order as they are specified on the command line, remembers which unresolved references there are from each file it processes, and tries to resolve those references with symbols in object files and libraries that follow. This means putting -lm at the start of the command line has no effect: there are no unsatisfied references to math library functions at that point, and the unresolved references to libm from later files never get resolved because no -lm follows them.

Put -lm at the end, and generally a object/library file which contains functions that another file Y needs after the file Y. If you have circular dependencies, you can use some command line switch (forgot which) to make gnu ld re-scan the objects on the command line until all symbols are resolved, but you rarely need that.
Thank you Alex.

Update: I tried a make clean followed by a make all (I forgot the "all" thingie... )

result:
Code:
nvcc fatal   : Unsupported gpu architecture 'compute_30'
So I just cancelled the portion that said

Code:
--generate-code arch=compute_30,code=sm_30
as I successfully did for mfaktc.

result:
Code:
#error -- unsupported GNU version! gcc 4.6 and up are not supported!
Question:

Does runtime version 5.0 correct this error, or I have to try some fancy link and download an older version of GCC?

Luigi

Last fiddled with by ET_ on 2012-12-04 at 18:27
ET_ is offline   Reply With Quote
Old 2012-12-04, 18:30   #280
Batalov
 
Batalov's Avatar
 
"Serge"
Mar 2008
Phi(4,2^7658614+1)/2

36·13 Posts
Default

Quote:
Originally Posted by ET_ View Post
Question:

Does runtime version 5.0 correct this error, or I have to try some fancy link and download an older version of GCC?

Luigi
Good question. The answer is no.

Find this file and edit __GNUC_MINOR__ > 6 into __GNUC_MINOR__ > 9
Code:
/usr/local/cuda/include/host_config.h:
#if __GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ > 9)
Batalov is offline   Reply With Quote
Old 2012-12-04, 18:44   #281
ET_
Banned
 
ET_'s Avatar
 
"Luigi"
Aug 2002
Team Italia

32×5×107 Posts
Default

Quote:
Originally Posted by Batalov View Post
Good question. The answer is no.

Find this file and edit __GNUC_MINOR__ > 6 into __GNUC_MINOR__ > 9
Code:
/usr/local/cuda/include/host_config.h:
#if __GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ > 9)
It went farther, compiled the ptxtras (there is a __f variable set and unised), but still complains for the math functions.

Log appended.

There is a request to restart the system, maybe a pending update; I will tell you if after the reboot something changes.

Thank you Serge.

Luigi
Attached Files
File Type: zip compile.log.zip (3.9 KB, 108 views)
ET_ is offline   Reply With Quote
Old 2012-12-04, 18:50   #282
akruppa
 
akruppa's Avatar
 
"Nancy"
Aug 2002
Alexandria

1001101000112 Posts
Default

Code:
gcc -fPIC -L/usr/local/cuda/lib64/ -lcudart -lm timer.o parse.o read_config.o mfaktc.o checkpoint.o signal_handler.o output.o tf_barrett96_gs.o gpusieve.o -o ../mmff.exe
akruppa is offline   Reply With Quote
Old 2012-12-04, 19:22   #283
ET_
Banned
 
ET_'s Avatar
 
"Luigi"
Aug 2002
Team Italia

32·5·107 Posts
Default

Quote:
Originally Posted by akruppa View Post
Code:
gcc -fPIC -L/usr/local/cuda/lib64/ -lcudart -lm timer.o parse.o read_config.o mfaktc.o checkpoint.o signal_handler.o output.o tf_barrett96_gs.o gpusieve.o -o ../mmff.exe
That's the line come from George's Makefile.

Should I modify it?

Luigi

Last fiddled with by ET_ on 2012-12-04 at 19:23
ET_ is offline   Reply With Quote
Old 2012-12-04, 19:38   #284
frmky
 
frmky's Avatar
 
Jul 2003
So Cal

2·34·13 Posts
Default

Newer versions of gcc no longer support putting the libraries at the beginning. Try

Code:
gcc -fPIC -L/usr/local/cuda/lib64/ -o ../mmff.exe timer.o parse.o read_config.o mfaktc.o checkpoint.o signal_handler.o output.o tf_barrett96_gs.o gpusieve.o -lcudart -lm
frmky is online now   Reply With Quote
Old 2012-12-04, 19:41   #285
akruppa
 
akruppa's Avatar
 
"Nancy"
Aug 2002
Alexandria

2,467 Posts
Default

I just checked what I did on our work machine to make it compile:
Code:
kruppaal@quiche:~/mmff$ diff src/Makefile src.my/Makefile
14c14
< NVCCFLAGS += --generate-code arch=compute_20,code=sm_20 --generate-code arch=compute_30,code=sm_30
---
> NVCCFLAGS += --generate-code arch=compute_20,code=sm_20 # --generate-code arch=compute_30,code=sm_30
16c16
< NVCCFLAGS += --compiler-options=-Wall
---
> NVCCFLAGS += --compiler-options="-Wall -B/usr/lib/gcc/x86_64-linux-gnu/4.5.3/"
20c20,21
< LDFLAGS = -fPIC $(CUDA_LIB) -lcudart -lm
---
> LDFLAGS = -fPIC $(CUDA_LIB)
> MMFFLIB = -lcudart -lm
35c36
<       $(LD) $(LDFLAGS) $^ -o $@
---
>       $(LD) $(LDFLAGS) $^ $(MMFFLIB) -o $@
The -B/usr/lib/gcc/x86_64-linux-gnu/4.5.3/ is an override because 4.6 is the default gcc, but 4.5.3 is installed as well; with this option, nvcc uses the 4.5.3 version and stops complaining.
akruppa is offline   Reply With Quote
Old 2012-12-04, 19:58   #286
ET_
Banned
 
ET_'s Avatar
 
"Luigi"
Aug 2002
Team Italia

32×5×107 Posts
Default

Thank you Greg, your line worked great!

Alex, now I found an old Makefile from the project GPU-ECM:

Code:
# CUDA does not support gcc >= 4.6
# this can be useful if your default gcc is >= 4.6
# if not just comment the following two lines.
#CC_BIN:=/tmp/gcc45
#USE_THIS_CC:=--compiler-bindir $(CC_BIN)
I totally forgot about it, but you were right: you (and I) had a lower version of GCC at that time. Thank you for yur last mssge, you gave me the clue to remember where I saw that message.

It's time to reserve some exponent... My mmff is already doing its selftest.

Thanks again!

Luigi
ET_ is offline   Reply With Quote
Reply



Similar Threads
Thread Thread Starter Forum Replies Last Post
Mersenne trial division implementation mathPuzzles Math 8 2017-04-21 07:21
trial division over a factor base Peter Hackman Factoring 7 2009-10-26 18:27
P95 trial division strategy SPWorley Math 8 2009-08-24 23:26
Trial division software for Mersenne SPWorley Factoring 7 2009-08-16 00:23
Need GMP trial-division timings ewmayer Factoring 7 2008-12-11 22:12

All times are UTC. The time now is 00:38.


Sat Jul 17 00:38:31 UTC 2021 up 49 days, 22:25, 1 user, load averages: 1.07, 1.08, 1.24

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.