Skip to content

Apply hip workaround for raja-framework#32469

Merged
trws merged 5 commits intospack:developfrom
trws:raja-fix
Sep 2, 2022
Merged

Apply hip workaround for raja-framework#32469
trws merged 5 commits intospack:developfrom
trws:raja-fix

Conversation

@trws
Copy link
Copy Markdown
Contributor

@trws trws commented Sep 1, 2022

  • add workaround for broken behavior in HIP
  • propagate openmp requirement and workaround to camp

trws added 2 commits August 31, 2022 17:26
Hip has a longstanding cmake issue where they calculate include paths
incorrectly, this works around it for raja and adds an explicit rocprim
dependency.
@davidbeckingsale
Copy link
Copy Markdown
Contributor

Nice, thanks @trws!

@trws
Copy link
Copy Markdown
Contributor Author

trws commented Sep 1, 2022

@davidbeckingsale, I remember fixing this -lopenmp missing bug that's showing up in the gitlab builds for Umpire, but can't seem to remember how. Do you happen to recognize it or remember what the workaround was? Maybe it's building a pre-fix version of umpire with a post-fix camp?

depends_on("[email protected]:0.2.3", when="@0.14.0")
depends_on("[email protected]", when="@0.10.0:0.13.0")
depends_on("[email protected]:", when="@2022.03.0:")
depends_on("camp+openmp", when="+openmp")
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@trws - Umpire needs this line too, I think that will fix the problem.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sadly, that did not take care of it. I think we may need to get the updates in a release to get past this. =/

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

:( - will constraining the camp version help?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I can try it, I'll add the new version bump I put up for camp and see if it's enough, or if we need to bump the others.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It looks like that might actually do it, I bumped camp to 2022.03.2 on the theory we might have to bump the other two to bump camp (the submodule is still wrong) but bumping it in spack seems to make gitlab happy: https://gitlab.spack.io/spack/spack/-/pipelines/164770

@trws
Copy link
Copy Markdown
Contributor Author

trws commented Sep 2, 2022

Ok, this is actually passing now. Want to go forward with this and see if it gets us over the hump @davidbeckingsale?

@davidbeckingsale
Copy link
Copy Markdown
Contributor

Ok, this is actually passing now. Want to go forward with this and see if it gets us over the hump @davidbeckingsale?

Yup that sounds good to me, thanks @trws !

@trws trws merged commit c25b7ea into spack:develop Sep 2, 2022
@trws trws deleted the raja-fix branch September 2, 2022 23:55
ma595 pushed a commit to ma595/spack that referenced this pull request Sep 13, 2022
* add workaround for broken behavior in HIP

Hip has a longstanding cmake issue where they calculate include paths
incorrectly, this works around it for raja and adds an explicit rocprim
dependency.

* propagate openmp requirement and workaround to camp

* refactor and include umpire

* propagate openmp option to camp in umpire and use main camp for main and develop raja and umpire

* bump camp to new patch release
@cameronrutherford
Copy link
Copy Markdown
Contributor

I have been working with this change in camp and it has broken the existing functioning ROCm installs that I have been working on. This ends up appending the string literal to the cache.cmake file used to configure RAJA and Umpire, and I get the following error:

2 errors found in build log:
  >> 5     CMake Error at login2-cray-sles15-zen3-clang@@14.0.0.cmake:42:
     6       Parse error.  Expected a command name, got unquoted argument with text
     7       "-DHIP_CLANG_INCLUDE_PATH=/opt/rocm-5.2.0/llvm/lib/clang/14.0.0/include".
     8
     9
  >> 10    CMake Error: Error processing file: /gpfs/alpine/proj-shared/csc359/spack-install/build-stage/rcruther/spack-stage-raja-0.1
           4.0-srsbc2bzv4ps3pbdja32wv3cfklbv4ug/spack-src/login2-cray-sles15-zen3-clang@@14.0.0.cmake
     11    -- Configuring incomplete, errors occurred!

I am determining a workaround, but it took me quite a while to figure out what I had broken when I updated the spack ref we are using...

Comment on lines +13 to +16
options.append(
"-DHIP_CLANG_INCLUDE_PATH="
+ glob.glob("{}/lib/clang/*/include".format(spec["llvm-amdgpu"].prefix))[0]
)
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this needs to be changed slightly to resolve my issue:

path = glob.glob("{}/lib/clang/*/include".format(spec["llvm-amdgpu"].prefix))[0]
options.append(cmake_cache_path("HIP_CLANG_INCLUDE_PATH", "{0}".format(path))

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have verified that with a camp already built, this patch fixes my problem. I will probably make a PR to add this change, but want to make sure I'm not breaking things elsewhere/in camp

Copy link
Copy Markdown
Contributor Author

@trws trws Sep 14, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's being caused by the fact that we have both CmakePackage and CachedCmakePackage for some reason. There is a fix in the umpire package in #32504.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I see. Can/Will that fix also be applied to RAJA?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I see there is a RAJA PR linked to this as well, so I assume so. Thanks for the help!

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants