-
Notifications
You must be signed in to change notification settings - Fork 753
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
sycl-for-cuda documentation is inaccurate with the updated plugin system ? #1161
Comments
@fwyzard, thank you for trying it out and sharing the results of your experiments. |
@bader thanks for your comments. Since it looks like both OpenCL and CUDA plugins are always available (if built), what is the purpose of the One aspect that could be improved is to avoid listing platforms or devices for which there is no support in the binary. That is, an application compiled with |
I think someone from Codeplay team should reply. According to my understanding it might be just an artifact of old implementation version. We added runtime library support for multiple plug-ins not long ago.
I was my first thought too, but this might cause problems for applications, which don't have device code (e.g. use libraries with SYCL API). The application might just create a command queue, buffers and call some library, which has device code. |
I see your point - the part of the application that queries the devices and the part that has the device code could have been built with support for different devices. I think it would be useful to have some way for an application to know if a given device (or platform) is usable or not, for a given kernel. |
The PI interface added support for multiple backends while the MR for the CUDA backend was up. Rebasing it was more trouble than expected, @Alexander-Johnston and @bader (and others) have been working on reviewing and rebasing the MR. The SYCL_BE env var was originally used to select the backend, when multiple backend support was not available. The SYCL_BE now is only needed when the |
Thanks for the details @Ruyk . I can move my tests to the |
OK, with the recently merged
|
@fwyzard , is this still relevant? |
I think this can be closed now, @fwyzard feel free to open a new issue if something is missing! |
Signed-off-by: Dmitry Sidorov <dmitry.sidorov@intel.com> Original commit: KhronosGroup/SPIRV-LLVM-Translator@65b5d1b
I am trying the
cuda
branch (currently at 38ec8bf8f2c) and I can compile and run the simple application from the "getting started" guide.However, the behaviour of the plugin system does not seem to match what is documented.
According to the guide,
However, setting the
SYCL_BE
variable does not seem to make any difference.Let's build the simple application (I've added a print out of the device being used):
Check the available devices:
(there's a Tesla K40 as well, but the NVIDIA ICD has been removed to avoid even more confusion)
And run with no
SYCL_BE
variable:Set the OpenCL backend:
OK, so far so good. Now with the CUDA backend:
Ehm, what ?
Something similar happens with the CUDA backend.
Let's rebuild the application with CUDA support:
Try with the default selector:
That didn't work... maybe setting the plugin explicitly ?
Nope.
OK, remove all ICDs and try again:
So, it does work.
And without the
SYCL_BE
variable ?Still works.
What if I force the OpenCL plugin ?
It still works !
So, it seems that the
SYCL_BE
variable is not needed any more, and in fact it is mostly ignored:The only value with any effect seems to be
PI_OTHER
:An other interesting and possibly undocumented result: it looks like it is possible to build a binary that supports both OpenCL and CUDA backends:
Magic !
The text was updated successfully, but these errors were encountered: