Intel CPU runtime: compiler segfaults in vpo-directive-cleanup on isequal of multi-dimensional arrays
Maintainers usually reply within 1 day
Nobody has claimed this yet.
Assessment
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Newbie friendliness
- 43/100
- Issue type
- Bug
- Clarity
- Mostly clear
- Activity status
- Active
- Tech stack
- julia
- Domain
- backend, performance
Research direction
Start with the OpenCL.jl kernel compilation and reduction path used by isequal(CLArray(A), CLArray(A)), then reproduce the MWE with Intel's CPU runtime and inspect the dumped .spv file. Compare the failing isequal and == reductions across the listed shapes with the working vector and PoCL cases. Done means identifying a reproducible cause and confirming a fix no longer crashes the Intel runtime while preserving correct results.
Written by the indexing model from the issue text.
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
- Dominant language
- Julia
- Stars
- 313
- Forks
- 50
- Avg merge
- 22h 18m
- Merged PRs (30d)
- 40
Getting set up
This project ships no dev container, Dockerfile or contributing guide, so setting up is up to you: start from its README, and see our first-contribution guide for the general steps.
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from JuliaGPU/OpenCL.jl
-
Difficulty 5/5 Over a week Newbie friendliness 35/100
Maintainers usually reply within 1 day
-
Difficulty 5/5 Over a week Newbie friendliness 35/100
Maintainers usually reply within 1 day
-
performance runtime
Difficulty 5/5 Over a week Newbie friendliness 35/100
Maintainers usually reply within 1 day
-
Intel CPU runtime: reports half-precision atomic addition but lacks the atomic_add builtin for halfOpenIntel CPU kernels upstream
Difficulty 4/5 1-2 days Newbie friendliness 55/100
Maintainers usually reply within 1 day
-
Intel CPU kernels upstream
Difficulty 4/5 3-5 days Newbie friendliness 35/100
JuliaGPU/OpenCL.jl#558 · 1 comment ·
Maintainers usually reply within 1 day
All issues in JuliaGPU/OpenCL.jl
Similar issues
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
-
bug help wanted
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
JuliaGeometry/Meshes.jl#1469 ·
Maintainers usually reply within 1 day
-
distributed 🕸️
Difficulty 2/5 1-3 hours Newbie friendliness 62/100
CliMA/Oceananigans.jl#6295 · 1 comment ·
Maintainers usually reply within 1 day
-
CI: two jobs fail on the new ubuntu-latest (Ubuntu 26.04) runner imagePossibly taken @bjarthur claimed this today. Open
Difficulty 2/5 1-3 hours Newbie friendliness 86/100
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 63/100
mojaie/MolecularGraph.jl#151 ·