x10-lang / x10

Core implementation of X10 programming language including compiler, runtime, class libraries, sample programs and test suite
Eclipse Public License 1.0
71 stars 15 forks source link

x10c++: nvcc fatal : Value 'sm_30' is not defined for option 'gpu-architecture' #35

Closed vahya closed 2 years ago

vahya commented 2 years ago

I've built x10 from source with the -DX10RT_CUDA=true -Doptimize=true options and the build was successful, but when I try to run the sample CUDA programs, I get the following error:

x10c++: nvcc fatal : Value 'sm_30' is not defined for option 'gpu-architecture'    
x10c++: Non-zero return code: 1
x10c++: Found @CUDA annotation, but compilation of CUDAMatMul.cu with nvcc -arch=sm_30 failed.
3 errors.

I've googled but found nothing. How do I fix this?

I have an Nvidia GeForce GTX 1050 laptop, and nvcc --version shows:

nvcc: NVIDIA (R) Cuda compiler driver
Copyright (c) 2005-2022 NVIDIA Corporation
Built on Tue_May__3_18:49:52_PDT_2022
Cuda compilation tools, release 11.7, V11.7.64
Build cuda_11.7.r11.7/compiler.31294372_0
dgrove-oss commented 2 years ago

The CUDA backend for X10 hasn't been maintained for years. That being said, you might be able to get around this by updating the code here https://github.com/x10-lang/x10/blob/master/x10.compiler/src/x10cpp/postcompiler/CXXCommandBuilder.java#L428-#L467 that tries to figure out the CUDA architecture.

vahya commented 2 years ago

I just commented all the lines in CXXCommandBuilder.java file and added ans.add("sm_61") and it worked. Thanks for the response.