Repository navigation
Description
On Intel's OpenCL CPU runtime (intel_opencl_rt_jll), isequal on two multi-dimensional CLArrays segfaults the process while the runtime builds the reduction kernel. The crash is in SimplifyCFG run from Intel's vpo-directive-cleanup pass, on the scalar (not yet vectorized) kernel.
MWE
using intel_opencl_rt_jll, OpenCL
A = rand(Float32, 10, 10)
isequal(CLArray(A), CLArray(A))PLEASE submit a bug report to https://software.intel.com/en-us/support/priority-support and include the crash backtrace and instructions to reproduce the bug.
Stack dump:
0. Running pass "function<eager-inv>(vpo-cfg-restructuring,vpo-directive-cleanup,tight-loop-emitter,...)" on module "main"
1. Running pass "vpo-directive-cleanup" on function "_Z21gpu__mapreduce_block_16CompilerMetadataI11DynamicSize12DynamicCheckv16CartesianIndicesILi1E5TupleI5OneToI5Int64EEE7NDRangeILi1ES0_10StaticSizeI6_256__ES8_vEE11BroadcastedI12CLArrayStyleILi2E19UnifiedDeviceMemoryES3_IS6_S6_E7isequalS3_I13CLDeviceArrayI7Float32Li2ELi1EESM_EESK_I4BoolLi1ELi1EE8identity1_SP_9_NoFinishS5_3ValILi256EESU_ILi16EE"
2. Running pass "SimplifyCFGPass<...>" on function "_Z21gpu__mapreduce_block_..."
[1377714] signal 11 (1): Segmentation fault
_ZN4llvm7PHINode19removeIncomingValueEjb at libintelocl.so
_ZN4llvm10BasicBlock17removePredecessorEPS0_b at libintelocl.so
_ZL19emptyAndDetachBlockPN4llvm10BasicBlockEPNS_15SmallVectorImplINS_3cfg6UpdateIS1_EEEEb at libintelocl.so
_ZN4llvm16detachDeadBlocksENS_8ArrayRefIPNS_10BasicBlockEEEPNS_15SmallVectorImplINS_3cfg6UpdateIS2_EEEEb at libintelocl.so
_ZN4llvm16DeleteDeadBlocksENS_8ArrayRefIPNS_10BasicBlockEEEPNS_14DomTreeUpdaterEb at libintelocl.so
_ZN4llvm23removeUnreachableBlocksERNS_8FunctionEPNS_14DomTreeUpdaterEPNS_16MemorySSAUpdaterE at libintelocl.so
_ZL19simplifyFunctionCFGRN4llvm8FunctionERKNS_19TargetTransformInfoEPNS_13DominatorTreeERKNS_18SimplifyCFGOptionsEPNS_17AndersensAAResultE at libintelocl.so
_ZN4llvm15SimplifyCFGPass3runERNS_8FunctionERNS_15AnalysisManagerIS1_JEEE at libintelocl.so
_ZN4llvm11PassManagerINS_8FunctionENS_15AnalysisManagerIS1_JEEEJEE3runERS1_RS3_ at libintelocl.so
_ZN4llvm23VPODirectiveCleanupPass7runImplERNS_8FunctionE at libintelocl.so
_ZN4llvm23VPODirectiveCleanupPass3runERNS_8FunctionERNS_15AnalysisManagerIS1_JEEE at libintelocl.so
...
The kernel is GPUArrays' mapreduce(isequal, &, A, B) over the broadcast of two arrays, and that call crashes too. It's deterministic and doesn't depend on the element type (Int16, Int32 and Float32 all crash), but it does depend on the shape and operators:
| expression | |
|---|---|
mapreduce(isequal, &, A, B), 10×10 or 10×10×10 |
crashes |
mapreduce(==, &, A, B), 10×10×10 |
crashes |
mapreduce(==, &, A, B), 10×10 |
fine |
mapreduce(==, &, A, B), 100-element vector |
fine |
mapreduce(isequal, +, A, B), 10×10×10 |
fine |
isequal / == on vectors |
fine |
This looks different from #558 (no vector types are involved, and the crash is in removing unreachable blocks), so I'm filing it separately. To get the SPIR-V we pass to the runtime, run the MWE with JULIA_OPENCL_DUMP_DIR=<dir>: OpenCL.jl writes the program to a .spv file there before handing it to the driver, so it's written even though the process crashes.
Workarounds
CL_CONFIG_CPU_TARGET_ARCH=core-avx2doesn't help.CL_CONFIG_USE_VECTORIZER=Falsetogether with not requesting a sub-group size (@eval OpenCL _sub_group_size(dev) = nothing, as OpenCL.jl otherwise setsintel_reqd_sub_group_size, which the runtime refuses without its vectorizer) avoids the crash, and the result is correct.
PoCL (pocl_jll) runs the MWE correctly.
Tests
The tb/intel-cpu-driver branch (adding the Intel CPU runtime to CI, upcoming PR) skips gpuarrays/reductions/== isequal on this runtime because of it.
Environment
- OpenCL.jl main (7b8d2c4), GPUArrays 12.1.0, AcceleratedKernels 0.5.4, KernelAbstractions 0.9.44
- intel_opencl_rt_jll 2026.1.2 (driver version 2026.21.7.0.24_160000)
- AMD Ryzen 9 9950X (AVX-512), Linux
- Julia 1.13.1
Activity
maleadt commentedon Oct 16, 2026
Reported upstream as intel/llvm#23518, with two reduced standalone SPIR-V reproducers (about 100 lines each): this
isequalkernel and the kernel behindmapreduce(*, +, A, B)on two 10×10Complex{Int16}arrays, which is what crashed the Windowsintel_cpuCI job ingpuarrays/reductions/sum prod(#565's run and the main run after it). Both are a counted loop with phi accumulators followed by a store to local memory, and crash inSimplifyCFGundervpo-directive-cleanupregardless of the requested sub-group size. Which element types trigger it depends on the host (hereComplex{Int16}2D andComplexF323D; the AVX2 CI runners crash on other kernels of the same test), which is why that job used to pass.gpuarrays/reductions/sum prodis now skipped on this runtime as well.