This is an archive of the discontinued LLVM Phabricator instance.

[HIP] Detect HIP for Debian/Fedora
ClosedPublic

Authored by yaxunl on Oct 12 2022, 10:46 AM.

Details

Summary

HIP is installed at /usr or /usr/local on Debin/Fedora,
and the version file is at {root}/share/hip/version.

Diff Detail

Event Timeline

yaxunl created this revision.Oct 12 2022, 10:46 AM
Herald added a project: Restricted Project. · View Herald TranscriptOct 12 2022, 10:46 AM
yaxunl requested review of this revision.Oct 12 2022, 10:46 AM
tra added inline comments.Oct 12 2022, 10:56 AM
clang/lib/Driver/ToolChains/AMDGPU.cpp
311

Should it be done for Debian/Fedora only? See clang/include/clang/Driver/Distro.h for IsDebian/IsRedhat() helpers.

yaxunl added inline comments.Oct 12 2022, 11:04 AM
clang/lib/Driver/ToolChains/AMDGPU.cpp
311

I think other Linux distributions may adopt it too, since /usr is the standard location.

tra added inline comments.Oct 12 2022, 11:21 AM
clang/lib/Driver/ToolChains/AMDGPU.cpp
311

Or they may do something completely different. I've been surprised in the past by how NVIDIA packages get split in different ways on different distributions.

I'm fine with using established locations where we do have them, but I'm reluctant to add something open-ended that we do not need and which may be hard to change later. Expanding the scope of the search if/when we need it somewhere is easy, removing things that users may have grown to depend on is often hard.

yaxunl marked an inline comment as done.Oct 12 2022, 3:38 PM
yaxunl added inline comments.
clang/lib/Driver/ToolChains/AMDGPU.cpp
311

Makes sense. will do.

yaxunl updated this revision to Diff 467282.Oct 12 2022, 3:39 PM
yaxunl marked an inline comment as done.

only check /usr and/usr/local for debian and redhat

tra accepted this revision.Oct 12 2022, 3:48 PM
This revision is now accepted and ready to land.Oct 12 2022, 3:48 PM
This revision was automatically updated to reflect the committed changes.
Herald added a project: Restricted Project. · View Herald TranscriptOct 12 2022, 7:59 PM