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

HIP Runtime Linker Errors #538

Closed
ashermancinelli opened this issue Feb 11, 2021 · 6 comments
Closed

HIP Runtime Linker Errors #538

ashermancinelli opened this issue Feb 11, 2021 · 6 comments

Comments

@ashermancinelli
Copy link

Describe the bug

Exported CMake targets explicitly link against target hip_runtime, although hip_runtime is just a collection of headers and not a concrete library afaik (is hip_runtime an interface/alias cmake target internal to umpire's cmake?).

To circumvent this, I build Umpire and then manually remove hip_runtime from array on line 76 of <prefix>/share/umpire/cmake/umpire-targets.cmake. From there I'm able to build all of my targets that depend on umpire and hip.

Expected behavior

Import Umpire's cmake targets without passing explicit -lhip_runtime link library to user's targets.

Compilers & Libraries (please complete the following information):

I'll have to ensure hardware on early access machines can be discussed here... @pelesh please advise.

Additional context

Installed using spack fwiw.

If I'm simply using the imported cmake targets incorrectly, please let me know. Thank you!

@davidbeckingsale
Copy link
Member

The hip_runtime target comes from BLT. When you build a HIP-enabled Umpire it is required to be linked to the HIP runtime library, which is most easily done by linking with hipcc. The target handles this.

How do you support HIP compilation in your application?

@ashermancinelli
Copy link
Author

Perhaps I'm just misusing the library. According to this issue in ROCm repo, we set C++ compiler to hip clang and link against hip::device for device code, as discussed on this ROCm documentation page. Do you see anything immediately wrong with this, and is there additional documentation for using Umpire with hip?

@ashermancinelli
Copy link
Author

For additional context:

  • The error occurs in the link step, the sources with RAJA kernels using HIP policies compile fine.
  • The final linked targets also link to cmake target hip::device, and are confirmed to use --hip-link

@ashermancinelli
Copy link
Author

We ran into this issue with RAJA - would you like me to raise an issue on that repo as well? After removing the hip_runtime targets manually our entire stack built and ran successfully.

@davidbeckingsale
Copy link
Member

I'm hopeful that #541 will help - if you would like to try and build and install that branch and see if the issue goes away that would be super helpful. I can than make the same change to RAJA.

@ashermancinelli
Copy link
Author

The fix has been merged into develop and I have validated the patch myself. Thanks for the help!

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

No branches or pull requests

2 participants