GEGL should provide a way to check if OpenCL is enabled/why it is not used (via gobject-introspection)
I wanted to benchmark some of GEGL's OpenCL kernels but it seems as if my GEGL (0.4.14) just won't use OpenCL. Despite reading the source I don't really know what is going wrong.
This issue is only partly about "how to get OpenCL working on my machine?" but more about some logging/diagnostic API so a user could get information why OpenCL is not used.
What I did:
- installed pocl (OpenCL implementation for CPUs)
-
clinfo
lists pocl as OpenCL provider with image support - I rebuilt Fedora's GEGL package with "--enable-debug" so that I can use
GEGL_DEBUG=yes
. -
export GEGL_DEBUG=yes; export GEGL_USE_OPENCL=yes
(I also triedGEGL_USE_OPENCL=cpu
) - run my sample application which uses
gegl:load
,gegl:mono-mixer
andgegl:save
(Python 3 via gobject introspection)
However I get exactly the same performance as if OpenCL was not enabled. Also I don't get any log messages if I set GEGL_DEBUG=opencl
(but GEGL's logging is working - if I set GEGL_USE_OPENCL=invalid
I get "Unknown value for GEGL_USE_OPENCL: invalid").
- I think GEGL should provide some way to log if OpenCL is available/to be used. If
GEGL_USE_OPENCL
is present it should also log why it was not enabled. - As a user I want to use that mechanism being available with "release" binaries (e.g. build by distros which tend to not use "--enable-debug").
- As a Python developer I'd like to check if OpenCL is in use (and possibly some information which OpenCL provider was chosen) so I can provide that information to the end user.