Open linehill opened 2 years ago
The code was originally generated by the latest llvm-spirv tool from the llvm_release_140.
intel-graphics-compiler (used by compute-runtime to compile SPIRV / shaders), does not support LLVM 14 quite yet: https://github.com/intel/intel-graphics-compiler/pull/242
And there's an issue with LLVM 13: https://github.com/intel/intel-graphics-compiler/issues/236
LLVM 11 is best supported, but LLVM 12 should work too. Do you get that issue also with either of those, or is it LLVM 14 specific?
(Everything in the compute stack obviously needs to be using same LLVM version because LLVM changes its API in every major release.)
Do you get that issue also with either of those, or is it LLVM 14 specific?
I don’t think the issue is strictly specific to a LLVM version but to the llvm-spirv tool revision we use in the CHIP-SPV. Nevertheless, the LLVM version should not matter as the pasted code is valid SPIR-V, right?
It matters whether you've compiled everything in compute stack with same LLVM and llv-spirv version or not, and which LLVM version you use for this. Mixing different LLVM versions won't work (because LLVM breaks API between major versions), neither does mixing llvm-spirv versions, and LLVM 14 is not yet supported by IGC, so using "llvm_release_140" won't work (yet) either.
For details, see the tickets I listed for LLVM version support, and this one for SPIRV side of it: https://github.com/intel/intel-graphics-compiler/issues/224
I’m using released binaries of the compute runtime from https://github.com/intel/compute-runtime/releases so the versions of the components should be matching. Not sure if you are trying to tell that SPIR-V binary produced by llvm-spirv-14 is incompatible for LLVM 11 based compute runtime. Is that the case?
Not sure if you are trying to tell that SPIR-V binary produced by llvm-spirv-14 is incompatible for LLVM 11 based compute runtime. Is that the case?
From https://github.com/intel/intel-graphics-compiler/issues/224
"libLLVMSPIRVLib used by OpenCL-clang and Vector Compiler must be the same ... If you want to build your own SPIRV_TRANSLATOR, you need to rebuild openCL-clang."
And OpenCL-clang needs to be built by same LLVM as rest of the compute stack, for LLVM API change reasons.
=> You should at least try a stack where everything is built using same versions of both LLVM and SPIRV, to see whether your problem goes away
Sorry, perhaps there are missing critical details to the issue: We (CHIP-SPV) are not compiling kernels from OpenCL sources but from HIP sources and we pass the produced SPIR-V modules through OpenCL API via clCreateProgramWithIL().
AFAIK, the OpenCL, SPIR-V and OpenCL SPIR-V Environment specification does not impose restrictions on how the SPIR-V binaries are created as long as the binaries are valid SPIR-V (the pasted code in the above should be valid SPIR-V). Let me know if this is not the case.
Hey folks, this looks like a problem addressed with this commit: https://github.com/intel/intel-graphics-compiler/commit/6a13fa903f380e17378286a7cd43995b0ae162ad. This change should land in a binary release expected next week.
Hey folks, this looks like a problem addressed with this commit: intel/intel-graphics-compiler@6a13fa9. This change should land in a binary release expected next week.
Thank you @kmazurki !
@kmazurki When can these changes be expected to land for users of the oclcpuexp package? Daily builds on intel/llvm don't sport that package, only full releases have that asset. We'd like to use the streamlined CLI for SPIR-V compilation which only Clang 14 has.
There is a user on the Intel OpenCL forums who is also encountering this issue also after updating drivers: link.
Is there a workaround?
CC @biggysmith (I think this is the same submitter)
yes I'm the same submitter. I also get the additional ".1"
clGetKernelInfo()
incorrectly reports that thesaxpy
kernel, as shown in the following SPIR-V listing, has eight kernel arguments instead of four - the original amount.Attempting to launch the kernel with the original amount of arguments fails too.
The code was originally generated by the latest
llvm-spirv
tool from thellvm_release_140
. The issue disappears if both theOpName %saxpy "saxpy"
and“OpDecorate %saxpy LinkageAttributes "saxpy" Export”
lines are removed from the code.Test environment: OS: Ubuntu 20.04.4 LTS Intel Compute Runtime: 22.16.22992. Device: Intel(R) HD Graphics 530 [0x1912].