![]() |
|
|
#1 |
|
Jan 2017
Glory to Arstotzka!
2·7 Posts |
Argh, so many issues, currently new to this... Currently running on a x64 Ubuntu box with an i7 and a GTX1060. First off, how does one set up/compile Msieve to work with the GPU? Can't find any good instructions on this. Secondly, around what size number does GPU processing actually make a difference?
|
|
|
|
|
|
#2 |
|
"Ed Hall"
Dec 2009
Adirondack Mtns
EE916 Posts |
Surprised there are no answers yet... I'll try:
First, you need to set up a working CUDA installation so the nVidia driver, nvcc compiler and paths are all working. It's best to install the samples and check that some of them run. The CUDA installation document should show all those steps. After you have all that running, then you can compile msieve with CUDA=1. msieve should automatically use the GPU during the poly select phase. Actually, it only uses it during one step of the phase, but there should be an immediate and noticeable advantage with any size composite. |
|
|
|
|
|
#3 | |
|
Jan 2017
Glory to Arstotzka!
11102 Posts |
Quote:
Code:
libmsieve.a(stage1.no): In function `poly_stage1_run': stage1.c:(.text+0xc01): undefined reference to `sieve_lattice_cpu' collect2: error: ld returned 1 exit status Makefile:273: recipe for target 'all' failed make: *** [all] Error 1 |
|
|
|
|
|
|
#4 |
|
Tribal Bullet
Oct 2004
3,541 Posts |
As EdH mentioned, you have to invoke the Msieve makefile with
make all CUDA=1 If you had previously built Msieve with CPU polynomial selection you first have to 'make clean'; the dependency tracking in the makefile cannot handle switching from CPU to GPU. Last fiddled with by jasonp on 2017-02-08 at 15:25 |
|
|
|
|
|
#5 |
|
Sep 2009
1000000111102 Posts |
Or unpack msieve's source into another directory and run "make all CUDA=1" in there. That way your existing copy of msieve will still be available for use if CUDA doesn't work for some reason (I've had a lot of "fun" getting msieve to work with CUDA).
Chris |
|
|
|
|
|
#6 |
|
Jan 2017
Glory to Arstotzka!
E16 Posts |
More problems! I did a make clean as suggested, fixed another path, and it got further in compilation, but now it's giving me this:
Code:
gcc -O3 -fomit-frame-pointer -march=native -D_FILE_OFFSET_BITS=64 -DNDEBUG -D_LARGEFILE64_SOURCE -Wall -W -DMSIEVE_SVN_VERSION="\"Unversioned directory\"" -I. -Iaprcl -Iinclude -Ignfs -Ignfs/poly -Ignfs/poly/stage1 -I"/home/lm978/cuda-8.0/include" -Icub -DHAVE_CUDA demo.c -o msieve \
libmsieve.a -ldl -lz -lgmp -lm -lpthread
demo.c: In function ‘get_random_seeds’:
demo.c:54:3: warning: ignoring return value of ‘fread’, declared with attribute warn_unused_result [-Wunused-result]
fread(&tmp_seed1, sizeof(uint32), (size_t)1, rand_device);
^
demo.c:55:3: warning: ignoring return value of ‘fread’, declared with attribute warn_unused_result [-Wunused-result]
fread(&tmp_seed2, sizeof(uint32), (size_t)1, rand_device);
^
demo.c: In function ‘main’:
demo.c:578:4: warning: ignoring return value of ‘fgets’, declared with attribute warn_unused_result [-Wunused-result]
fgets(buf, (int)sizeof(buf), stdin);
^
demo.c:598:4: warning: ignoring return value of ‘fgets’, declared with attribute warn_unused_result [-Wunused-result]
fgets(buf, (int)sizeof(buf), infile);
^
libmsieve.a(stage1_sieve_gpu.no): In function `gpu_thread_data_free':
stage1_sieve_gpu.c:(.text+0x42): undefined reference to `cuEventDestroy_v2'
stage1_sieve_gpu.c:(.text+0x56): undefined reference to `cuEventDestroy_v2'
stage1_sieve_gpu.c:(.text+0x6e): undefined reference to `cuMemFree_v2'
stage1_sieve_gpu.c:(.text+0x7f): undefined reference to `cuMemFree_v2'
stage1_sieve_gpu.c:(.text+0x90): undefined reference to `cuMemFree_v2'
stage1_sieve_gpu.c:(.text+0xa1): undefined reference to `cuMemFree_v2'
stage1_sieve_gpu.c:(.text+0xc4): undefined reference to `cuStreamDestroy_v2'
stage1_sieve_gpu.c:(.text+0xde): undefined reference to `cuMemFree_v2'
stage1_sieve_gpu.c:(.text+0x144): undefined reference to `cuMemFree_v2'
stage1_sieve_gpu.c:(.text+0x151): undefined reference to `cuMemFree_v2'
stage1_sieve_gpu.c:(.text+0x174): undefined reference to `cuMemFree_v2'
stage1_sieve_gpu.c:(.text+0x195): undefined reference to `cuCtxDestroy_v2'
libmsieve.a(stage1_sieve_gpu.no): In function `store_p_soa':
stage1_sieve_gpu.c:(.text+0x461): undefined reference to `cuMemFree_v2'
stage1_sieve_gpu.c:(.text+0x473): undefined reference to `cuMemFree_v2'
stage1_sieve_gpu.c:(.text+0x48e): undefined reference to `cuMemAlloc_v2'
stage1_sieve_gpu.c:(.text+0x4aa): undefined reference to `cuMemAlloc_v2'
libmsieve.a(stage1_sieve_gpu.no): In function `store_specialq':
stage1_sieve_gpu.c:(.text+0x628): undefined reference to `cuMemFree_v2'
stage1_sieve_gpu.c:(.text+0x641): undefined reference to `cuMemAlloc_v2'
libmsieve.a(stage1_sieve_gpu.no): In function `gpu_thread_data_init':
stage1_sieve_gpu.c:(.text+0x6d2): undefined reference to `cuCtxCreate_v2'
stage1_sieve_gpu.c:(.text+0x70f): undefined reference to `cuModuleLoad'
stage1_sieve_gpu.c:(.text+0x7ba): undefined reference to `cuStreamCreate'
stage1_sieve_gpu.c:(.text+0x7d0): undefined reference to `cuMemAlloc_v2'
stage1_sieve_gpu.c:(.text+0x7ff): undefined reference to `cuMemsetD8_v2'
stage1_sieve_gpu.c:(.text+0x91b): undefined reference to `cuMemAlloc_v2'
stage1_sieve_gpu.c:(.text+0x938): undefined reference to `cuMemAlloc_v2'
stage1_sieve_gpu.c:(.text+0x999): undefined reference to `cuMemAlloc_v2'
stage1_sieve_gpu.c:(.text+0x9df): undefined reference to `cuMemAlloc_v2'
stage1_sieve_gpu.c:(.text+0x9f3): undefined reference to `cuMemAlloc_v2'
libmsieve.a(stage1_sieve_gpu.no):stage1_sieve_gpu.c:(.text+0xa09): more undefined references to `cuMemAlloc_v2' follow
libmsieve.a(stage1_sieve_gpu.no): In function `gpu_thread_data_init':
stage1_sieve_gpu.c:(.text+0xa42): undefined reference to `cuEventCreate'
stage1_sieve_gpu.c:(.text+0xa5b): undefined reference to `cuEventCreate'
stage1_sieve_gpu.c:(.text+0xaf5): undefined reference to `cuModuleLoad'
stage1_sieve_gpu.c:(.text+0xb7f): undefined reference to `cuModuleLoad'
stage1_sieve_gpu.c:(.text+0xbaa): undefined reference to `cuModuleLoad'
stage1_sieve_gpu.c:(.text+0xc84): undefined reference to `cuFuncSetBlockShape'
libmsieve.a(stage1_sieve_gpu.no): In function `task_data_run':
stage1_sieve_gpu.c:(.text+0x1176): undefined reference to `cuMemcpyHtoDAsync_v2'
stage1_sieve_gpu.c:(.text+0x1196): undefined reference to `cuMemcpyHtoDAsync_v2'
stage1_sieve_gpu.c:(.text+0x1469): undefined reference to `cuEventRecord'
stage1_sieve_gpu.c:(.text+0x149e): undefined reference to `cuMemcpyHtoDAsync_v2'
stage1_sieve_gpu.c:(.text+0x14c8): undefined reference to `cuMemsetD8Async'
stage1_sieve_gpu.c:(.text+0x1731): undefined reference to `cuFuncSetBlockShape'
stage1_sieve_gpu.c:(.text+0x1758): undefined reference to `cuLaunchGridAsync'
stage1_sieve_gpu.c:(.text+0x18e1): undefined reference to `cuLaunchGridAsync'
stage1_sieve_gpu.c:(.text+0x18f9): undefined reference to `cuEventRecord'
stage1_sieve_gpu.c:(.text+0x190d): undefined reference to `cuEventSynchronize'
stage1_sieve_gpu.c:(.text+0x1930): undefined reference to `cuEventElapsedTime'
stage1_sieve_gpu.c:(.text+0x199c): undefined reference to `cuMemcpyDtoHAsync_v2'
stage1_sieve_gpu.c:(.text+0x19ad): undefined reference to `cuStreamSynchronize'
stage1_sieve_gpu.c:(.text+0x1b21): undefined reference to `cuMemsetD8Async'
stage1_sieve_gpu.c:(.text+0x215d): undefined reference to `cuMemFree_v2'
stage1_sieve_gpu.c:(.text+0x217f): undefined reference to `cuMemAlloc_v2'
libmsieve.a(cuda_xface.o): In function `gpu_init':
cuda_xface.c:(.text+0x246): undefined reference to `cuInit'
cuda_xface.c:(.text+0x256): undefined reference to `cuDeviceGetCount'
cuda_xface.c:(.text+0x280): undefined reference to `cuDeviceGet'
cuda_xface.c:(.text+0x29d): undefined reference to `cuDeviceGetName'
cuda_xface.c:(.text+0x2b6): undefined reference to `cuDeviceComputeCapability'
cuda_xface.c:(.text+0x2cc): undefined reference to `cuDeviceGetProperties'
cuda_xface.c:(.text+0x335): undefined reference to `cuDeviceTotalMem_v2'
cuda_xface.c:(.text+0x34f): undefined reference to `cuDeviceGetAttribute'
cuda_xface.c:(.text+0x369): undefined reference to `cuDeviceGetAttribute'
cuda_xface.c:(.text+0x37e): undefined reference to `cuDeviceGetAttribute'
libmsieve.a(cuda_xface.o): In function `gpu_launch_init':
cuda_xface.c:(.text+0x4b6): undefined reference to `cuModuleGetFunction'
cuda_xface.c:(.text+0x4cc): undefined reference to `cuFuncGetAttribute'
cuda_xface.c:(.text+0x564): undefined reference to `cuParamSetSize'
libmsieve.a(cuda_xface.o): In function `gpu_launch_set':
cuda_xface.c:(.text+0x637): undefined reference to `cuParamSetv'
cuda_xface.c:(.text+0x687): undefined reference to `cuParamSetv'
cuda_xface.c:(.text+0x6ca): undefined reference to `cuParamSeti'
cuda_xface.c:(.text+0x6fa): undefined reference to `cuParamSeti'
cuda_xface.c:(.text+0x737): undefined reference to `cuParamSetv'
collect2: error: ld returned 1 exit status
Makefile:273: recipe for target 'all' failed
make: *** [all] Error 1
|
|
|
|
|
|
#7 |
|
Tribal Bullet
Oct 2004
3,541 Posts |
Running make with CUDA=1 should have included '-lcuda' on the link line for the Msieve demo, per line 64 in the version of Makefile on sourceforge. That should be enough, the GPU code compiled into the C source uses only the Nvidia driver API.
The makefile for the sort engine uses nvcc throughout, which links in the Nvidia C++ interface automatically. Last fiddled with by jasonp on 2017-02-09 at 04:30 |
|
|
|
![]() |
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Msieve with GPU support | jasonp | Msieve | 223 | 2011-03-11 19:30 |
| Problem compiling msieve with gcc 4.4.2 | chris2be8 | Msieve | 5 | 2010-02-22 18:35 |
| Msieve with GNFS support | R.D. Silverman | Msieve | 465 | 2010-01-11 20:59 |
| Error compiling msieve | Wishper | Msieve | 2 | 2009-12-09 01:31 |
| Compiling Msieve 1.39 on Windows | Jeff Gilchrist | Msieve | 20 | 2009-02-21 22:43 |