A quick note on the error:
clGetPlatformIDs failed: <unknown error -1001>. This error message is quite confusing and various fixes for different possible causes are all over the Internet.
Usually this error message indicates that the OpenCL drivers are not installed properly. Check:
- Both pocl and pyopencl are installed from conda-forge
- icd files under
If your situation is just like mine, where everything appeared to be normal, but the issue persists, you may try to set the environment variable
OCL_ICD_VENDORS to be what the icd file points to. For example, this fixes the issue for me:
$ OCL_ICD_VENDORS="$HOME/miniconda3/libpocl.so.2.1.0" python
Once this fixes the issue for you, you can also automate the process of setting this environment variable by creating a shell script in the environment’s directory. See https://conda.io/docs/user-guide/tasks/manage-environments.html#macos-and-linux for detailed instructions.