I've been working with pyopencl on my Macbook. I installed miniconda and installed pyopencl from there by using these instructions.
On my Mac everything works fine, I can run a small example program and it works.
I then tried to use pyopencl on my Windows 10 desktop PC as that has a proper GPU (Nvidia GeForce GTX 1080TI) but I can't seem to get it it work with the same example program.
Like with the Mac I followed these instructions and installed miniconda and then pyopencl.
However when I run my example program I get the following error:
C:\Users\Grant\Desktop\Exercises-Solutions-1.2.1\Exercises\Exercise03\Python>python vadd.py
Traceback (most recent call last):
File "vadd.py", line 13, in <module>
import pyopencl as cl
File "C:\ProgramData\Miniconda3\lib\site-packages\pyopencl\__init__.py", line 29, in <module>
import pyopencl.cltypes # noqa: F401
File "C:\ProgramData\Miniconda3\lib\site-packages\pyopencl\cltypes.py", line 22, in <module>
from pyopencl.tools import get_or_register_dtype
File "C:\ProgramData\Miniconda3\lib\site-packages\pyopencl\tools.py", line 37, in <module>
from pyopencl._cl import bitlog2 # noqa: F401
ImportError: DLL load failed while importing _cl: The specified procedure could not be found.
This is what I have installed via conda:
C:\Users\Grant\Desktop\Exercises-Solutions-1.2.1\Exercises\Exercise03\Python>conda list
# packages in environment at C:\ProgramData\Miniconda3:
#
# Name Version Build Channel
appdirs 1.4.3 py_1 conda-forge
ca-certificates 2020.6.20 hecda079_0 conda-forge
certifi 2020.6.20 py38h9bdc248_2 conda-forge
cffi 1.14.0 py38h7a1dbc1_0
chardet 3.0.4 py38_1003
conda 4.8.5 py38h9bdc248_2 conda-forge
conda-package-handling 1.6.1 py38h62dcd97_0
console_shortcut 0.1.1 4
cryptography 2.9.2 py38h7a1dbc1_0
decorator 4.4.2 py_0 conda-forge
idna 2.9 py_1
intel-openmp 2020.1 216
khronos-opencl-icd-loader 2020.06.16 h62dcd97_1 conda-forge
libblas 3.8.0 16_mkl conda-forge
libcblas 3.8.0 16_mkl conda-forge
liblapack 3.8.0 16_mkl conda-forge
mako 1.1.3 pyh9f0ad1d_0 conda-forge
markupsafe 1.1.1 py38hab1e662_2 conda-forge
menuinst 1.4.16 py38he774522_0
mkl 2020.1 216
numpy 1.19.2 py38hdf1ac2f_1 conda-forge
openssl 1.1.1h he774522_0 conda-forge
pip 20.0.2 py38_3
powershell_shortcut 0.0.1 3
pycosat 0.6.3 py38he774522_0
pycparser 2.20 py_0
pyopencl 2020.2.2 py38hfd46600_1 conda-forge
pyopenssl 19.1.0 py38_0
pysocks 1.7.1 py38_0
python 3.8.3 he1778fa_0
python_abi 3.8 1_cp38 conda-forge
pytools 2020.4 pyh9f0ad1d_0 conda-forge
pywin32 227 py38he774522_1
requests 2.23.0 py38_0
ruamel_yaml 0.15.87 py38he774522_0
setuptools 46.4.0 py38_0
six 1.14.0 py38_0
sqlite 3.31.1 h2a8f88b_1
tqdm 4.46.0 py_0
urllib3 1.25.8 py38_0
vc 14.1 h0510ff6_4
vs2015_runtime 14.16.27012 hf0eaf9b_1
wheel 0.34.2 py38_0
win_inet_pton 1.1.0 py38_0
wincertstore 0.2 py38_0
yaml 0.1.7 hc54c509_2
zlib 1.2.11 h62dcd97_4
I'm not sure If I'm missing something but it can't seem to find the DLL, so with that I tried ensuring my GPU drivers were up to date, that didn't work so then I tried to install the Nvidia CUDA toolkit. Once again this has no affect and the problem persists.
The only possible clue I have is that in the miniconda installation directory on my Macbook there is a OpenCl folder followed by a vendor folder that has an apple.icd file in.
miniconda3/etc/OpenCL/vendors/apple.icd.
However my miniconda install directory on my Windows PC seems to be missing that OpenCL folder, and by virtue the vendors folder and .icd file.
C:\ProgramData\Miniconda3\etc>dir
Volume in drive C has no label.
Volume Serial Number is 4E38-45B0
Directory of C:\ProgramData\Miniconda3\etc
12/10/2020 17:54 <DIR> .
12/10/2020 17:54 <DIR> ..
12/10/2020 17:54 <DIR> fish
12/10/2020 18:04 <DIR> profile.d
0 File(s) 0 bytes
4 Dir(s) 37,407,539,200 bytes free
This to me points to the cause of the issue, but I'm not sure. And even if it is I don't know what I'd need to do to produce this .icd file.
Any help would be appreciated.