mersenneforum.org  

Go Back   mersenneforum.org > Factoring Projects > Msieve

Reply
 
Thread Tools
Old 2020-01-09, 16:16   #1
mathwiz
 
Mar 2019

2×3×17 Posts
Default compiling msieve w/ latest CUDA?

On an Ubuntu 18.04 system with the latest msieve checked out from SVN, and CUDA 10, I get a bunch of build errors, e.g.

Code:
nvcc fatal   : Value 'sm_20' is not defined for option 'gpu-architecture'
Even after removing stage1_core_sm20.ptx from the top-level Makefile, I get more errors in the cub/ subdirectory.

Has anyone recently built msieve w/ CUDA on a recent Ubuntu system with CUDA 10? Or suggestions on how to fix up the various Makefiles to build?
mathwiz is online now   Reply With Quote
Old 2020-01-10, 02:32   #2
jasonp
Tribal Bullet
 
jasonp's Avatar
 
Oct 2004

DA116 Posts
Default

Compute capability 2.0 is not supported in latter-day versions of CUDA (9.1 and up I think). You also need to change the CUB compile line near the bottom of the Msieve makefile to remove the '200' from the 'sm=...' compile argument.

There may also be trouble with the paths to CUDA binaries and libs, my experience is that the layout of the CUDA install directories occasionally changes.
jasonp is offline   Reply With Quote
Old 2020-01-11, 15:39   #3
EdH
 
EdH's Avatar
 
"Ed Hall"
Dec 2009
Adirondack Mtns

338410 Posts
Default

I'm trying to get a CUDA build running in Colab. I think I've removed all the 2.0 references, but I have the following error:
Code:
"/usr/local/cuda/bin/nvcc" -arch sm_30 -ptx -o stage1_core_sm30.ptx gnfs/poly/stage1/stage1_core_gpu/stage1_core.cu
"/usr/local/cuda/bin/nvcc" -arch sm_35 -ptx -o stage1_core_sm35.ptx gnfs/poly/stage1/stage1_core_gpu/stage1_core.cu
"/usr/local/cuda/bin/nvcc" -arch sm_50 -ptx -o stage1_core_sm50.ptx gnfs/poly/stage1/stage1_core_gpu/stage1_core.cu
cd cub && make WIN=0 WIN64=0 sm=300,350,520 && cd ..
make[1]: Entering directory '/content/msieve/cub'
"/usr/local/cuda/bin/nvcc" -gencode=arch=compute_52,code=\"sm_52,compute_52\"  -gencode=arch=compute_35,code=\"sm_35,compute_35\"  -gencode=arch=compute_30,code=\"sm_30,compute_30\" -DSM520 -DSM350 -DSM300 -o sort_engine.so sort_engine.cu -Xptxas -v -Xcudafe -# -shared -Xptxas -abi=no -Xcompiler -fPIC -Xcompiler -fvisibility=hidden -I"/usr/local/cuda/bin/..//include" -I. -O3  
Front end time                       0.76 (CPU)       1.00 (elapsed)
Back end time                        0.04 (CPU)       0.00 (elapsed)
Total compilation time               0.81 (CPU)       1.00 (elapsed)
Front end time                       0.99 (CPU)       1.00 (elapsed)
Back end time                        0.06 (CPU)       0.00 (elapsed)
Total compilation time               1.07 (CPU)       1.00 (elapsed)
ptxas error   : Invalid value 'no' for option -abi.
ptxas fatal   : Ptx assembly aborted due to errors
Makefile:75: recipe for target 'sort_engine.so' failed
make[1]: *** [sort_engine.so] Error 255
make[1]: Leaving directory '/content/msieve/cub'
Makefile:347: recipe for target 'cub/built' failed
make: *** [cub/built] Error 2
Thoughts?
EdH is offline   Reply With Quote
Old 2020-01-11, 16:46   #4
chris2be8
 
chris2be8's Avatar
 
Sep 2009

5×383 Posts
Default

On my newest system I got it running with:
Code:
chris@sirius:~$ diff msieve.1030/trunk/Makefile msieve.1030.cuda/trunk/Makefile 
198a199
> #	stage1_core_sm20.ptx 
200d200
< 	stage1_core_sm20.ptx \
337,338c337,338
< stage1_core_sm20.ptx: $(NFS_GPU_HDR)
< 	$(NVCC) -arch sm_20 -ptx -o $@ $<
---
> #stage1_core_sm20.ptx: $(NFS_GPU_HDR)
> #	$(NVCC) -arch sm_20 -ptx -o $@ $<
350c350
< 	cd cub && make WIN=$(WIN) WIN64=$(WIN64) sm=200,300,350,520 && cd ..
---
> 	cd cub && make WIN=$(WIN) WIN64=$(WIN64) sm=300,350,520 && cd ..
Code:
chris@sirius:~$ diff msieve.1030/trunk/cub/Makefile msieve.1030.cuda/trunk/cub/Makefile 
19c19
< 	NVCCFLAGS += -Xptxas -v -Xcudafe -\# -shared -Xptxas -abi=no \
---
> 	NVCCFLAGS += -Xptxas -v -Xcudafe -\# -shared \
45,52d44
< endif
< ifeq (210, $(findstring 210, $(SM_ARCH)))
<     SM_TARGETS 	+= -gencode=arch=compute_20,code=\"sm_21,compute_20\"
<     SM_DEF 		+= -DSM210
< endif
< ifeq (200, $(findstring 200, $(SM_ARCH)))
<     SM_TARGETS 	+= -gencode=arch=compute_20,code=\"sm_20,compute_20\"
<     SM_DEF 		+= -DSM200
Chris
chris2be8 is offline   Reply With Quote
Old 2020-01-12, 16:47   #5
chris2be8
 
chris2be8's Avatar
 
Sep 2009

35738 Posts
Default

The thing you need to do is remove -Xptxas -abi=no from NVCCFLAGS. -Xptxas tells nvcc that the parameter following it is to be passed to ptxas. Similarly -Xcompiler for parameters passed to the C compiler. So if you just remove -abi=no nvcc will take the next parameter, -Xcompiler, as to be passed to ptxas, then complain about -fPIC. This took me a while to figure out (eventually finding and reading the right manual cracked it).

I hope this saves someone a bit of puzzling.

Chris
chris2be8 is offline   Reply With Quote
Reply

Thread Tools


Similar Threads
Thread Thread Starter Forum Replies Last Post
ECM for CUDA GPUs in latest GMP-ECM ? Karl M Johnson GMP-ECM 502 2020-10-14 14:21
Compiling Msieve with CUDA support VictordeHolland Msieve 10 2018-10-27 12:54
Latest msieve - GPU for LA? david314 Msieve 1 2013-07-01 16:45
Problem compiling latest SVN ATH GMP-ECM 2 2011-06-23 07:27
Compiling CUDA programs on VS 2010 Express ET_ GPU Computing 9 2011-03-24 10:11

All times are UTC. The time now is 04:03.

Wed Oct 28 04:03:10 UTC 2020 up 48 days, 1:14, 2 users, load averages: 2.45, 2.06, 1.87

Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2020, 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.