Discussion:
[OMPI users] Build Open-MPI without OpenCL support
Nilesh Kokane
2017-09-08 08:59:42 UTC
Permalink
Hello,

How can I compile openmpi without the support of open-cl?

The only link I could find is [1], but openmpi doesn't configure this
option.
The reason why I'm trying to build openmpi without open-cl is it throws the
following errors even with the nvidia installed opencl.


./mpicc -I/usr/local/cuda-8.0.61/lib64 -lcuda test_cuda_aware.c -o myapp
./mpicc: /usr/local/cuda-8.0.61/lib64/libOpenCL.so.1: no version
information available (required by /home/kokanen/opt/lib/libopen-pal.so.20)
/tmp/cc7KaPDe.o: In function `main':
test_cuda_aware.c:(.text+0x5b): undefined reference to `cudaMalloc'
test_cuda_aware.c:(.text+0xd3): undefined reference to `cudaFree'
/home/kokanen/opt/lib/libopen-pal.so.20: undefined reference to
`***@OPENCL_1.0'
/home/kokanen/opt/lib/libopen-pal.so.20: undefined reference to
`***@OPENCL_1.0'
/home/kokanen/opt/lib/libopen-pal.so.20: undefined reference to
`***@OPENCL_1.0'
/home/kokanen/opt/lib/libopen-pal.so.20: undefined reference to
`***@OPENCL_1.0'




[1]. https://www.open-mpi.org/projects/hwloc/doc/v1.7.2/a00014.php
--
Regards,
Nilesh Kokane
Gilles Gouaillardet
2017-09-08 10:03:38 UTC
Permalink
Nilesh,

Can you
configure --without-nvidia ...
And see if it helps ?

Cheers,

Gilles
Hello, 
How can I compile openmpi without the support of open-cl?
The only link I could find is [1], but openmpi doesn't configure this option.
The reason why I'm trying to build openmpi without open-cl is it throws the following errors even with the nvidia installed opencl.
./mpicc -I/usr/local/cuda-8.0.61/lib64 -lcuda test_cuda_aware.c -o myapp
./mpicc: /usr/local/cuda-8.0.61/lib64/libOpenCL.so.1: no version information available (required by /home/kokanen/opt/lib/libopen-pal.so.20)
test_cuda_aware.c:(.text+0x5b): undefined reference to `cudaMalloc'
test_cuda_aware.c:(.text+0xd3): undefined reference to `cudaFree'
[1]. https://www.open-mpi.org/projects/hwloc/doc/v1.7.2/a00014.php
--
Regards,
Nilesh Kokane
Nilesh Kokane
2017-09-08 10:38:33 UTC
Permalink
On Fri, Sep 8, 2017 at 3:33 PM, Gilles Gouaillardet
Post by Gilles Gouaillardet
Nilesh,
Can you
configure --without-nvidia ...
And see if it helps ?
No, I need Nvidia cuda support.



//Nilesh Kokane
Nilesh Kokane
2017-09-08 10:40:58 UTC
Permalink
Post by Nilesh Kokane
On Fri, Sep 8, 2017 at 3:33 PM, Gilles Gouaillardet
Post by Gilles Gouaillardet
Nilesh,
Can you
configure --without-nvidia ...
And see if it helps ?
No, I need Nvidia cuda support.
Or else do you have a way to solve this open-cl errors?

./mpicc -I/usr/local/cuda-8.0.61/lib64 -lcuda test_cuda_aware.c -o myapp
./mpicc: /usr/local/cuda-8.0.61/lib64/libOpenCL.so.1: no version
information available (required by
/home/kokanen/opt/lib/libopen-pal.so.20)
/tmp/cc7KaPDe.o: In function `main':
test_cuda_aware.c:(.text+0x5b): undefined reference to `cudaMalloc'
test_cuda_aware.c:(.text+0xd3): undefined reference to `cudaFree'
/home/kokanen/opt/lib/libopen-pal.so.20: undefined reference to
`***@OPENCL_1.0'
/home/kokanen/opt/lib/libopen-pal.so.20: undefined reference to
`***@OPENCL_1.0'
/home/kokanen/opt/lib/libopen-pal.so.20: undefined reference to
`***@OPENCL_1.0'
/home/kokanen/opt/lib/libopen-pal.so.20: undefined reference to
`***@OPENCL_1.0'



