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

compile error at global mem alloc when RDC is false #2259

Open
mehmetyusufoglu opened this issue Apr 23, 2024 · 8 comments
Open

compile error at global mem alloc when RDC is false #2259

mehmetyusufoglu opened this issue Apr 23, 2024 · 8 comments

Comments

@mehmetyusufoglu
Copy link
Contributor

mehmetyusufoglu commented Apr 23, 2024

I faced a compile error at Develop branch:

 alpaka/test/unit/mem/view/src/ViewStaticAccMem.cpp(19): error: An inline __device__/__constant__/__managed__ variable must have internal linkage when the program is compiled in whole program mode (-rdc=false)
                              alpaka::DevGlobal<TAcc, Elem[3][2]> g_globalMemory2DUninitialized;
  • Error is observed when alpaka_RELOCATABLE_DEVICE_CODE cmake variable is DEFAULT or OFF.
  • Error is not observed when alpaka_RELOCATABLE_DEVICE_CODE cmake variable is ON.
@mehmetyusufoglu mehmetyusufoglu changed the title global memory allocation compile error when RDC is false compile error at global mem alloc when RDC is false Apr 23, 2024
@SimeonEhrig
Copy link
Member

I checked the CI jobs again. There is a hand written job, which test RDC:

It tests nvcc 12.0 with gcc 12. Maybe your problem is a version specific bug. Which nvcc and host compiler version do you use?

@mehmetyusufoglu
Copy link
Contributor Author

mehmetyusufoglu commented Apr 23, 2024

I checked the CI jobs again. There is a hand written job, which test RDC:

* https://github.com/alpaka-group/alpaka/blob/develop/script/gitlabci/job_cuda.yml

* current dev: https://gitlab.com/hzdr/crp/alpaka/-/jobs/6648385841

It tests nvcc 12.0 with gcc 12. Maybe your problem is a version specific bug. Which nvcc and host compiler version do you use?

Error disapperars when the flag is ON. The CI checks the ON version not when the flag is OFF ? My config is nvcc 12.4 , gcc 12.3

@psychocoderHPC
Copy link
Member

psychocoderHPC commented Apr 23, 2024

Maybe the problem is introduced in #2242
Before the change, we always declared the variable extern too see: https://github.com/alpaka-group/alpaka/pull/2242/files#diff-2eddedd7c8abe84214af714d0e61060a85e1ef924b16bad0e7bb6fff54b250b8L25

@AuroraPerego Do you know why you removed the additional extern declaration of the variable?

@AuroraPerego
Copy link
Contributor

Do you know why you removed the additional extern declaration of the variable?

With the new implementation the extern declaration was not working, I used the inline attribute instead

@psychocoderHPC
Copy link
Member

Do you know why you removed the additional extern declaration of the variable?

With the new implementation the extern declaration was not working, I used the inline attribute instead

Thanks for the fast response.

@psychocoderHPC
Copy link
Member

https://reviews.llvm.org/D88786?id=295997 looks like a discussion about this topic for llvm behaviours

@AuroraPerego
Copy link
Contributor

yes, we finished on the same page :)
I'll look into it tomorrow with Mehmet

@AuroraPerego
Copy link
Contributor

I confirm that this is version-specific, I can reproduce it with CUDA 12.4 and the flag -rdc=false but not with CUDA 12.{0,1,2}.
It compiles with static instead of inline (see PR #2242-comment).

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

No branches or pull requests

4 participants