Dear Andreas,

Am 15.04.2013 17:19, schrieb Andreas Kloeckner:
Hi Alex,

Alexander Kläser <[email protected]> writes:
I am curious whether anyone could give me a hint what I could do to use
PyOpenCL in Ubuntu 12.10 with my NVIDIA card?

I have an Asus laptop with Optimus technology (i.e., with two graphic
cards: one simple Intel graphic card for saving energy and one NVIDIA).
After installing bumblebee, I can access the NVIDIA card using the
optirun command (e.g., "optirun ipython" for the output below). However,
it seems that the proprietary NVIDIA driver does not support OpenCL 1.2,
but only OpenCL 1.1:

====================
In [1]: import pyopencl
---------------------------------------------------------------------------
ImportError                               Traceback (most recent call last)
<ipython-input-1-63105a952239> in <module>()
----> 1 import pyopencl

/usr/lib/python2.7/dist-packages/pyopencl/__init__.py in <module>()
        2
        3 try:
----> 4     import pyopencl._cl as _cl
        5 except ImportError:
        6     import os

ImportError: /usr/lib/python2.7/dist-packages/pyopencl/_cl.so: symbol
clRetainDevice, version OPENCL_1.2 not defined in file libOpenCL.so.1
with link time reference

First of all, your problem seems to be that you've got OpenCL 1.2
headers installed, but an OpenCL library (Nvidia's) that only supports
1.1. Hence the issue.

The easiest might be to install AMD's OpenCL library (and headers). That
should give you 1.2 support (for CPUs), and it should also work against
Nvidia's 1.1 implementation.

If you're compiling PyOpenCL yourself, you can alternatively add

CL_PRETEND_VERSION = "1.1"

to siteconf.py. That should also address your issue.

Thanks a lot for your response! I quickly tried to add the line to siteconfig.py. I can then import pyopencl successfully, however, I then get the "platform not found khr" error:

====================
In [2]: import pyopencl

In [3]: pyopencl.get_platforms()
---------------------------------------------------------------------------
LogicError                                Traceback (most recent call last)
<ipython-input-3-2a778713b183> in <module>()
----> 1 pyopencl.get_platforms()

LogicError: clGetPlatformIDs failed: platform not found khr
====================

So maybe I should try then AMD's lib or a newer version of ocl-icd. Is the AMD lib supporting my Intel board with NVIDIA graphic card, as well? I did not know that?

thanks very much and best regards!
Alex


_______________________________________________
PyOpenCL mailing list
[email protected]
http://lists.tiker.net/listinfo/pyopencl

Reply via email to