8000 provide a better error message when no platforms found by matthiasdiener · Pull Request #826 · inducer/pyopencl · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

provide a better error message when no platforms found #826

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
May 7, 2025

Conversation

matthiasdiener
Copy link
Contributor
@matthiasdiener matthiasdiener commented Apr 16, 2025

before:

>>> import pyopencl as cl
>>> cl.create_some_context()
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/Users/mdiener/Work/e12/pyopencl/pyopencl/__init__.py", line 1708, in create_some_context
    devices = choose_devices(interactive, answers)
              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/mdiener/Work/e12/pyopencl/pyopencl/__init__.py", line 1601, in choose_devices
    platforms = get_platforms()
                ^^^^^^^^^^^^^^^
pyopencl._cl.LogicError: clGetPlatformIDs failed: PLATFORM_NOT_FOUND_KHR

after:

>>> cl.create_some_context()
Traceback (most recent call last):
  File "/Users/mdiener/Work/e12/pyopencl/pyopencl/__init__.py", line 1601, in choose_devices
    platforms = get_platforms()
                ^^^^^^^^^^^^^^^
pyopencl._cl.LogicError: clGetPlatformIDs failed: PLATFORM_NOT_FOUND_KHR

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/Users/mdiener/Work/e12/pyopencl/pyopencl/__init__.py", line 1706, in create_some_context
    devices = choose_devices(interactive, answers)
              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/mdiener/Work/e12/pyopencl/pyopencl/__init__.py", line 1607, in choose_devices
    raise RuntimeError("no CL platforms available to ICD loader, install a CL driver (such as pocl, rocm, Intel CL)") from e
pyopencl._cl.RuntimeError: no CL platforms available to ICD loader, install a CL driver (such as pocl, rocm, Intel CL)

@inducer
Copy link
Owner
inducer commented Apr 16, 2025

I'm OK with that. It might be good to add a link to pyopencl's install instructions. (https://documen.tician.de/pyopencl/misc.html) Personally, I'd also prefer to avoid naming specific ICDs in the error message.

Not sure what's up with that CI crash. Do you have an idea?

@inducer inducer enabled auto-merge (squash) May 7, 2025 14:18
@inducer inducer force-pushed the more-exp-no-platform branch from d1e0d3f to 1ef6985 Compare May 7, 2025 14:21
@inducer inducer merged commit cc44b60 into inducer:main May 7, 2025
19 checks passed
@matthiasdiener matthiasdiener deleted the more-exp-no-platform branch May 7, 2025 14:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants
0