Discussion:
[X10-users] compile project with multiple files - use different compilation params
Luca Salucci
2014-02-04 17:10:35 UTC
Permalink
Thanks for the clarification! It is really useful. While compiling I am still having troubles. Let me explain.

my project folder hierarchy is the following:

.:
cuGML GML.x10

./cuGML:
cuSparseCSC.x10 cuVectorMult.x10 cuVector.x10


I use the following command to compile:
x10c++ -O -sourcepath cuGML -classpath <path_to_gml>/x10.gml/lib/native_gml.jar
-x10lib <path_to_gml>/x10.gml/native_gml.properties -post '# # # -L /usr/lib/libblas
-L /usr/lib/lapack -lblas -llapack' GML.x10 -o GML


My project extends the GML library (that I provide as .jar through the -classpath)
and thus makes use of BLAS and LAPACK that i link in the post-compilation.
I hope this is right, if not let me know please!

Well if I compile it to target the host everything is ok, but if I add the @CUDA directive
to the methods I want to run on the CUDA device I get the following:

x10c++: gcc: error: cuGML.cuVector.cu: No such file or directory
gcc: warning: ‘-x c++’ after last input file has no effect
gcc: fatal error: no input files
compilation terminated.
x10c++: Non-zero return code: 4
x10c++: Found @CUDA annotation, but not compiling for GPU because nvcc could not be run (check your $PATH).
x10c++: gcc: error: cuGML.cuVector.cu: No such file or directory
gcc: warning: ‘-x c++’ after last input file has no effect
gcc: fatal error: no input files
compilation terminated.
x10c++: Non-zero return code: 4
x10c++: Found @CUDA annotation, but not compiling for GPU because nvcc could not be run (check your $PATH).
x10c++: gcc: error: cuGML.cuVector.cu: No such file or directory
gcc: warning: ‘-x c++’ after last input file has no effect
gcc: fatal error: no input files
compilation terminated.
x10c++: Non-zero return code: 4
x10c++: Found @CUDA annotation, but not compiling for GPU because nvcc could not be run (check your $PATH).
x10c++: gcc: error: cuGML.cuVector.cu: No such file or directory
gcc: warning: ‘-x c++’ after last input file has no effect
gcc: fatal error: no input files
compilation terminated.
x10c++: Non-zero return code: 4
x10c++: Found @CUDA annotation, but not compiling for GPU because nvcc could not be run (check your $PATH).
x10c++: gcc: error: cuGML.cuVector.cu: No such file or directory
gcc: warning: ‘-x c++’ after last input file has no effect
gcc: fatal error: no input files
compilation terminated.
x10c++: Non-zero return code: 4
x10c++: Found @CUDA annotation, but not compiling for GPU because nvcc could not be run (check your $PATH).
x10c++: gcc: error: cuGML.cuVector.cu: No such file or directory
gcc: warning: ‘-x c++’ after last input file has no effect
gcc: fatal error: no input files
compilation terminated.
x10c++: Non-zero return code: 4
x10c++: Found @CUDA annotation, but not compiling for GPU because nvcc could not be run (check your $PATH).
x10c++: gcc: error: cuGML.cuVector.cu: No such file or directory
gcc: warning: ‘-x c++’ after last input file has no effect
gcc: fatal error: no input files
compilation terminated.
x10c++: Non-zero return code: 4
x10c++: Found @CUDA annotation, but not compiling for GPU because nvcc could not be run (check your $PATH).
x10c++: gcc: error: cuGML.cuVector.cu: No such file or directory
gcc: warning: ‘-x c++’ after last input file has no effect
gcc: fatal error: no input files
compilation terminated.
x10c++: Non-zero return code: 4
x10c++: Found @CUDA annotation, but not compiling for GPU because nvcc could not be run (check your $PATH).
x10c++: 15 dynamically checked calls or field accesses, run with -VERBOSE_CHECKS for more details.


I do not understand why it does not find the cuGML.<class>.cu files since they are present!
Indeed the project directory after compilation is in this state:
.:
cuGML GML GML.cc GML.h GML.x10 xxx_main_xxx.cc

./cuGML:
cuSparseCSC.cc cuSparseCSC.h cuSparseCSC.x10 cuVector.cc cuVector.cu cuVector__CUDADeviceNotFoundException.h
cuVector.h cuVectorMult.cc cuVectorMult.h cuVectorMult.x10 cuVector.x10



The GML program is produced but no .cubin file is generated for the methods to be run on the CUDA device, thus if i run it it crashes.

N.B. I do not know why but the last version of X10 (2.4.1) was not working on the machines on which I work!
After a bunch of work and configuration I found that the 2.3.1 version was working thus this is the version I am actually using.

I really do hope you do not tell me this is unsolvable otherwise my Master Thesis would be a flop.
Thank for your help!

Luca Salucci
Mikio Takeuchi
2014-02-05 00:53:40 UTC
Permalink
Hi Luca,

Make sure that nvcc is found in your PATH.
Then if you still see the same error (i.e. cannot find cuGML.cuVector.cu),
this is probably a bug in the driver of native x10. I wonder that the
driver should pass cuGML/cuVector.cu instead of cuGML.cuVector.cu to the
post compiler.

Mikio Takeuchi
IBM Research - Tokyo
Post by Luca Salucci
Thanks for the clarification! It is really useful. While compiling I am
still having troubles. Let me explain.
cuGML GML.x10
cuSparseCSC.x10 cuVectorMult.x10 cuVector.x10
x10c++ -O -sourcepath cuGML -classpath
<path_to_gml>/x10.gml/lib/native_gml.jar
-x10lib <path_to_gml>/x10.gml/native_gml.properties -post '# # # -L /usr/lib/libblas
-L /usr/lib/lapack -lblas -llapack' GML.x10 -o GML
My project extends the GML library (that I provide as .jar through the -classpath)
and thus makes use of BLAS and LAPACK that i link in the post-compilation.
I hope this is right, if not let me know please!
x10c++: gcc: error: cuGML.cuVector.cu: No such file or directory
gcc: warning: '-x c++' after last input file has no effect
gcc: fatal error: no input files
compilation terminated.
x10c++: Non-zero return code: 4
could not be run (check your $PATH).
x10c++: gcc: error: cuGML.cuVector.cu: No such file or directory
gcc: warning: '-x c++' after last input file has no effect
gcc: fatal error: no input files
compilation terminated.
x10c++: Non-zero return code: 4
could not be run (check your $PATH).
x10c++: gcc: error: cuGML.cuVector.cu: No such file or directory
gcc: warning: '-x c++' after last input file has no effect
gcc: fatal error: no input files
compilation terminated.
x10c++: Non-zero return code: 4
could not be run (check your $PATH).
x10c++: gcc: error: cuGML.cuVector.cu: No such file or directory
gcc: warning: '-x c++' after last input file has no effect
gcc: fatal error: no input files
compilation terminated.
x10c++: Non-zero return code: 4
could not be run (check your $PATH).
x10c++: gcc: error: cuGML.cuVector.cu: No such file or directory
gcc: warning: '-x c++' after last input file has no effect
gcc: fatal error: no input files
compilation terminated.
x10c++: Non-zero return code: 4
could not be run (check your $PATH).
x10c++: gcc: error: cuGML.cuVector.cu: No such file or directory
gcc: warning: '-x c++' after last input file has no effect
gcc: fatal error: no input files
compilation terminated.
x10c++: Non-zero return code: 4
could not be run (check your $PATH).
x10c++: gcc: error: cuGML.cuVector.cu: No such file or directory
gcc: warning: '-x c++' after last input file has no effect
gcc: fatal error: no input files
compilation terminated.
x10c++: Non-zero return code: 4
could not be run (check your $PATH).
x10c++: gcc: error: cuGML.cuVector.cu: No such file or directory
gcc: warning: '-x c++' after last input file has no effect
gcc: fatal error: no input files
compilation terminated.
x10c++: Non-zero return code: 4
could not be run (check your $PATH).
x10c++: 15 dynamically checked calls or field accesses, run with
-VERBOSE_CHECKS for more details.
I do not understand why it does not find the cuGML.<class>.cu files since they are present!
cuGML GML GML.cc GML.h GML.x10 xxx_main_xxx.cc
cuSparseCSC.cc cuSparseCSC.h cuSparseCSC.x10 cuVector.cc cuVector.cu
cuVector__CUDADeviceNotFoundException.h
cuVector.h cuVectorMult.cc cuVectorMult.h cuVectorMult.x10 cuVector.x10
The GML program is produced but no .cubin file is generated for the
methods to be run on the CUDA device, thus if i run it it crashes.
N.B. I do not know why but the last version of X10 (2.4.1) was not working
on the machines on which I work!
After a bunch of work and configuration I found that the 2.3.1 version was
working thus this is the version I am actually using.
I really do hope you do not tell me this is unsolvable otherwise my Master
Thesis would be a flop.
Thank for your help!
Luca Salucci
------------------------------------------------------------------------------
Managing the Performance of Cloud-Based Applications
Take advantage of what the Cloud has to offer - Avoid Common Pitfalls.
Read the Whitepaper.
http://pubads.g.doubleclick.net/gampad/clk?id=121051231&iu=/4140/ostg.clktrk
_______________________________________________
X10-users mailing list
https://lists.sourceforge.net/lists/listinfo/x10-users
Luca Salucci
2014-02-05 09:28:45 UTC
Permalink
P.S. Of course the path of CUDA binaries is included in $PATH indeed with exactly the same command
it compiles successfully the example files (x10.dist/samples/CUDA) you provide.
It looks like the problem is related with the package system: if I add a package to the samples
(let's say CUDAKernelTest or CUDABlackScholes) I get the same error.

Hope it helps!

Luca
Post by Luca Salucci
Thanks for the clarification! It is really useful. While compiling I am still having troubles. Let me explain.
cuGML GML.x10
cuSparseCSC.x10 cuVectorMult.x10 cuVector.x10
x10c++ -O -sourcepath cuGML -classpath <path_to_gml>/x10.gml/lib/native_gml.jar
-x10lib <path_to_gml>/x10.gml/native_gml.properties -post '# # # -L /usr/lib/libblas
-L /usr/lib/lapack -lblas -llapack' GML.x10 -o GML
My project extends the GML library (that I provide as .jar through the -classpath)
and thus makes use of BLAS and LAPACK that i link in the post-compilation.
I hope this is right, if not let me know please!
x10c++: gcc: error: cuGML.cuVector.cu: No such file or directory
gcc: warning: ‘-x c++’ after last input file has no effect
gcc: fatal error: no input files
compilation terminated.
x10c++: Non-zero return code: 4
x10c++: gcc: error: cuGML.cuVector.cu: No such file or directory
gcc: warning: ‘-x c++’ after last input file has no effect
gcc: fatal error: no input files
compilation terminated.
x10c++: Non-zero return code: 4
x10c++: gcc: error: cuGML.cuVector.cu: No such file or directory
gcc: warning: ‘-x c++’ after last input file has no effect
gcc: fatal error: no input files
compilation terminated.
x10c++: Non-zero return code: 4
x10c++: gcc: error: cuGML.cuVector.cu: No such file or directory
gcc: warning: ‘-x c++’ after last input file has no effect
gcc: fatal error: no input files
compilation terminated.
x10c++: Non-zero return code: 4
x10c++: gcc: error: cuGML.cuVector.cu: No such file or directory
gcc: warning: ‘-x c++’ after last input file has no effect
gcc: fatal error: no input files
compilation terminated.
x10c++: Non-zero return code: 4
x10c++: gcc: error: cuGML.cuVector.cu: No such file or directory
gcc: warning: ‘-x c++’ after last input file has no effect
gcc: fatal error: no input files
compilation terminated.
x10c++: Non-zero return code: 4
x10c++: gcc: error: cuGML.cuVector.cu: No such file or directory
gcc: warning: ‘-x c++’ after last input file has no effect
gcc: fatal error: no input files
compilation terminated.
x10c++: Non-zero return code: 4
x10c++: gcc: error: cuGML.cuVector.cu: No such file or directory
gcc: warning: ‘-x c++’ after last input file has no effect
gcc: fatal error: no input files
compilation terminated.
x10c++: Non-zero return code: 4
x10c++: 15 dynamically checked calls or field accesses, run with -VERBOSE_CHECKS for more details.
I do not understand why it does not find the cuGML.<class>.cu files since they are present!
cuGML GML GML.cc GML.h GML.x10 xxx_main_xxx.cc
cuSparseCSC.cc cuSparseCSC.h cuSparseCSC.x10 cuVector.cc cuVector.cu cuVector__CUDADeviceNotFoundException.h
cuVector.h cuVectorMult.cc cuVectorMult.h cuVectorMult.x10 cuVector.x10
The GML program is produced but no .cubin file is generated for the methods to be run on the CUDA device, thus if i run it it crashes.
N.B. I do not know why but the last version of X10 (2.4.1) was not working on the machines on which I work!
After a bunch of work and configuration I found that the 2.3.1 version was working thus this is the version I am actually using.
I really do hope you do not tell me this is unsolvable otherwise my Master Thesis would be a flop.
Thank for your help!
Luca Salucci
David P Grove
2014-02-05 12:58:03 UTC
Permalink
Post by Luca Salucci
P.S. Of course the path of CUDA binaries is included in $PATH indeed
with exactly the same command
it compiles successfully the example files (x10.dist/samples/CUDA) you provide.
It looks like the problem is related with the package system: if I
add a package to the samples
(let's say CUDAKernelTest or CUDABlackScholes) I get the same error.
ok, that is helpful. I will take a look.

is it possible for you to hack around this in the short run by not putting
any of the files with @CUDA annotations in packages?

--dave
David P Grove
2014-02-05 17:56:43 UTC
Permalink
Post by Luca Salucci
P.S. Of course the path of CUDA binaries is included in $PATH indeed
with exactly the same command
it compiles successfully the example files (x10.dist/samples/CUDA) you provide.
It looks like the problem is related with the package system: if I
add a package to the samples
(let's say CUDAKernelTest or CUDABlackScholes) I get the same error.
Hi,

I just committed a few tweaks that allow me to put the CUDA sample
programs into a package and compile them successfully. The patch is fairly
small, so you may be able to apply/adapt it to 2.3.1 without too much
effort.

patch: http://sourceforge.net/p/x10/code/27352

--dave
Luca Salucci
2014-02-06 10:46:27 UTC
Permalink
Thank you very much! I tried to apply the patch and recompile but i get an error. I hereby attach the output of the compilation

Luca
Mikio Takeuchi
2014-02-06 11:09:42 UTC
Permalink
Hi,

Can you try trunk rather than patching to 2.3.1? In 2.4, Rail was
reintroduced in X10 as a basic type. Type system was updated to support
it, which caused the compilation error.

We have fixed a few CUDA related bugs in trunk that were introduced with
recent changes to the language, so if you can port your application to 2.4
it would be the easiest way to play with CUDA.

We plan a new X10 release hopefully next week, so if you can wait it you
don't need to build trunk by yourself.

-- Mikio
Post by Luca Salucci
Thank you very much! I tried to apply the patch and recompile but i get an
error. I hereby attach the output of the compilation
Luca
------------------------------------------------------------------------------
Managing the Performance of Cloud-Based Applications
Take advantage of what the Cloud has to offer - Avoid Common Pitfalls.
Read the Whitepaper.
http://pubads.g.doubleclick.net/gampad/clk?id=121051231&iu=/4140/ostg.clktrk
_______________________________________________
X10-users mailing list
https://lists.sourceforge.net/lists/listinfo/x10-users
David P Grove
2014-02-06 14:35:50 UTC
Permalink
Post by Luca Salucci
Thank you very much! I tried to apply the patch and recompile but i
get an error. I hereby attach the output of the compilation
It looks like you either applied the wrong patch or attempted to pick up
the entire changed file. All that really needs changed is the few lines
in the two files that handles output file names. That shouldn't introduce
any references to Rail (which as Mikio said was introduced in X10 2.4).

That being said, if moving forward to X10 2.4.2 when it comes out is an
option for you, it is probably a good idea.

--dave
Luca Salucci
2014-02-06 17:16:34 UTC
Permalink
I moved to the trunk, apply the patch and now it compiles! Now I have another issue but I open a new topic cause it is different.

Thanks for the help!

Luca

Loading...