Problems running BEMPP on Mac

I am following the installation steps to install bempp 0.2.2 from source on my mac (Catalina 10.15.7).
After installation I am getting the following error running sphere scattering example:

from bempp.api.linalg import gmres
neumann_fun, info = gmres(lhs, grid_fun, tol=1E-5)

~/audatic/bempp-cl/bempp/core/cl_helpers.py in run(self, device_interface, global_size, local_size, global_offset, wait_for, g_times_l, *args)
261 global_offset=global_offset,
262 wait_for=wait_for,
→ 263 g_times_l=g_times_l,
264 )
265

~/audatic/venv/lib/python3.7/site-packages/pyopencl/init.py in kernel_call(self, queue, global_size, local_size, *args, **kwargs)
838 # call can’t be overridden directly, so we need this
839 # trampoline hack.
→ 840 return self._enqueue(self, queue, global_size, local_size, *args, **kwargs)
841
842 def kernel_capture_call(self, filename, queue, global_size, local_size,

in enqueue_knl_evaluate(self, queue, global_size, local_size, arg0, arg1, arg2, arg3, arg4, arg5, arg6, arg7, global_offset, g_times_l, wait_for)

LogicError: clEnqueueNDRangeKernel failed: INVALID_WORK_ITEM_SIZE

I assume this is related to OpenCL but I am not quite sure how to fix it.
Does anybody have experience with this problem?

Hi. Apologies for the delayed reply. The OpenCL support under Mac is not very good. The CPU driver by Apple does not allow certain things, which are standard conform. On Mac the best way for performance is to use the Docker image. If you want to run natively then you can set the global option

bempp.api.DEFAULT_DEVICE_INTERFACE = ‘numba’

This activates the Numba fallback interface. But it is significantly slower than the OpenCL code.

Hi Timo,

I have tried the global option

bempp.api.DEFAULT_DEVICE_INTERFACE = ‘numba’

but still get the same error as SebastianK.

Hi, I have no Mac to test this. My suggestion for serious use is to run the bempp-cl Docker image on Mac. Your performance can be significantly slower if you run Numba, depending on what kernel you use.