Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[OpenMP] Multiple definition error with --save-temps when linking CUDA device code #67583

Closed
markdewing opened this issue Sep 27, 2023 · 1 comment · Fixed by #67679
Closed
Assignees

Comments

@markdewing
Copy link
Contributor

Error occurs when linking a CUDA device function with OpenMP offload and --save-temps is specified. The code links successfully without --save-temps.

The error is:
/usr/bin/ld: a.out.image.wrapper.o:(cuda_offloading_entries+0x0): multiple definition of `__dummy.cuda_offloading.entry'; a.out.image.wrapper.o:(cuda_offloading_entries+0x0): first defined here

dev_func_save_temps.tar.gz
(Might need to adjust the --cuda-gpu-arch in the first compile command in c1)

@llvmbot
Copy link
Collaborator

llvmbot commented Sep 28, 2023

@llvm/issue-subscribers-openmp

Error occurs when linking a CUDA device function with OpenMP offload and `--save-temps` is specified. The code links successfully without `--save-temps`.

The error is:
/usr/bin/ld: a.out.image.wrapper.o:(cuda_offloading_entries+0x0): multiple definition of `__dummy.cuda_offloading.entry'; a.out.image.wrapper.o:(cuda_offloading_entries+0x0): first defined here

dev_func_save_temps.tar.gz
(Might need to adjust the --cuda-gpu-arch in the first compile command in c1)

jhuber6 added a commit to jhuber6/llvm-project that referenced this issue Sep 28, 2023
Summary:
We use these image wrappers to do runtime specifica registration of
variables and to load the device image that was compiled. This was
intended to support multiple of these running at the same time, e.g. you
can have a CUDA instance running with OpenMP and they should both
function so long as you do not share state between the two. However,
because we did not use a unique name for this file it would cause
conflicts when included. This patch names the image based off of the
language runtime it's using so that they remain separate.

Fixes: llvm#67583
jhuber6 added a commit that referenced this issue Sep 28, 2023
Summary:
We use these image wrappers to do runtime specifica registration of
variables and to load the device image that was compiled. This was
intended to support multiple of these running at the same time, e.g. you
can have a CUDA instance running with OpenMP and they should both
function so long as you do not share state between the two. However,
because we did not use a unique name for this file it would cause
conflicts when included. This patch names the image based off of the
language runtime it's using so that they remain separate.

Fixes: #67583
legrosbuffle pushed a commit to legrosbuffle/llvm-project that referenced this issue Sep 29, 2023
Summary:
We use these image wrappers to do runtime specifica registration of
variables and to load the device image that was compiled. This was
intended to support multiple of these running at the same time, e.g. you
can have a CUDA instance running with OpenMP and they should both
function so long as you do not share state between the two. However,
because we did not use a unique name for this file it would cause
conflicts when included. This patch names the image based off of the
language runtime it's using so that they remain separate.

Fixes: llvm#67583
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants