-   Msieve (
-   -   compiling msieve w/ latest CUDA? (

mathwiz 2020-01-09 16:16

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'[/code]

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?

jasonp 2020-01-10 02:32

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.

EdH 2020-01-11 15:39

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

chris2be8 2020-01-11 16:46

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 2020-01-12 16:47

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.


All times are UTC. The time now is 15:57.

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