-
Notifications
You must be signed in to change notification settings - Fork 721
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
[Experimental CPU runtime] Clashes with system libraries #453
Comments
Experimental results on Haswell, running the PyOpenCL test suite: Without setting
With setting
|
@inducer I'm afraid I didn't get you. Does setting
If you wish to do so, I strongly recommend you using latest and greatest Khronos ICD. You see, AFAIK Intel is the only vendor that ships OpenCL 2.1. Other implementations may be incompatible. On the other hand, vanilla ICD may break other drivers if they use some proprietary APIs (highly unlikely, though). |
What I'm meaning to suggest is that you rename your
(and similarly for all other shared library names for which there is potential for conflict with system libraries) |
@inducer ok, I see. Fair point, because on Windows |
@inducer It is not advised to rename libtbb.so library. By default each shared library on Linux exports all symbols. If an application uses both TBB and OpenCL, renamed library may cause ambiguity. This leads to stability issues for many applications. Furthermore, two thread pools are created, implying performance degradation. However, TBB team maintains backward compatibility. This means that you can replace an old TBB library with a newer one without problems. So, as a workaround I suggest you updating you system-wide TBB library to the latest version and remove OpenCL libtbb.so from your LD_LIBRARY_PATH. |
Thanks for your advice! Unfortunately, your suggested solution doesn't quite work for me. I have a Debian-packaged version of TBB 2019 Update 8 on my system, however it appears that that is incompatible with the CL runtime binary in a way that the shipped TBB is not. |
@inducer can you please provide us with more information then? Please, run your OpenCL app like this
and share your log file with us. |
@inducer from what I can see in logs, the main difference between two runs is that when LD_LIBRARY_PATH is set, you use OpenCL ICD (Installable Client Driver) from Intel experimental OpenCL CPU Runtime. A great explanation of how these things work can be found here https://bashbaug.github.io/opencl/2019/07/06/OpenCL-On-Linux.html. I'm not sure about the origin of your system-wide ICD, but I suppose it is a bit outdated. This may cause some compatibility problems. If I were you, I'd try updating it to latest version. You cat search in apt repositories for a newer version (apt-cache search ocl-icd should list you available packages). Alternatively, you can download latest version from Khronos GitHub page https://github.com/KhronosGroup/OpenCL-ICD-Loader and build manually. I hope this helps you with your issue. |
@inducer can you please confirm/deny your issue is resolved? |
Could you point me to the source code for the runtime? (I can't seem to find it in the source tarball distributed along the binary release.) Without that, it's hard for me to determine whether my ICD loader (https://github.com/OCL-dev/ocl-icd, latest version, default in Debian) is doing something wrong. |
The source code is proprietary, you can’t get access to it. |
@inducer if you still experience problems, please reopen this issue. |
I would very much like to use the Intel CPU ICD, but it is (IMO) unnecessarily logistically difficult for me to do so, because the runtime ships with multiple shared objects that clash with system libraries, including
libtbb.so.2
andlibOpenCL.so.2
. If I use the Intel CPU runtime without configuring the dynamic linker path to include/prefer the path of the Intel CPU CL runtime, then I get nothing but crashes (segfaults) out of the runtime, since the system-built libraries are ostensibly different from the ones shipped with the CL runtime. On the other hand, if I set (e.g.)$LD_LIBRARY_PATH
to the path to the runtime, the runtime works as intended, but now everything on my system uses the (presumably slightly incompatible) libraries shipped with the runtime.Would it be possible to build binaries of the runtime with shared libraries that do not clash with other shared objects present on a standard Linux system? Thanks!
The text was updated successfully, but these errors were encountered: