[Pkg-opencl-devel] pocl ITP, and opencl-icd selection

Rebecca N. Palmer r.palmer at bham.ac.uk
Sat Apr 19 22:10:32 UTC 2014


(This continues the "can we avoid the need to manually choose an ICD by 
defaulting to all of them? not in their current state" thread from 
http://lists.alioth.debian.org/pipermail/pkg-opencl-devel/Week-of-Mon-20140203/000076.html 
)

I now have a working pocl package, but it isn't policy-compliant yet; 
see the ITP bug (#676504) for details.

Meanwhile mesa-opencl-icd (for Radeon GPUs) has been added, revealing 
that pyopencl can't handle a platform with no devices (e.g. wrong ICD 
for the hardware) even if the platform does properly report this: the 
clGetDevices call (src/wrapper/wrap_cl.hpp line 851) is wrapped in a 
general "throw exception on non-success return code" guard, so 
CL_DEVICE_NOT_FOUND triggers this before it gets to the specific "return 
empty list if no devices" check.

Also, if pyopencl is asked to choose a platform/device non-interactively 
(pyopencl/__init__.py around line 800), it simply chooses the first 
device of the first platform, which will fail if the first platform has 
no devices and be needlessly slow if it is the CPU.  Given that 
clGetDeviceIDs/clGetDeviceInfo do provide a way to distinguish CPUs from 
GPUs, it would be possible to do better than this.



More information about the Pkg-opencl-devel mailing list