ROCm: `/etc/OpenCL/vendors/amdocl64.icd` doesn't use absolute paths and/or not in a default LD_LIBRARY_PATH
Something does install /etc/OpenCL/vendors/amdocl64.icd but it isn’t in any package, so I suspect this is put there by some post-install script, which feels unnecessary.
Also it simply doesn’t work because it is only using the name of the .so file without the path:
$ cat /etc/OpenCL/vendors/amdocl64.icd
libamdocl64.so
$
So by default ocl-icd-libopencl1 (providing /usr/lib/x86_64-linux-gnu/libOpenCL.so.1.0.0) will not be able to find it and simply ignore it.
Tested with clinfo version 2.2.18.04.06-1 (https://github.com/Oblomov/clinfo) and ocl-icd-libopencl1 version 2.2.12-4 ( https://forge.imag.fr/projects/ocl-icd/ ) generic loader.
$ clinfo | egrep -i 'Parallel|HSA'
$
Putting absolute path into the icd defintion:
$ cat /etc/OpenCL/vendors/amdocl64.icd
/opt/rocm-3.5.0/opencl/lib/libamdocl64.so
$
solves it:
$ clinfo | egrep -i 'Parallel|HSA'
Platform Name AMD Accelerated Parallel Processing
Platform Name AMD Accelerated Parallel Processing
Driver Version 3137.0 (HSA1.1,LC)
$
About this issue
- Original URL
- State: closed
- Created 4 years ago
- Reactions: 8
- Comments: 15
Still broken in ROCm 3.9.0.
I believe I found the issue.
the
postinstscript of therocm-opencl3.9.0uses wrong paths:As you can see the
do_ldconfigfunction uses wrong paths, and the file in ld.so.conf.d is not versioned properly.The issue is, that it is not really possible to have two different versions installed and both present in ld.so.conf.d. It must be one.
This should probably be managed using debian alternative mechanism.
I am just asking to do this so it is easier to install and use ROCm, needing to modify
LD_LIBRARY_PATHandPATHfor every user or even modifying it system wide is a pain.With all paths encoded properly one would not need to mess with this, and it will work out of the box after installing deb packages.
Multiple versions of ROCm installed at the same time can be handled in Debian and Ubuntu using
update-alternatives(1)mechanism, which will still make it all work out of the box nicely.In my installation there are hsa files in
/etc/ld.so.conf.d/, but non of them has/opt/rocm-3.5.0/opencl/lib/path, so ld can’t actually find it:Also there are wrong paths there:
Here are the files:
Adding it one to point to the opencl and reruning ldconfig, it does start to work:
So, my bug is still valid icd file shoudl either use absolute path (it will work with
dlopen, and I tested it), or in default LD_LIBRARY_PATH (or inld.so.conf.ddirectory). But in my installation it isn’t.PS. The
clinfoin rocm is a different clinfo that I use, but I use Oblomov’s clinfo, because it is in my PATH by default, I know it works fine with Nvidia, Intel and Mesa Clover and pocl OpenCL implementations, and I don’t want to loose compatibility. And I didn’t want to use clinfo bundled with rocm, because I would suspect it has own hardcoded path and/or uses own location to figure the location of the rocm OpenCL loader, which I shouldn’t too use.It seems that the right way to fix that is to add a file to /etc/ld.so.conf.d/ which will contain a path to /opt/rocm-VERSION/opencl/lib/.
And this file should be in rocm-opencl package.