-
Notifications
You must be signed in to change notification settings - Fork 2.1k
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
New packages: ROCm core and OpenCL #21153
Conversation
7ebde26
to
804feb8
Compare
d0c9cf7
to
5983d9c
Compare
Some updates:
I believe this is ready for roll-out, although individual OpenCL-aware programs will need special handling to support ROCm. The incompatibilities between The library rename in In most cases, I think OpenCL-aware packages can be custom-built to support ROCm with a build option that toggles a few simple things. This PR includes a modified |
3fbceea
to
2c48c94
Compare
Still more updates:
I hope that, with these new changes, ROCm will "just work" with (the majority of) the OpenCL-aware packages in the Void repos. I've left the |
Hey, awesome work so far. For my purposes I built and installed
|
Thanks for recording this. LD_LIBRARY_PATH is not necessary anymore because the reworked packages install libraries in I suspect you ran
I've filed an issue upstream to address this problematic behavior. |
afd1d81
to
b5d10ba
Compare
@ahesford thank you for the explanation. I'm not sure if there is a violation (by the repo) if no binary is distributed and the package is built at the user's end, but either way, Void packaging has rules and I understand that. I won't keep expecting the possibility of an opencl-amd package on Void anymore and I will keep an eye on this. Again, thank you. @fosslinux there is also nothing pushing me to replace Manjaro on my main system that works well for me and keep using Void only on my 10 year old laptop. Which is ok, that's the beauty of Linux after all. |
@FiCacador Nope, there isn't, and I don't see how that is relevant to my point. I don't have any problem with you using Manjaro! |
Ping? |
The reliance on a custom LLVM fork has raised some eyebrows, so I put this on the back burner for awhile. It also seems like official dpkg builds rely on the deprecated clang-ocl, while official docs recommend using the setup I put in place here. To make matters worse, the 3.5 release seemed to reshuffle the components a bit more, and I haven't been terribly interested in updating everything for the new version. |
Hm. That is interesting; why does it need a custom LLVM fork? |
fa43030
to
8fb59c8
Compare
I'm not sure what changes are in the AMD fork, but they want the code object manager and device libs to be compiled with their own version. |
Wouldn't it be better to use the official package names as provided in the docs to maintain consistency with Ubuntu, SLES, CentOS, Arch and Gentoo? I'm currently working on packaging the rest of the ROCm stack (namely the HIP* libs), and would like to know which naming scheme to use for consistency. |
Void naming policy is to use the upstream repo names, not invent our own names, even when they would be consistent with packages in other distributions. |
@ahesford I have a diff for ROCm 3.10.0 and will update for 4.0.0 shortly, would you like me to open a new PR or would oyu like to pull the changes into this one? Patch attached: |
@fosslinux Open a new one; this discussion is stale. |
This may be revisited some day, but today is not the day. |
This PR includes several packages designed to bring the OpenCL portion of the AMD ROCm ecosystem to Void. It addresses Issue #19507. There are many other packages that AMD provides for GPGPU computing, but these can be added piecemeal as users demand.
The packages are currently only for
x86_64*
. While at least some of the packages will compile on other 64-bit architectures, I have no hardware to test. They are certainly not suitable for 32-bit architectures; some internal data structures rely onuint64_t
values that are cast to pointers. At aminimum, a thorough audit would be necessary to ensure that these casts are safe (e.g., that the values stored were only ever upcast from 32-bit pointers). More extensive work may be necessary to support 32-bit architectures, probably without significant benefit.
The packages successfully identify a Radeon RX 580 on an
x86_64
installation using bothclinfo
androcminfo
as provided. Furthermore, a version ofpyopencl
linked against these ROCm packages successfully runs a simple program that validates arithmetic on GPU-bound arrays.There are caveats with this set of packages, almost all of which revolve around the incompatibilities between the Void-provided
ocl-icd
and the Khronos OpenCL ICD loader required by (and built into)rocm-opencl-runtime
./opt/rocm
. This keeps the environment closer to that officially sanctioned by AMD and helps avoid conflicts between other packages and those provided here. (For example,clinfo
and the ICD loader itself.) Eventually, we may be able to move the files into/usr
.rocm-opencl-runtime
is an outdated, pre-release commit. If AMD can update its sources to use the release version of that loader (which has a backward-incompatible API change), we may be able to make ROCm compatible withocl-icd
or replaceocl-icd
with the official Khronos loader.shlibs
conflicts, the OpenCL ICD loader is installed as/opt/rocm/lib/libOpenCL-ROCm.so
(and an appropriately versioned shared library), which means that programs wishing to use the ROCm OpenCL must explicitly link against this library instead of the genericlibOpenCL.so
.ocl-icd
, orocl-icd
be replaced by the Khronos loader. However, because the Khronos loader changed its API for the release version, such a change is not yet appropriate.Hopefully, if AMD updates its dependence on the Khronos ICD loader, we can resolve some of these caveats in the future and make ROCm a more natural Void component. For now, these packages are useful for those who need an AMD OpenCL solution and would rather custom-link software against the AMD ICD loader than hack the
amdgpu-pro
driver into an ICD compatible withocl-icd
.Some patches were made to relocate some files in
/opt/rocm
and make everyting build on x86_64-musl`. Where appropriate, these patches will be pushed upstream to clean up the distribution and packaging.Update: I pushed some new commits to update license information that triggerd an
xlint
failure. I've also disabled CI builds because they will time out onrocm-llvm
.