intel / intel-graphics-compiler

Other
606 stars 158 forks source link

Infinite loop somewhere around CodeSinking.cpp #192

Closed troels closed 3 years ago

troels commented 3 years ago

Hi, I've been trying to run the following spir-v file on my Intel Corporation TigerLake-LP GT2 [Iris Xe Graphics] (rev 01)

Unfortunately it never gets to the graphics card but stalls somewhere in the optimization. The process does not progress for 30 minutes and killing it or hooking into it with GDB, shows it's running somewhere around the CodeSinking. The following is a stacktrace after ~20 min of nothing happening: From worker 8: signal (15): Terminated From worker 8: in expression starting at none:1 From worker 8: error: address range table at offset 0x25e00 has a premature terminator entry at offset 0x25e10 From worker 8: error: address range table at offset 0x25e00 has a premature terminator entry at offset 0x25f20 From worker 8: error: address range table at offset 0x2c2f0 has a premature terminator entry at offset 0x2c300 From worker 8: error: address range table at offset 0x2c2f0 has a premature terminator entry at offset 0x2c380 From worker 8: error: address range table at offset 0x3c110 has a premature terminator entry at offset 0x3c290 From worker 8: error: address range table at offset 0x3d190 has a premature terminator entry at offset 0x3d1a0 From worker 8: error: address range table at offset 0x3dce0 has a premature terminator entry at offset 0x3dfa0 From worker 8: error: address range table at offset 0x634c0 has a premature terminator entry at offset 0x634d0 From worker 8: error: address range table at offset 0x638d0 has a premature terminator entry at offset 0x638e0 From worker 8: _ZNK4llvm5Value10getContextEv at /home/troels/.julia/artifacts/6c00b3bf3bd3c14a08e80103380f90f123c3425d/lib64/libigc.so (unknown line) From worker 8: _ZNK4llvm5Value12getValueNameEv at /home/troels/.julia/artifacts/6c00b3bf3bd3c14a08e80103380f90f123c3425d/lib64/libigc.so (unknown line) From worker 8: _ZNK4llvm5Value7getNameEv at /home/troels/.julia/artifacts/6c00b3bf3bd3c14a08e80103380f90f123c3425d/lib64/libigc.so (unknown line) From worker 8: classof at /workspace/srcdir/intel-graphics-compiler/build/../IGC/GenISAIntrinsics/GenIntrinsicInst.h:76 [inlined] From worker 8: classof at /workspace/srcdir/intel-graphics-compiler/build/../IGC/GenISAIntrinsics/GenIntrinsicInst.h:81 [inlined] From worker 8: doit at /workspace/srcdir/intel-graphics-compiler/build/IGC/llvm-deps/src/llvm/include/llvm/Support/Casting.h:58 [inlined] From worker 8: doit at /workspace/srcdir/intel-graphics-compiler/build/IGC/llvm-deps/src/llvm/include/llvm/Support/Casting.h:106 [inlined] From worker 8: doit at /workspace/srcdir/intel-graphics-compiler/build/IGC/llvm-deps/src/llvm/include/llvm/Support/Casting.h:132 [inlined] From worker 8: doit at /workspace/srcdir/intel-graphics-compiler/build/IGC/llvm-deps/src/llvm/include/llvm/Support/Casting.h:123 [inlined] From worker 8: isa<llvm::GenIntrinsicInst, const llvm::Value> at /workspace/srcdir/intel-graphics-compiler/build/IGC/llvm-deps/src/llvm/include/llvm/Support/Casting.h:143 [inlined] From worker 8: classof at /workspace/srcdir/intel-graphics-compiler/build/../IGC/GenISAIntrinsics/GenIntrinsicInst.h:251 [inlined] From worker 8: doit at /workspace/srcdir/intel-graphics-compiler/build/IGC/llvm-deps/src/llvm/include/llvm/Support/Casting.h:58 [inlined] From worker 8: doit at /workspace/srcdir/intel-graphics-compiler/build/IGC/llvm-deps/src/llvm/include/llvm/Support/Casting.h:106 [inlined] From worker 8: doit at /workspace/srcdir/intel-graphics-compiler/build/IGC/llvm-deps/src/llvm/include/llvm/Support/Casting.h:132 [inlined] From worker 8: doit at /workspace/srcdir/intel-graphics-compiler/build/IGC/llvm-deps/src/llvm/include/llvm/Support/Casting.h:123 [inlined] From worker 8: isa<llvm::SamplerGatherIntrinsic, llvm::Instruction> at /workspace/srcdir/intel-graphics-compiler/build/IGC/llvm-deps/src/llvm/include/llvm/Support/Casting.h:143 [inlined] From worker 8: isGather4Instruction at /workspace/srcdir/intel-graphics-compiler/build/../IGC/Compiler/CISACodeGen/helper.cpp:1308 From worker 8: isSafeToMove at /workspace/srcdir/intel-graphics-compiler/build/../IGC/Compiler/CISACodeGen/CodeSinking.cpp:543 From worker 8: SinkInstruction at /workspace/srcdir/intel-graphics-compiler/build/../IGC/Compiler/CISACodeGen/CodeSinking.cpp:617 From worker 8: ProcessBlock at /workspace/srcdir/intel-graphics-compiler/build/../IGC/Compiler/CISACodeGen/CodeSinking.cpp:408 From worker 8: runOnFunction at /workspace/srcdir/intel-graphics-compiler/build/../IGC/Compiler/CISACodeGen/CodeSinking.cpp:244 From worker 8: _ZN4llvm13FPPassManager13runOnFunctionERNS_8FunctionE at /home/troels/.julia/artifacts/6c00b3bf3bd3c14a08e80103380f90f123c3425d/lib64/libigc.so (unknown line) From worker 8: _ZN4llvm13FPPassManager11runOnModuleERNS_6ModuleE at /home/troels/.julia/artifacts/6c00b3bf3bd3c14a08e80103380f90f123c3425d/lib64/libigc.so (unknown line) From worker 8: _ZN4llvm6legacy15PassManagerImpl3runERNS_6ModuleE at /home/troels/.julia/artifacts/6c00b3bf3bd3c14a08e80103380f90f123c3425d/lib64/libigc.so (unknown line) From worker 8: CodeGen at /workspace/srcdir/intel-graphics-compiler/build/../IGC/Compiler/CISACodeGen/ShaderCodeGen.cpp:1308 From worker 8: CodeGen at /workspace/srcdir/intel-graphics-compiler/build/../IGC/Compiler/CISACodeGen/OpenCLKernelCodeGen.cpp:2200 From worker 8: TranslateBuild at /workspace/srcdir/intel-graphics-compiler/build/../IGC/AdaptorOCL/dllInterfaceCompute.cpp:1204 From worker 8: Translate at /workspace/srcdir/intel-graphics-compiler/build/../IGC/AdaptorOCL/ocl_igc_interface/impl/igc_ocl_translation_ctx_impl.h:282 From worker 8: _ZN3NEO17CompilerInterface5buildERKNS_6DeviceERKNS_16TranslationInputERNS_17TranslationOutputE at /home/troels/.julia/artifacts/0425153072013ce35c4d657144ad692b7bd55efb/lib64/libze_intel_gpu.so.1 (unknown line) From worker 8: _ZN2L021ModuleTranslationUnit14buildFromSpirVEPKcjS2_S2_PK22_ze_module_constants_t at /home/troels/.julia/artifacts/0425153072013ce35c4d657144ad692b7bd55efb/lib64/libze_intel_gpu.so.1 (unknown line) From worker 8: _ZN2L09ModuleImp10initializeEPK17_ze_module_desc_tPN3NEO6DeviceE at /home/troels/.julia/artifacts/0425153072013ce35c4d657144ad692b7bd55efb/lib64/libze_intel_gpu.so.1 (unknown line) From worker 8: _ZN2L06Module6createEPNS_6DeviceEPK17_ze_module_desc_tPNS_14ModuleBuildLogENS_10ModuleTypeE at /home/troels/.julia/artifacts/0425153072013ce35c4d657144ad692b7bd55efb/lib64/libze_intel_gpu.so.1 (unknown line) From worker 8: _ZN2L09DeviceImp12createModuleEPK17_ze_module_desc_tPP19_ze_module_handle_tPP29_ze_module_build_log_handle_tNS_10ModuleTypeE at /home/troels/.julia/artifacts/0425153072013ce35c4d657144ad692b7bd55efb/lib64/libze_intel_gpu.so.1 (unknown line) From worker 8: unsafe_zeModuleCreate at /home/troels/src/oneAPI.jl/lib/level-zero/libze.jl:1623 [inlined] From worker 8: ZeModule#78 at /home/troels/src/oneAPI.jl/lib/level-zero/module.jl:35 From worker 8: ZeModule at /home/troels/src/oneAPI.jl/lib/level-zero/module.jl:12 [inlined] From worker 8: zefunction_link at /home/troels/src/oneAPI.jl/src/compiler/execution.jl:159 From worker 8: unknown function (ip: 0x7fea39c7fdf1) From worker 8: _jl_invoke at /home/troels/src/julia/src/gf.c:2226 [inlined] From worker 8: jl_apply_generic at /home/troels/src/julia/src/gf.c:2427 From worker 8: cached_compilation at /home/troels/src/GPUCompiler.jl/src/cache.jl:94 From worker 8: _jl_invoke at /home/troels/src/julia/src/gf.c:2226 [inlined] From worker 8: jl_apply_generic at /home/troels/src/julia/src/gf.c:2427 From worker 8: #zefunction#50 at /home/troels/src/oneAPI.jl/src/compiler/execution.jl:142 From worker 8: zefunction at /home/troels/src/oneAPI.jl/src/compiler/execution.jl:136 [inlined] From worker 8: macro expansion at /home/troels/src/oneAPI.jl/src/compiler/execution.jl:51 [inlined] From worker 8: #launch_heuristic#75 at /home/troels/src/oneAPI.jl/src/gpuarrays.jl:17 [inlined] From worker 8: launch_heuristic##kw at /home/troels/src/oneAPI.jl/src/gpuarrays.jl:17 From worker 8: copyto! at /home/troels/src/GPUArrays.jl/src/host/broadcast.jl:65 [inlined] From worker 8: copyto! at ./broadcast.jl:957 [inlined] From worker 8: copy at /home/troels/src/GPUArrays.jl/src/host/broadcast.jl:47 [inlined] From worker 8: materialize at ./broadcast.jl:904 [inlined] From worker 8: broadcast_preserving_zero_d at ./broadcast.jl:893 [inlined] From worker 8: / at ./arraymath.jl:55 From worker 8: unknown function (ip: 0x7fea30a94cb9) From worker 8: _jl_invoke at /home/troels/src/julia/src/gf.c:2226 [inlined] From worker 8: jl_apply_generic at /home/troels/src/julia/src/gf.c:2427 From worker 8: _mean at /home/troels/src/GPUArrays.jl/src/host/statistics.jl:19 From worker 8: unknown function (ip: 0x7fea30a96780) From worker 8: _jl_invoke at /home/troels/src/julia/src/gf.c:2226 [inlined] From worker 8: jl_invoke at /home/troels/src/julia/src/gf.c:2252 From worker 8: #mean#2 at /home/troels/src/julia/usr/share/julia/stdlib/v1.8/Statistics/src/Statistics.jl:164 [inlined] From worker 8: mean##kw at /home/troels/src/julia/usr/share/julia/stdlib/v1.8/Statistics/src/Statistics.jl:164 [inlined] From worker 8: _var at /home/troels/src/julia/usr/share/julia/stdlib/v1.8/Statistics/src/Statistics.jl:372 [inlined] From worker 8: #var#15 at /home/troels/src/julia/usr/share/julia/stdlib/v1.8/Statistics/src/Statistics.jl:368 [inlined] From worker 8: var##kw at /home/troels/src/julia/usr/share/julia/stdlib/v1.8/Statistics/src/Statistics.jl:368 [inlined] From worker 8: _std at /home/troels/src/GPUArrays.jl/src/host/statistics.jl:9 From worker 8: #std#18 at /home/troels/src/julia/usr/share/julia/stdlib/v1.8/Statistics/src/Statistics.jl:452 [inlined] From worker 8: std##kw at /home/troels/src/julia/usr/share/julia/stdlib/v1.8/Statistics/src/Statistics.jl:452 From worker 8: unknown function (ip: 0x7fea30a96521) From worker 8: _jl_invoke at /home/troels/src/julia/src/gf.c:2226 [inlined] From worker 8: jl_apply_generic at /home/troels/src/julia/src/gf.c:2427 From worker 8: #compare#1 at /home/troels/src/GPUArrays.jl/test/testsuite.jl:26 From worker 8: compare##kw at /home/troels/src/GPUArrays.jl/test/testsuite.jl:22 From worker 8: unknown function (ip: 0x7fea30a9048d) From worker 8: _jl_invoke at /home/troels/src/julia/src/gf.c:2226 [inlined] From worker 8: jl_apply_generic at /home/troels/src/julia/src/gf.c:2427 From worker 8: macro expansion at /home/troels/src/julia/usr/share/julia/stdlib/v1.8/Test/src/Test.jl:445 [inlined] From worker 8: macro expansion at /home/troels/src/GPUArrays.jl/test/testsuite/statistics.jl:12 [inlined] From worker 8: macro expansion at /home/troels/src/julia/usr/share/julia/stdlib/v1.8/Test/src/Test.jl:1282 [inlined] From worker 8: #362 at /home/troels/src/GPUArrays.jl/test/testsuite/statistics.jl:9 From worker 8: #test_statistics#361 at /home/troels/src/GPUArrays.jl/test/testsuite.jl:56 [inlined] From worker 8: test_statistics##kw at /home/troels/src/GPUArrays.jl/test/testsuite.jl:56 From worker 8: unknown function (ip: 0x7fea30a3ef01) From worker 8: _jl_invoke at /home/troels/src/julia/src/gf.c:2226 [inlined] From worker 8: jl_apply_generic at /home/troels/src/julia/src/gf.c:2427 From worker 8: #14 at /home/troels/src/oneAPI.jl/test/runtests.jl:81 From worker 8: macro expansion at /home/troels/src/oneAPI.jl/test/setup.jl:35 [inlined] From worker 8: macro expansion at /home/troels/src/julia/usr/share/julia/stdlib/v1.8/Test/src/Test.jl:1282 [inlined] From worker 8: macro expansion at /home/troels/src/oneAPI.jl/test/setup.jl:35 [inlined] From worker 8: macro expansion at ./timing.jl:368 [inlined] From worker 8: top-level scope at /home/troels/src/oneAPI.jl/test/setup.jl:34 From worker 8: _jl_invoke at /home/troels/src/julia/src/gf.c:2226 [inlined] From worker 8: jl_invoke at /home/troels/src/julia/src/gf.c:2252 From worker 8: jl_toplevel_eval_flex at /home/troels/src/julia/src/toplevel.c:876 From worker 8: jl_toplevel_eval_in at /home/troels/src/julia/src/toplevel.c:944 From worker 8: eval at ./boot.jl:373 [inlined] From worker 8: runtests at /home/troels/src/oneAPI.jl/test/setup.jl:38 From worker 8: _jl_invoke at /home/troels/src/julia/src/gf.c:2226 [inlined] From worker 8: jl_apply_generic at /home/troels/src/julia/src/gf.c:2427 From worker 8: jl_apply at /home/troels/src/julia/src/julia.h:1771 [inlined] From worker 8: do_apply at /home/troels/src/julia/src/builtins.c:713 From worker 8: #106 at /home/troels/src/julia/usr/share/julia/stdlib/v1.8/Distributed/src/process_messages.jl:278 From worker 8: run_work_thunk at /home/troels/src/julia/usr/share/julia/stdlib/v1.8/Distributed/src/process_messages.jl:63 From worker 8: macro expansion at /home/troels/src/julia/usr/share/julia/stdlib/v1.8/Distributed/src/process_messages.jl:278 [inlined] From worker 8: #105 at ./task.jl:411 From worker 8: unknown function (ip: 0x7fea39bcbf2f) From worker 8: _jl_invoke at /home/troels/src/julia/src/gf.c:2226 [inlined] From worker 8: jl_apply_generic at /home/troels/src/julia/src/gf.c:2427 From worker 8: jl_apply at /home/troels/src/julia/src/julia.h:1771 [inlined] From worker 8: start_task at /home/troels/src/julia/src/task.c:880 From worker 8: unknown function (ip: (nil)) From worker 8: Allocations: 145411361 (Pool: 145380563; Big: 30798); GC: 160

The Spir-V file contents: div.txt

pszymich commented 3 years ago

As described in #199, the issue has been fixed with the merged change, so I'm going to close this one. Please reopen if that's not the case. Thanks!