VkFFT icon indicating copy to clipboard operation
VkFFT copied to clipboard

Avoid executing commands in level-zero API

Open rolandschulz opened this issue 3 years ago • 3 comments

Currently the level-zero API is calling clang and llvm-spriv to generate the spv from cl. The user might not have those in their PATH. Therefore it might be better to call oclocInvoke and link against libocloc.so. The library is distributed as part of the driver and therefore should always be available.

rolandschulz avatar Sep 16 '22 19:09 rolandschulz

I didn't want to link against OpenCL libraries in the Level Zero backend as I thought that was the main point of Level Zero - to move away from OpenCL. However, I couldn't find any runtime compiler implementation in the Level Zero core library, so I came up with the current llvm-spirv solution. So far Level Zero backend is a preparation for the Intel HPC GPUs and maybe the API will change closer to their release. Otherwise, I can switch to using the OpenCL compiler if more people want it.

Best regards, Dmitrii

DTolm avatar Sep 19 '22 11:09 DTolm

Note that the proposed solution doesn't link against OpenCL but ocloc (the igc offline compiler). This works even if the OpenCL runtime isn't available.

rolandschulz avatar Sep 19 '22 15:09 rolandschulz

Judging by this:

https://www.intel.com/content/www/us/en/develop/documentation/oneapi-dpcpp-cpp-compiler-dev-guide-and-reference/top/compilation/ahead-of-time-compilation.html

Ocloc is not packaged with the Linux version of Intel® oneAPI DPC++/C++ Compiler. On Windows, I was unable to link to it as well - my oneAPI release didn't ship ocloc ocloc_api.h includes and lib with it, only external exe compiler, which is not much better solution than llvm.

Another link I found on people doing similar JIT/AOT compilation is:

https://developer.blender.org/T96840

And they use llvm (my current approach) to do JIT. Maybe fixing the path requirement to llvm compiler will be an easier approach than linking to ocloc.

Best regards, Dmitrii

DTolm avatar Sep 27 '22 12:09 DTolm