Pointing to -L/usr/local/cuda-8.0.61/lib64 while compiling with mpicc
didn't help.

Any clues?
--
Regards,
Nilesh Kokane
Gilles Gouaillardet
2017-09-08 11:15:57 UTC
Permalink
can you
./mpicc -showme -I/usr/local/cuda-8.0.61/lib64 -lcuda test_cuda_aware.c -o myapp
and double check -lcuda is *after* -lopen-pal ?

Cheers,

Gilles
Post by Nilesh Kokane
Post by Nilesh Kokane
On Fri, Sep 8, 2017 at 3:33 PM, Gilles Gouaillardet
Post by Gilles Gouaillardet
Nilesh,
Can you
configure --without-nvidia ...
And see if it helps ?
No, I need Nvidia cuda support.
Or else do you have a way to solve this open-cl errors?
./mpicc -I/usr/local/cuda-8.0.61/lib64 -lcuda test_cuda_aware.c -o myapp
./mpicc: /usr/local/cuda-8.0.61/lib64/libOpenCL.so.1: no version
information available (required by
/home/kokanen/opt/lib/libopen-pal.so.20)
test_cuda_aware.c:(.text+0x5b): undefined reference to `cudaMalloc'
test_cuda_aware.c:(.text+0xd3): undefined reference to `cudaFree'
/home/kokanen/opt/lib/libopen-pal.so.20: undefined reference to
/home/kokanen/opt/lib/libopen-pal.so.20: undefined reference to
/home/kokanen/opt/lib/libopen-pal.so.20: undefined reference to
Pointing to -L/usr/local/cuda-8.0.61/lib64 while compiling with mpicc
didn't help.
Any clues?
--
Regards,
Nilesh Kokane
_______________________________________________
users mailing list
https://lists.open-mpi.org/mailman/listinfo/users
Sylvain Jeaugey
2017-09-08 18:13:30 UTC
Permalink
To solve the undefined references to cudaMalloc and cudaFree, you need
to link the CUDA runtime. So you should replace -lcuda by -lcudart.

For the OPENCL undefined references, I don't know where those are coming
from ... could it be that hwloc is compiling OpenCL support but not
adding -lOpenCL to the mpicc command, thus causing this issue ?

To work around the issue, I would try to uninstall the opencl libraries
before recompiling Open MPI. Another way could be to add manually the
OpenCL library with -lOpenCL.
Post by Gilles Gouaillardet
can you
./mpicc -showme -I/usr/local/cuda-8.0.61/lib64 -lcuda test_cuda_aware.c -o myapp
and double check -lcuda is *after* -lopen-pal ?
Cheers,
Gilles
Post by Nilesh Kokane
Post by Nilesh Kokane
On Fri, Sep 8, 2017 at 3:33 PM, Gilles Gouaillardet
Post by Gilles Gouaillardet
Nilesh,
Can you
configure --without-nvidia ...
And see if it helps ?
No, I need Nvidia cuda support.
Or else do you have a way to solve this open-cl errors?
./mpicc -I/usr/local/cuda-8.0.61/lib64 -lcuda test_cuda_aware.c -o myapp
./mpicc: /usr/local/cuda-8.0.61/lib64/libOpenCL.so.1: no version
information available (required by
/home/kokanen/opt/lib/libopen-pal.so.20)
test_cuda_aware.c:(.text+0x5b): undefined reference to `cudaMalloc'
test_cuda_aware.c:(.text+0xd3): undefined reference to `cudaFree'
/home/kokanen/opt/lib/libopen-pal.so.20: undefined reference to
/home/kokanen/opt/lib/libopen-pal.so.20: undefined reference to
/home/kokanen/opt/lib/libopen-pal.so.20: undefined reference to
/home/kokanen/opt/lib/libopen-pal.so.20: undefined reference to
Pointing to -L/usr/local/cuda-8.0.61/lib64 while compiling with mpicc
didn't help.
Any clues?
--
Regards,
Nilesh Kokane
_______________________________________________
users mailing list
https://lists.open-mpi.org/mailman/listinfo/users
_______________________________________________
users mailing list
https://lists.open-mpi.org/mailman/listinfo/users
-----------------------------------------------------------------------------------
This email message is for the sole use of the intended recipient(s) and may contain
confidential information. Any unauthorized review, use, disclosure or distribution
is prohibited. If you are not the intended recipient, please contact the sender by
reply email and destroy all copies of the original message.
-----------------------------------------------------------------------------------
Nilesh Kokane
2017-09-09 11:12:05 UTC
Permalink
To solve the undefined references to cudaMalloc and cudaFree, you need to
link the CUDA runtime. So you should replace -lcuda by -lcudart.
If I compile with the following option:

