clang 11 + CUDA + OpenMP broken?

classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|

clang 11 + CUDA + OpenMP broken?

David Blaikie via cfe-dev
If I have a source file including a CUDA kernel and OpenMP directives, I can compile it like so on my Linux machine:

/usr/local/cuda/bin/nvcc -arch=sm_30 cutest.cu --compiler-options=-fopenmp

I would expect to be able to compile it with clang 11 like so:

clang -fopenmp --cuda-gpu-arch=sm_30 cutest.cu \
    -L/usr/local/cuda/lib64 -lcudart -ldl -lrt -pthread

But when I try, I get a number of undefined function symbols: __nv_isnand, __nv_isinfd, __nv_copysign, etc.

Am I doing something wrong?

Geoff

_______________________________________________
cfe-dev mailing list
[hidden email]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-dev
Reply | Threaded
Open this post in threaded view
|

Re: clang 11 + CUDA + OpenMP broken?

David Blaikie via cfe-dev
Which version of clang is this exactly?
Can you reproduce the error with trunk?
There was a problem that should have been fixed and back ported to the
release branch.

~ Johannes

On 11/19/20 7:08 AM, Geoff Levner via cfe-dev wrote:

> If I have a source file including a CUDA kernel and OpenMP directives, I
> can compile it like so on my Linux machine:
>
> /usr/local/cuda/bin/nvcc -arch=sm_30 cutest.cu --compiler-options=-fopenmp
>
> I would expect to be able to compile it with clang 11 like so:
>
> clang -fopenmp --cuda-gpu-arch=sm_30 cutest.cu \
>      -L/usr/local/cuda/lib64 -lcudart -ldl -lrt -pthread
>
> But when I try, I get a number of undefined function symbols: __nv_isnand,
> __nv_isinfd, __nv_copysign, etc.
>
> Am I doing something wrong?
>
> Geoff
>
>
> _______________________________________________
> cfe-dev mailing list
> [hidden email]
> https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-dev
_______________________________________________
cfe-dev mailing list
[hidden email]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-dev
Reply | Threaded
Open this post in threaded view
|

Re: clang 11 + CUDA + OpenMP broken?

David Blaikie via cfe-dev
This is with the release branch (11.0.1, updated Tuesday 17 november). I haven't tried with the trunk... I will try to test the trunk tomorrow.

Thanks,
Geoff

On Thu, Nov 19, 2020 at 5:41 PM Johannes Doerfert <[hidden email]> wrote:
Which version of clang is this exactly?
Can you reproduce the error with trunk?
There was a problem that should have been fixed and back ported to the
release branch.

~ Johannes

On 11/19/20 7:08 AM, Geoff Levner via cfe-dev wrote:
> If I have a source file including a CUDA kernel and OpenMP directives, I
> can compile it like so on my Linux machine:
>
> /usr/local/cuda/bin/nvcc -arch=sm_30 cutest.cu --compiler-options=-fopenmp
>
> I would expect to be able to compile it with clang 11 like so:
>
> clang -fopenmp --cuda-gpu-arch=sm_30 cutest.cu \
>      -L/usr/local/cuda/lib64 -lcudart -ldl -lrt -pthread
>
> But when I try, I get a number of undefined function symbols: __nv_isnand,
> __nv_isinfd, __nv_copysign, etc.
>
> Am I doing something wrong?
>
> Geoff
>
>
> _______________________________________________
> cfe-dev mailing list
> [hidden email]
> https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-dev

_______________________________________________
cfe-dev mailing list
[hidden email]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-dev
Reply | Threaded
Open this post in threaded view
|

Re: clang 11 + CUDA + OpenMP broken?

David Blaikie via cfe-dev
I just tested the master branch, and it works. So apparently the problem is with the 11.x branch.

On Thu, Nov 19, 2020 at 5:45 PM Geoff Levner <[hidden email]> wrote:
This is with the release branch (11.0.1, updated Tuesday 17 november). I haven't tried with the trunk... I will try to test the trunk tomorrow.

Thanks,
Geoff

On Thu, Nov 19, 2020 at 5:41 PM Johannes Doerfert <[hidden email]> wrote:
Which version of clang is this exactly?
Can you reproduce the error with trunk?
There was a problem that should have been fixed and back ported to the
release branch.

~ Johannes

On 11/19/20 7:08 AM, Geoff Levner via cfe-dev wrote:
> If I have a source file including a CUDA kernel and OpenMP directives, I
> can compile it like so on my Linux machine:
>
> /usr/local/cuda/bin/nvcc -arch=sm_30 cutest.cu --compiler-options=-fopenmp
>
> I would expect to be able to compile it with clang 11 like so:
>
> clang -fopenmp --cuda-gpu-arch=sm_30 cutest.cu \
>      -L/usr/local/cuda/lib64 -lcudart -ldl -lrt -pthread
>
> But when I try, I get a number of undefined function symbols: __nv_isnand,
> __nv_isinfd, __nv_copysign, etc.
>
> Am I doing something wrong?
>
> Geoff
>
>
> _______________________________________________
> cfe-dev mailing list
> [hidden email]
> https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-dev

_______________________________________________
cfe-dev mailing list
[hidden email]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-dev
Reply | Threaded
Open this post in threaded view
|

Re: clang 11 + CUDA + OpenMP broken?

David Blaikie via cfe-dev
I think the problem is we never ported the fix back into 11.
Here is the bug report https://bugs.llvm.org/show_bug.cgi?id=48014


On 11/19/20 11:43 AM, Geoff Levner wrote:

> I just tested the master branch, and it works. So apparently the problem is
> with the 11.x branch.
>
> On Thu, Nov 19, 2020 at 5:45 PM Geoff Levner <[hidden email]> wrote:
>
>> This is with the release branch (11.0.1, updated Tuesday 17 november). I
>> haven't tried with the trunk... I will try to test the trunk tomorrow.
>>
>> Thanks,
>> Geoff
>>
>> On Thu, Nov 19, 2020 at 5:41 PM Johannes Doerfert <
>> [hidden email]> wrote:
>>
>>> Which version of clang is this exactly?
>>> Can you reproduce the error with trunk?
>>> There was a problem that should have been fixed and back ported to the
>>> release branch.
>>>
>>> ~ Johannes
>>>
>>> On 11/19/20 7:08 AM, Geoff Levner via cfe-dev wrote:
>>>> If I have a source file including a CUDA kernel and OpenMP directives, I
>>>> can compile it like so on my Linux machine:
>>>>
>>>> /usr/local/cuda/bin/nvcc -arch=sm_30 cutest.cu
>>> --compiler-options=-fopenmp
>>>> I would expect to be able to compile it with clang 11 like so:
>>>>
>>>> clang -fopenmp --cuda-gpu-arch=sm_30 cutest.cu \
>>>>       -L/usr/local/cuda/lib64 -lcudart -ldl -lrt -pthread
>>>>
>>>> But when I try, I get a number of undefined function symbols:
>>> __nv_isnand,
>>>> __nv_isinfd, __nv_copysign, etc.
>>>>
>>>> Am I doing something wrong?
>>>>
>>>> Geoff
>>>>
>>>>
>>>> _______________________________________________
>>>> cfe-dev mailing list
>>>> [hidden email]
>>>> https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-dev
_______________________________________________
cfe-dev mailing list
[hidden email]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-dev