mersenneforum.org

mersenneforum.org (https://www.mersenneforum.org/index.php)
-   Msieve (https://www.mersenneforum.org/forumdisplay.php?f=83)
-   -   MSieve 1.51 (GPU) compilation (https://www.mersenneforum.org/showthread.php?t=18176)

wombatman 2013-05-12 06:33

MSieve 1.51 (GPU) compilation
 
Would anyone be willing to compile the msieve151_gpu program for an AMD Phenom II X4? The current 32-bit Windows build throws an error, that when disassembled in Visual Studio, is related to pshufb, which apparently requires SSSE3. The Phenom II X4 doesn't have it and thus can't operate msieve151_gpu, even with a GTX 570.

wombatman 2013-05-12 19:34

Alternatively, if somebody is willing to help me with how to compile the CUDA-msieve from source on a Windows machine in Visual Studio 2010, I'd be more than willing to do it myself and share with everybody.

jasonp 2013-05-13 13:45

If you have MinGW, you can change the machine optimization flags in the makefile and build with 'make all WIN=1 CUDA=1 NO_ZLIB=1'.

Otherwise I can post a differently-optimized binary this evening somewhere.

wombatman 2013-05-13 21:40

Jason, if you feel like doing that tonight, that'd be wonderful. For my own edification, I will still download MinGW and compile it as you recommended with those flags. If it's successful and you haven't compiled it yourself yet, I'll be happy to share it with you with full details to be posted wherever is appropriate. Thanks again for your help.

wombatman 2013-05-14 02:39

[CODE]C:\Documents and Settings\Ben\Desktop\msieve151\msieve-1.51>mingw32-make all WIN
=1 CUDA=1 NO_ZLIB=1
process_begin: CreateProcess(NULL, svnversion ., ...) failed.
gcc -O3 -fomit-frame-pointer -march=core2 -D_FILE_OFFSET_BITS=64 -DNDEBUG -D_LAR
GEFILE64_SOURCE -Wall -W -DMSIEVE_SVN_VERSION="\"unknown\"" -I. -Iinclude -Ignf
s -Ignfs/poly -Ignfs/poly/stage1 -I"$CUDA_PATHinclude/" -Ib40c -DHAVE_CUDA -DNO_
ZLIB -c -o common/cuda_xface.o common/cuda_xface.c
In file included from common/cuda_xface.c:15:0:
include/cuda_xface.h:21:18: fatal error: cuda.h: No such file or directory
compilation terminated.
Makefile:283: recipe for target 'common/cuda_xface.o' failed
mingw32-make: *** [common/cuda_xface.o] Error 1[/CODE]

This is what I get when I try to compile as you suggested. I checked the CUDA_PATH and made sure it was pointing to the correct directory. I also went ahead and made sure that cuda.h was actually in the include directory, and it is. Any idea what might be causing this?


Also tried compiling zlib (no errors from that), and get the following when compiling without the NO_ZLIB flag:

[CODE]C:\Documents and Settings\Ben\Desktop\msieve151\msieve-1.51>mingw32-make all WIN
=1 CUDA=1
process_begin: CreateProcess(NULL, svnversion ., ...) failed.
gcc -O3 -fomit-frame-pointer -march=core2 -D_FILE_OFFSET_BITS=64 -DNDEBUG -D_LAR
GEFILE64_SOURCE -Wall -W -DMSIEVE_SVN_VERSION="\"unknown\"" -I. -Iinclude -Ignf
s -Ignfs/poly -Ignfs/poly/stage1 -I"$CUDA_PATHinclude" -Ib40c -DHAVE_CUDA -c -o
common/polyroot.o common/polyroot.c
In file included from include/msieve.h:24:0,
from include/common.h:18,
from include/polyroot.h:18,
from common/polyroot.c:15:
include/util.h:46:19: fatal error: zlib.h: No such file or directory
compilation terminated.
Makefile:283: recipe for target 'common/polyroot.o' failed
mingw32-make: *** [common/polyroot.o] Error 1[/CODE]

wombatman 2013-05-14 05:08

To eliminate one problem I found:

I changed [CODE]-march=core2[/CODE] to [CODE]-march=barcelona[/CODE] to match my Phenom II X4 955. However, I still see the same errors.


Edit: And to add another (probably related) problem:

[CODE]C:\Documents and Settings\Ben\Desktop\msieve151\msieve-1.51>mingw32-make all WIN
=1
process_begin: CreateProcess(NULL, svnversion ., ...) failed.
rm -f libmsieve.a
process_begin: CreateProcess(NULL, rm -f libmsieve.a, ...) failed.
make (e=2): The system cannot find the file specified.
Makefile:267: recipe for target 'all' failed
mingw32-make: *** [all] Error 2[/CODE]

This occurs when I run the make with just WIN=1.

jasonp 2013-05-14 10:36

It's possible you need to update your path to include the binary directory for Microsoft's compiler, since nvcc requires it. This isn't done automatically when Visual Studio is installed, you may need a special command prompt that has the compiler environment defined.

I couldn't get to it last night and today will be awful for me until the evening. Maybe somebody else who uses MinGW can help?

wombatman 2013-05-14 13:49

Jason, no worries. Although I haven't gotten it fixed yet, I'm learning a good bit. For you and anyone else who might read this, I have the following specs:

AMD Phenom II X4 955 (Barcelona)
Windows XP SP3 (32-bit)
GTX 570

If I can provide any other useful information, please don't hesitate to ask.


As for the Microsoft compiler, I added the \bin paths for both VS and the Microsoft SDKs to the system path and still get the same error
[CODE]C:\Documents and Settings\Ben\Desktop\msieve151\msieve-1.51>mingw32-make all WIN
=1
process_begin: CreateProcess(NULL, svnversion ., ...) failed.
rm -f libmsieve.a
process_begin: CreateProcess(NULL, rm -f libmsieve.a, ...) failed.
make (e=2): The system cannot find the file specified.
Makefile:267: recipe for target 'all' failed
mingw32-make: *** [all] Error 2[/CODE]

jasonp 2013-05-14 16:31

You can try 'make -k all ...' to force make to keep going in the face of errors. I think the problem here is that my home rig has subversion as a Cygwin package, whereas yours does not have subversion at all.

I guess I'm the only one around here who compiles windows binaries without using Microsoft's tools.

wombatman 2013-05-14 16:44

I'm at work now, but I'll try that when I get home. Funny enough, I tried installing subversion (with a Windows installer) and adding it to the Path. When I'm home, I'll add exactly what I've added, since it may not have been the correct directory.

Just wanted to say thanks for taking the time to address my questions, Jason. Your software is impressive, and it is getting even more so as I start to actually understand better what's going on.

wombatman 2013-05-15 00:50

Had a bit of a revelation concerning your latest instructions...I was trying to compile everything from a standard command line. So I hopped into MinGW's shell and ran the compile from there. It got much further, but I still hit a snag. The command was

[CODE] make all (-k) WIN=1 CUDA=1 NO_ZLIB=1[/CODE]

and I get (with or without the -k flag):

[CODE]gcc -O3 -fomit-frame-pointer -march=barcelona -D_FILE_OFFSET_BITS=64 -DNDEBUG -D
_LARGEFILE64_SOURCE -Wall -W -DMSIEVE_SVN_VERSION="\"1.51 GPU\"" -I. -Iinclude
-Ignfs -Ignfs/poly -Ignfs/poly/stage1 -I"C:\Program Files\NVIDIA GPU Computing T
oolkit\CUDA\v5.0\include" -Ib40c -DHAVE_CUDA -DNO_ZLIB demo.c -o msieve -Wl,--la
rge-address-aware \
libmsieve.a "C:\Program Files\NVIDIA GPU Computing Toolk
it\CUDA\v5.0\lib/win32/cuda.lib" -lgmp -lm -lpthread
libmsieve.a(stage1.no):stage1.c:(.text+0xdf4): undefined reference to `sieve_lat
tice_cpu'
collect2.exe: error: ld returned 1 exit status
make: *** [all] Error 1[/CODE]


On the plus side:

[CODE]make all WIN=1 NO_ZLIB=1[/CODE]

produces a working program! I'm currently crunching the 100 digit example number from Jeff Gilchrist's tutorial to make sure that it fully functions.


All times are UTC. The time now is 10:09.

Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2021, Jelsoft Enterprises Ltd.