intel / intel-graphics-compiler

Other
606 stars 158 forks source link

Build error: "intrinsic is unsupported by target platform <PVCXT_A0>, enable legacy intrinsics translation" #239

Closed eero-t closed 2 years ago

eero-t commented 2 years ago

Building latest IGC release "igc-1.0.10840" with latest vc-intrinsics "v0.1.0" tag fails:

$ cmake -LH -Wno-dev -G Ninja \
  -DCMAKE_INSTALL_PREFIX=/usr/local \
  -DCMAKE_BUILD_TYPE=Release \
  -DIGC_OPTION__LLVM_PREFERRED_VERSION=12 \
  -DIGC_OPTION__SPIRV_TRANSLATOR_MODE=Source \
  -DIGC_OPTION__LINK_KHRONOS_SPIRV_TRANSLATOR=ON
...
-- +++ Source/IGC/VectorCompiler +++
-- [VC] Build proj: VectorCompiler
-- [VC] Using vc-intrinsics source from: /home/nobody/source/intel-graphics-compiler/IGC/VectorCompiler/../../../vc-intrinsics/GenXIntrinsics
...
// VCIntrinsics mode for IGC (can be Source, Prebuilds or empty)
IGC_OPTION__VC_INTRINSICS_MODE:STRING=
...
$ ninja
...
[930/1037] vc_build_bif: Link /home/nobody/source/intel-graphics-compiler/build/IGC/VectorCompiler/lib/BiF/spirv_math_builtins_genx.cpp.64.clang.bc;/home/nobody/source/intel-graphics-compiler/build/IGC/VectorCompiler/lib/BiF/spirv_atomic_builtins_genx.cpp.64.clang.bc;/home/nobody/source/intel-graphics-compiler/build/IGC/VectorCompiler/lib/BiF/spirv_exec_builtins_genx.cpp.64.clang.bc  together to BC VCSPIRVBuiltins64.clang.bc
[931/1037] vc_build_bif: Translating CMCL builtins:  VCSPIRVBuiltins64.clang.bc -> VCSPIRVBuiltins64.cmcl.bc
[932/1037] vc_build_bif: running opt with O2: VCEmulation64.cmcl.bc -> VCEmulation64.opt.bc
[933/1037] vc_generate_emulation_bif: compile Emulation BiF for KBL
[934/1037] vc_generate_emulation_bif: compile Emulation BiF for BDW
[935/1037] vc_generate_emulation_bif: compile Emulation BiF for SKL
[936/1037] vc_generate_emulation_bif: compile Emulation BiF for PVC
[937/1037] vc_generate_emulation_bif: compile Emulation BiF for PVCXT
[938/1037] vc_generate_emulation_bif: compile Emulation BiF for PVCXT_A0
FAILED: IGC/VectorCompiler/lib/BiF/VCEmulation64_PVCXT_A0.vccg.bc 
cd /home/nobody/source/intel-graphics-compiler/build/IGC/VectorCompiler/lib/BiF && /home/nobody/source/intel-graphics-compiler/build/IGC/Release/vcb -o VCEmulation64_PVCXT_A0.vccg.bc -cpu PVCXT_A0 VCEmulation64.opt.bc
error: <llvm.genx.rdregioni.i8.v4i8.i16> intrinsic is unsupported by target platform <PVCXT_A0>. Please, enable legacy intrinsics translation

(This using LLVM 12 / GCC 11 on Ubuntu 21.10 where those are the defaults.)

I noticed that release binaries are using newer vc-intrinsics commit. If latest vc-intrinsics tag is too old for latest IGC one, please make sure new enough commit of vc-intrinsics project gets tested and tagged.

Other alternative fixes for this issue could be providing IGC option either for disabling PVC support, or using "legacy intrinsics translation" (if that has been verified to work better). Preferably such actions should happen automatically by IGC configuration phase though, but if not, at least the message should tell what option to use.

eero-t commented 2 years ago

@mnaczk Is newer version of vc-intrinsics than v0.1.0 (latest tag/release) needed by IGC now?

If yes, why there's no new tag (i.e. what failed in IGC release process), and could some newer (tested/working) commit be tagged?

PS. "igc-1.0.10988" release suffers from the same issue.

ArchangeGabriel commented 2 years ago

@eero-t You know the answer, as you stated a newer commit is required and in fact the one linked exactly adds support for PVCXT_A0.

So the only question is how they decided to handle things w.r.t. vc-intrinsincs tagging, which apparently is “not really”.

mnaczk commented 2 years ago

@eero-t All necessary dependencies for specific IGC releases can be found in the release note. For example for igc-1.0.10840 the release note https://github.com/intel/intel-graphics-compiler/releases/tag/igc-1.0.10840 section "Dependencies revisions" mention that recommended vc-intrinsics commit is 99ac111

All testing on our site is made on the configuration mentioned in "Dependencies revisions" section.

vmustya commented 2 years ago

Hi folks,

I have marked the https://github.com/intel/vc-intrinsics/commit/99ac111c2604a47d865bd4d7996be8cfaf2af146 commit with v0.2.0 tag. Please try it.

@mnaczk, could you please update release notes for igc-1.0.10840 and igc-1.0.10988 to point to v0.2.0 vc-intrinsics tag instead of commit ID?

eero-t commented 2 years ago

You know the answer, as you stated a newer commit is required and in fact the one linked exactly adds support for PVCXT_A0.

@ArchangeGabriel I hadn't noticed that, but I indeed should have... Happily there was already a ticket in right place: https://github.com/intel/vc-intrinsics/issues/107

@eero-t All necessary dependencies for specific IGC releases can be found in the release note. ... All testing on our site is made on the configuration mentioned in "Dependencies revisions" section.

@mnaczk If you want to discuss need for vc-intrinsics tagging, and listing those in IGC release notes, the relevant tickets are:

I have marked the https://github.com/intel/vc-intrinsics/commit/99ac111c2604a47d865bd4d7996be8cfaf2af146 commit with v0.2.0 tag. Please try it.

@vmustya Thanks! Everything works fine with that => closing.

@mnaczk, could you please update release notes for igc-1.0.10840 and igc-1.0.10988 to point to v0.2.0 vc-intrinsics tag instead of commit ID?

IMHO there's no need to update old release notes. The important thing is that the necessary tags are there (and that future release notes will mention them).