You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
So pyopencl does not find platforms whose shared objects are found in the OCL_ICD_FILENAMES environment variable. I'm not sure why since get_platforms simply wraps clGetPlatformIDs, doesn't it?
The text was updated successfully, but these errors were encountered:
Apparently this is because of the ICD loader pyopencl uses. Khronos own ICD loader supports environment variables but ocl-icd does not: https://github.com/KhronosGroup/OpenCL-ICD-Loader Looking at repo activity it seems ocl-icd doesn't get many updates.
PyOpenCL is not specific to any ICD loader, it works with Khronos and other loaders. The wheel also does not ship a specific loader.
For user convenience, the wheels do include an ICD loader: that's ocl-icd on Windows and Mac, and Khronos on Windows. You can always build from source and avoid this.
If you need a Linux/Mac wheel with Khronos, I'm happy to consider PRs that either replace ocl-icd or offer Khronos as an alternative.
Ah, ok. I think I understand what is going on. The pip package puts a libOpenCL.so file in a ".libs" directory which shadows the system-installed libOpenCL.so. This libOpenCL.so comes from ocl-icd and not from Khronos official ICD loader. Shadowing system libraries is always dubious. Honestly, on Linux not including any ICD loader would be better since the user likely already has one installed. And if they don't it's just one "apt-get install ocl-icd" away. If not that then swapping ocl-icd with Kronos' ICD loader would be good. It appears to be more feature-complete and better maintained.
MWE:
So pyopencl does not find platforms whose shared objects are found in the
OCL_ICD_FILENAMES
environment variable. I'm not sure why sinceget_platforms
simply wrapsclGetPlatformIDs
, doesn't it?The text was updated successfully, but these errors were encountered: