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
[REQUEST]: Support for compiling OpenCL using NVIDIA's driver #3599
Comments
Hi! Thanks for the request, sorry we took so long to get back to you. The main problem with this specific case might be the non-standard process you mention, which would complicate things even further (As historically we've lacked the experience to implement many of the features dealing with this kind of compilers) We would really appreciate if someone could try to take a shot at this, and are happy to help where needed |
@RubenRBS : It is actually a perfectly standard process. That is, OpenCL is always compiled the way I described - and that's what you guys do, as well, I am sure. I was suggesting you do the same thing you do now, but with NVIDIA's OpenCL driver. Probably a rather minor change/addition of code, nothing really new. However - if your OpenCL-on-ARM toolchain is not really well-maintained, then I realize it would be more of a hassle. |
Oh then it's possible that I might have totally missinterpreted the situation, sorry! Let me poke around, see if I can get someone that knows what they are doing to take a look at it :) |
We don't really use drivers, for Cuda we use NVCC, but NVCC does not support OpenCL Can you tell us what the commands would be if you were to locally call them on your pc? |
@partouf :
|
@eyalroz this is what we do for the Clang Arm v8 compiler https://github.com/compiler-explorer/compiler-explorer/blob/main/etc/config/openclc.amazon.properties#L175 |
@partouf : Well, remember that "compiling OpenCL" only actually happens at runtime, from within the program. The outside program is a plain vanilla CPU-bound program. Its target is whatever the host machine is (for CUDA, that would typically be Linux). Inside the program, you need to:
I presume that's what you do on ARM as well. In step 7, and with NVIDIA's OpenCL driver, you'll get PTX-like text. |
@jzzheng22 hey, do you have an idea maybe on what this is about? |
unfortunately not sorry, but possibly @AnastasiaStulova or @StuartDBrady could help? |
I don't know if you will be able to load SPIR-V in NVIDIA drivers. But compilation into SPIR-V is already supported in Code Explorer https://godbolt.org/z/qodMKPrjv. However the dev branches are broken at the moment. Clang has PTX support https://llvm.org/docs/NVPTXUsage.html but however I don't know whether Nvidia's OpenCL driver can support PTX as it is not part of OpenCL standard in any way... However since PTX is integrated similarly to Arm support in clang it should be straightforward to enable this in Compiler Explorer if this is what this issue asks for. |
aaaah thanks @AnastasiaStulova ! I think this doc might be of help here |
It's not supported as PTX, but what NVIDIA's driver gives you, when compiling a program, is sorta-PTX. I've never tried feeding SPIR-V to NVIDIA's OpenCL driver, I'm guessing this will fail since NVIDIA makes it a point to not support anything beyond the minimum necessary for OpenCL. Or - support it only with secret software that you can't get. |
Is your feature request related to a problem? Please describe
NVIDIA is one of the popular vendors of GPUs, and its' important to see what OpenCL code compiled by its OpenCL driver would look like. Right now, you can only compile OpenCL with some kind of ARM toolchain (?)
Describe the solution you'd like
OpenCL is not compiled directly from the command line. One needs to - in a program written in another language and for the host side - read the source, then use the OpenCL host-side API to initiate a dynamic compilation. In this case the compilation should produce NVIDIA PTX code (well, sort of).
Describe alternatives you've considered
Uh... not using GodBolt?
Additional context
CUDA is already supported, albeit not via dynamic compilation, it seems.
The text was updated successfully, but these errors were encountered: