Closed AwesomeCronk closed 2 years ago
I can't reproduce this. If I build with
CL_PRETEND_VERSION = '2.1'
in siteconf.py
, run
rm -Rf build; python setup.py develop
Then I get
$ nm --dynamic pyopencl/_cl.cpython-310-x86_64-linux-gnu.so |grep Specialization
returning no results.
The symbol is also #ifdef
'd with the correct version in the header:
https://github.com/inducer/pyopencl/blob/291649892f4972e46c5823bfa359b37ad94d6cd5/src/wrap_cl.hpp#L4048-L4057=
Interesting...
As a side note, if I cat /etc/OpenCL/vendors/intel.icd
(the only .icd
there) I get this:
/usr/lib/x86_64-linux-gnu/intel-opencl/libigdrcl.so
So then might the issue be in how I installed the ICD or elsewhere?
I will try building it tonight, unless that's what pip install -e .
does already.
Almost certainly this has nothing to do with your ICD, as the failing symbol lookup
ImportError: /home/aweso/Source/Python/pyopencl/pyopencl/_cl.cpython-38-x86_64-linux-gnu.so: undefined symbol: clSetProgramSpecializationConstant
is against the ICD loader.
The easiest way to get a working setup is to use conda forge, as described here.
Interestingly enough, when I install using either Conda or Pip, it's stable and import pyopencl
works. However, pyopencl.have_gl()
returns False
, confimed by the fact that get_gl_sharing_context_properties()
does this:
Traceback (most recent call last):
File "PyOpenCL_GL.py", line 96, in initializeGL
self.initialize_buffers()
File "PyOpenCL_GL.py", line 56, in initialize_buffers
self.ctx, self.queue = clinit()
File "PyOpenCL_GL.py", line 34, in clinit
+ get_gl_sharing_context_properties())
File "/home/aweso/.local/lib/python3.8/site-packages/pyopencl/tools.py", line 502, in get_gl_sharing_context_properties
(ctx_props.GL_CONTEXT_KHR, GLX.glXGetCurrentContext()))
AttributeError: type object 'pyopencl._cl.context_properties' has no attribute 'GL_CONTEXT_KHR'
I do need OpenGL interop support, which is why I tried installing from the git repo.
Tried building from source via the tar.gz at https://pypi.org/project/pyopencl/#files, same problem as building from the git version.
Intel NEO doesn't support CL-GL interops on Linux. That's the issue, not anything to do with PyOpenCL...
Describe the bug I am trying to install PyOpenCL with OpenGL interop support. When I
import pyopencl
this traceback is generated:I have found that the symbol in question is an OpenCL 2.2 symbol, but the ICD loader on my system only supports 2.1 for my CPU. This is my
siteconf.py
:To Reproduce Steps to reproduce the behavior:
$ sudo apt install intel-opencl-icd
$ git clone https://github.com/inducer/pyopencl; cd pyopencl
$ python3 configure.py --cl-enable-gl --cl-pretend-version=2.1
$ python3 -m pip install -e .
import pyopencl
. The above traceback is generated.Expected behavior Setting
CL_PRETEND_VERSION
to2.1
should inform PyOpenCL that 2.2 symbols aren't available and shouldn't be used.Environment (please complete the following information):
Additional context This machine has no dedicated GPU.