This is an archive of the discontinued LLVM Phabricator instance.

[amdgpu-arch] Dynamically load the HSA runtime if not found during the build
ClosedPublic

Authored by jhuber6 on Jan 16 2023, 9:01 AM.

Details

Summary

We use the amdgpu-arch tool to query the installed GPUs at runtime.
One problem is that this tool is currently not build if the person
building the LLVM binary does not have the HSA runtime on their system.
This means that if someone built and distrubted an installation of LLVM
without HSA, then the user will not be able to use it even if they have
it on their system.

This patch makes us build this tool unconditionally and adds extra logic
to dynamically load HSA if it's present.

Diff Detail

Event Timeline

jhuber6 created this revision.Jan 16 2023, 9:01 AM
Herald added a project: Restricted Project. · View Herald TranscriptJan 16 2023, 9:01 AM
jhuber6 requested review of this revision.Jan 16 2023, 9:01 AM
Herald added a project: Restricted Project. · View Herald TranscriptJan 16 2023, 9:01 AM
JonChesterfield accepted this revision.Jan 16 2023, 9:19 AM

Yes, ok. Not thrilled about the copy&paste from openmp but we can fix that as soon as we agree on a subdir to put code shared between llvm/clang/openmp and that has been tricky to achieve consensus on. Feature is good, thanks!

This revision is now accepted and ready to land.Jan 16 2023, 9:19 AM