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

Rocm Backend: Fix regex for detecting version in Linux #4

Merged
merged 1 commit into from
Apr 23, 2024

Conversation

DGdev91
Copy link
Contributor

@DGdev91 DGdev91 commented Apr 23, 2024

Hi, i'm trying out your library on my machine, but i can't use the ROCm backend on Linux
i'm using ArchLinux and rocm 6.0.2 (the version currently included in official arch repos)

The output from hipconfig is something like this:

HIP version  : 6.0.32831-

== hipconfig
HIP_PATH     : /opt/rocm
ROCM_PATH    : /opt/rocm
HIP_COMPILER : clang
HIP_PLATFORM : amd
HIP_RUNTIME  : rocclr
.......

...and so on.

As you can see HIP_PATH points to /opt/rocm, and it's not possible to find out rocm's version from there. but we can use the "HIP version" string just on top.

Also, the $ at the end makes the regex never match if there are other characters after the matched string, wich is not what we want.

I made a new regex wich takes the version from "HIP version"

also.... i'm not sure that checking just the major version is enough, but we can talk about that in another thread

@DarthAffe
Copy link
Owner

Hey, thanks for contributing.
that's interesting - the hipconfig output this is based on had shown the version in the path (but since I don't own a device on my own I just had to take what others sent me) - maybe there is a difference between distributions.
But this is a better solution and should work in all cases.

Checking only the major version should be fine (at least as far as I know there aren't breaking changes between minor versions)

@DarthAffe DarthAffe merged commit 09355fc into DarthAffe:master Apr 23, 2024
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

Successfully merging this pull request may close these issues.

None yet

2 participants