Dnia 2013-04-14, nie o godzinie 22:05 +0200, Alexander Kläser pisze:
> Dear all,
> 
> 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:

Yes - NVIDIA supports only OpenCL 1.1.
I have not tested on Kepler, but Fermi and lower have only 1.1 support.

> 
> ====================
> 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
> ====================
> 
> When forcing Python to use the library ocl-icd-libopencl1, instead I run 
> in to a differen error:
> 
> ====================
> In [1]: import pyopencl
> 
> In [2]: pyopencl.get_platforms()
> ---------------------------------------------------------------------------
> LogicError                                Traceback (most recent call last)
> <ipython-input-2-2a778713b183> in <module>()
> ----> 1 pyopencl.get_platforms()
> 
> LogicError: clGetPlatformIDs failed: platform not found khr

That's strange.
Part of this problem might be related to OpenCL version mismatch:
ocl-icd supports OpenCL 1.2 while NVIDIA 1.1 - I've had problems
with PyOpenCL and images under NVIDIA.

BTW - have you recompiled PyOpenCL after switching to ocl-icd?
Also, have you built ocl-icd from source, or is it packaged
for Ubuntu?

> ====================
> 
> For Ubuntu 13.04, it seems that the same problem will persist. Does 
> anyone have a hint how to circumvent this problem?

There's been some changes in Ubuntu regarding NVIDIA drivers
and running programs on them, mostly related to CUDA,
but maybe they've changed something relating to OpenCL:
https://bugs.launchpad.net/bugs/950963
You might want to look at this bug, and related ones.

> 
> thanks a lot in advance and best regards
> Alex
> 
> ps: BTW, I found the following site which offers a workaround through a 
> dummy package to install pyopencl from Ubuntu repositories:
> 
> http://tuxicate.blogspot.de/2013/04/opencl-python-and-ubuntu-1210.html
> 
> 
> 
> 
> _______________________________________________
> PyOpenCL mailing list
> [email protected]
> http://lists.tiker.net/listinfo/pyopencl

-- 
Tomasz Rybak  GPG/PGP key ID: 2AD5 9860
Fingerprint A481 824E 7DD3 9C0E C40A  488E C654 FB33 2AD5 9860
http://member.acm.org/~tomaszrybak

Attachment: signature.asc
Description: This is a digitally signed message part

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

Reply via email to