Skip to content

'_lasy_init' in 'silx/opencl/common.py' returns 'pyopencl._cl.LogicError: clGetDeviceIDs failed: INVALID_VALUE' in MacOS GitHub test workflow #821

Description

@tieneupin

Describe the bug
Our team uses silx and pyopencl as part of our package, and we are encountering an error when running them as part of our MacOS test workflow on GitHub (this doesn't occur for Windows or Ubuntu).

This is the error log returned by pytest when running tests in the GitHub workflow.

/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/pyFAI/detectors/__init__.py:41: in <module>
    from ._common import *
/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/pyFAI/detectors/_common.py:49: in <module>
    from .. import io
/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/pyFAI/io/__init__.py:59: in <module>
    from .integration_config import WorkerConfig
/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/pyFAI/io/integration_config.py:84: in <module>
    from ..integrator import load_engines as load_integrators
/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/pyFAI/integrator/__init__.py:43: in <module>
    from . import load_engines
/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/pyFAI/integrator/load_engines.py:233: in <module>
    from ..opencl import ocl
/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/pyFAI/opencl/__init__.py:61: in <module>
    ocl = common.ocl    # /!\ lasy loading of ocl at the silx level !!!
/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/silx/opencl/common.py:681: in __getattr__
    if ocl.nb_devices == 0:
/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/silx/opencl/common.py:406: in nb_devices
    self._lasy_init()
/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/silx/opencl/common.py:422: in _lasy_init
    for idd, device in enumerate(platform.get_devices()):
E   pyopencl._cl.LogicError: clGetDeviceIDs failed: INVALID_VALUE

Environment (please complete the following information):

  • OS: "MacOS-latest" (should map to macOS 14 (Sonoma))
  • ICD Loader and version: Unsure
  • ICD and version: Unsure
  • CPU/GPU: Unsure
  • Python version: 3.9 - 3.12
  • PyOpenCL version: 2025.1

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions