This is an archive of the discontinued LLVM Phabricator instance.

[HIP] Detect HIP for Ubuntu, Mint, Gentoo, etc.
ClosedPublic

Authored by cgmb on Apr 24 2023, 4:44 PM.

Details

Summary

HIP may be installed into /usr or /usr/local on a variety of Linux
operating systems. It may become unwieldy to list them all.

Diff Detail

Event Timeline

cgmb created this revision.Apr 24 2023, 4:44 PM
Herald added a project: Restricted Project. · View Herald TranscriptApr 24 2023, 4:44 PM
cgmb published this revision for review.Apr 24 2023, 5:36 PM

Ubuntu Lunar (23.04) has released, which is the first version of Ubuntu with ROCm support in the universe repos. With respect to ROCm, it is basically a snapshot of Debian Sid. However, since LLVM detects HIP package differently on Ubuntu than on Debian, there are additional flags required on Ubuntu that are not needed on Debian. This patch removes the differences in behaviour between distros. An alternative approach would be just to add || Dist.IsGentoo() || Dist.IsUbuntu() to the existing check, but that may still fail on Ubuntu-derived distros such as Linux Mint.

Herald added a project: Restricted Project. · View Herald TranscriptApr 24 2023, 5:36 PM
scchan accepted this revision.Apr 26 2023, 9:17 AM
This revision is now accepted and ready to land.Apr 26 2023, 9:17 AM
cgmb added a comment.May 2 2023, 11:42 PM

As far as I know, I cannot commit this change myself as I do not have write access for LLVM trunk. Please feel free to submit this change for me once it has all necessary approvals.

yaxunl accepted this revision.May 3 2023, 7:18 AM

LGTM. Thanks. I can help commit this patch.

This revision was automatically updated to reflect the committed changes.