Go Back > Factoring Projects > Msieve

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

2178 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.

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 offline   Reply With Quote
Old 2020-01-10, 02:32   #2
Tribal Bullet
jasonp's Avatar
Oct 2004

2·3·19·31 Posts

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 online now   Reply With Quote
Old 2020-01-11, 15:39   #3
EdH's Avatar
"Ed Hall"
Dec 2009
Adirondack Mtns

3,527 Posts

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:
"/usr/local/cuda/bin/nvcc" -arch sm_30 -ptx -o stage1_core_sm30.ptx gnfs/poly/stage1/stage1_core_gpu/
"/usr/local/cuda/bin/nvcc" -arch sm_35 -ptx -o stage1_core_sm35.ptx gnfs/poly/stage1/stage1_core_gpu/
"/usr/local/cuda/bin/nvcc" -arch sm_50 -ptx -o stage1_core_sm50.ptx gnfs/poly/stage1/stage1_core_gpu/
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 -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 '' failed
make[1]: *** [] Error 255
make[1]: Leaving directory '/content/msieve/cub'
Makefile:347: recipe for target 'cub/built' failed
make: *** [cub/built] Error 2
EdH is offline   Reply With Quote
Old 2020-01-11, 16:46   #4
chris2be8's Avatar
Sep 2009

1,973 Posts

On my newest system I got it running with:
chris@sirius:~$ diff msieve.1030/trunk/Makefile msieve.1030.cuda/trunk/Makefile 
> #	stage1_core_sm20.ptx 
< 	stage1_core_sm20.ptx \
< 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 $@ $<
< 	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 ..
chris@sirius:~$ diff msieve.1030/trunk/cub/Makefile msieve.1030.cuda/trunk/cub/Makefile 
< 	NVCCFLAGS += -Xptxas -v -Xcudafe -\# -shared -Xptxas -abi=no \
> 	NVCCFLAGS += -Xptxas -v -Xcudafe -\# -shared \
< 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
chris2be8 is offline   Reply With Quote
Old 2020-01-12, 16:47   #5
chris2be8's Avatar
Sep 2009

1,973 Posts

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.

chris2be8 is offline   Reply With Quote

Thread Tools

Similar Threads
Thread Thread Starter Forum Replies Last Post
ECM for CUDA GPUs in latest GMP-ECM ? Karl M Johnson GMP-ECM 506 2020-12-29 16:45
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 14:55.

Fri Jan 15 14:55:50 UTC 2021 up 43 days, 11:07, 0 users, load averages: 1.51, 1.71, 1.73

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.