./mpicc -I/usr/local/cuda-8.0.61/include -lOpenCL test_cuda_aware.c -o myapp

I get:
./mpicc: /usr/local/cuda-8.0.61/lib64/libOpenCL.so.1: no version
information available (required by
/home/kokanen/opt/lib/libopen-pal.so.20)
/tmp/cceiNnHc.o: In function `main':
test_cuda_aware.c:(.text+0x5b): undefined reference to `cudaMalloc'
test_cuda_aware.c:(.text+0xd3): undefined reference to `cudaFree'
collect2: error: ld returned 1 exit status

And the movement I try compiling giving the option /usr/local/cuda-8.0.61 :
./mpicc -I/usr/local/cuda-8.0.61/include -lOpenCL
-L/usr/local/cuda-8.0.61/lib64 -lcudart test_cuda_aware.c -o myapp

I get:
/tmp/cchauUBT.o: In function `main':
test_cuda_aware.c:(.text+0x5b): undefined reference to `cudaMalloc'
test_cuda_aware.c:(.text+0xd3): undefined reference to `cudaFree'
/home/kokanen/opt/lib/libopen-pal.so.20: undefined reference to
`***@OPENCL_1.0'
/home/kokanen/opt/lib/libopen-pal.so.20: undefined reference to
`***@OPENCL_1.0'
/home/kokanen/opt/lib/libopen-pal.so.20: undefined reference to
`***@OPENCL_1.0'
/home/kokanen/opt/lib/libopen-pal.so.20: undefined reference to
`***@OPENCL_1.0'
collect2: error: ld returned 1 exit status

So my inference is if it tries to link the nvidia opencl this issue arises.
Also the application is not able to link the -lcudart. I back checked
and made sure that I have libcudart.

/usr/local/cuda-8.0.61/lib64/libcudart.so.8.0.61

any clue?
For the OPENCL undefined references, I don't know where those are coming
from ... could it be that hwloc is compiling OpenCL support but not adding
-lOpenCL to the mpicc command, thus causing this issue ?
Could be.
To work around the issue, I would try to uninstall the opencl libraries
before recompiling Open MPI. Another way could be to add manually the OpenCL
library with -lOpenCL.
Yes, if I dont give the option -L/usr/local/cuda-8.0.61 opencl linking
goes off as it links to the system one, but error like

test_cuda_aware.c:(.text+0x5b): undefined reference to `cudaMalloc'
test_cuda_aware.c:(.text+0xd3): undefined reference to `cudaFree'

giving -lcudart doesn't help.
--
Regards,
Nilesh Kokane
Nilesh Kokane
2017-09-09 04:17:10 UTC
Permalink
On Fri, Sep 8, 2017 at 4:45 PM, Gilles Gouaillardet
Post by Gilles Gouaillardet
can you
./mpicc -showme -I/usr/local/cuda-8.0.61/lib64 -lcuda test_cuda_aware.c -o myapp
and double check -lcuda is *after* -lopen-pal ?
gcc -I/usr/local/cuda-8.0.61/lib64 -lcuda test_cuda_aware.c -o myapp
-I/home/kokanen/opt/include -pthread -Wl,-rpath
-Wl,/home/kokanen/opt/lib -Wl,--enable-new-dtags
-L/home/kokanen/opt/lib -lmpi
--
Regards,
Nilesh Kokane
Loading...