Skip to content

dpctl should better query SYCL run-times for actually available backends. #139

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

Closed
oleksandr-pavlyk opened this issue Oct 15, 2020 · 2 comments
Labels
bug Something isn't working

Comments

@oleksandr-pavlyk
Copy link
Contributor

On a machine without CUDA card, seeting SYCL_BE=PI_CUDA is equivalent to telling SYCL to only expose default host backend.

SYCL_BE=PI_CUDA python -c "import dpctl; dpctl.dump()" shows 4 platforms available, and yet attempting to set it throws errors whose handling is to be improved:

(idp) [16:48:01 linbox work]$ SYCL_BE=PI_CUDA python -c "import dpctl; dpctl.set_default_queue('opencl', 'cpu', 0)"
active queue vector is corrupted.
Traceback (most recent call last):
  File "<string>", line 1, in <module>
  File "dpctl/sycl_core.pyx", line 721, in dpctl._sycl_core._SyclRTManager.set_default_queue
AttributeError: 'dpctl._sycl_core._SyclRTManager' object has no attribute '_raise_queue_creation_error'

@diptorupd @PokhodenkoSA

@diptorupd diptorupd added the bug Something isn't working label Oct 16, 2020
@diptorupd
Copy link
Contributor

@oleksandr-pavlyk Is this issue getting fixed by any of the changes we have recently made to device manager and queue manager?

@oleksandr-pavlyk
Copy link
Contributor Author

set_default_queue is now set_global_queue, and even this could change (can be removed in not so distance future), but it now works correctly:

(idp) [18:33:29 nuc04 dpctl]$ SYCL_DEVICE_FILTER=cuda python -c "import dpctl; dpctl.set_global_queue('opencl:cpu:0')"
Could not find a device that matches the specified filter(s)! -1 (CL_DEVICE_NOT_FOUND)
Traceback (most recent call last):
  File "<string>", line 1, in <module>
  File "dpctl/_sycl_queue_manager.pyx", line 157, in dpctl._sycl_queue_manager._SyclQueueManager.set_global_queue
    q_obj = SyclQueue(arg)
  File "dpctl/_sycl_queue.pyx", line 233, in dpctl._sycl_queue.SyclQueue.__cinit__
    raise SyclQueueCreationError(
dpctl._sycl_queue.SyclQueueCreationError: SYCL Device 'opencl:cpu:0' could not be created.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants