Kernel launch failures can go unreported
Maintainers usually reply within 1 day
Nobody has claimed this yet.
Assessment
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Newbie friendliness
- 48/100
Research direction
Start by tracing the kernel launch and wait_idle synchronization path described in the issue, then inspect how queue reads and event statuses are handled. The issue suggests retaining recent launch events or making reads wait on them; compare these approaches against the reported PoCL behavior. Done means a launch failure is reported even when a later read succeeds, with a regression test covering that sequence.
Written by the indexing model from the issue text.
Description
When a kernel fails at launch time, the failure can go unnoticed: a subsequent read returns uninitialized memory and synchronize reports success. Seen with PoCL on Windows, where some SPIR-V kernels only fail to link when they're launched (#534):
using OpenCL, pocl_jll, SIMD
function kernel(out, v)
out[] = sin(v)
return
end
v = Vec{16,Float64}(ntuple(Float64, 16))
out = CLArray{Vec{16,Float64},0}(undef)
@opencl kernel(out, v)
println("memory: ", OpenCL.memtype(out))
println("result: ", OpenCL.@allowscalar out[])
println("finish: ", try cl.finish(cl.queue()); "ok" catch err; err end)
JIT session error: Symbols not found: [ _Z7_cl_sinDv16_d ]
JIT session error: Symbols not found: [ _Z7_cl_sinDv16_d ]
memory: OpenCL.cl.UnifiedDeviceMemory
result: <16 x Float64>[1.304637681984e-311, 1.69759663277e-313, 1.304637682079e-311, ...]
finish: ok
When cl.finish directly follows the failed launch, it does throw CL_EXEC_STATUS_ERROR_FOR_EVENTS_IN_WAIT_LIST: wait_idle waits on a marker, and PoCL fails the marker because the command before it failed. But PoCL still executes the read that follows the failed kernel in the in-order queue, and that read completes successfully, so the marker after it does too. The kernel's own event, which carries the error, is never looked at. The spec leaves it to the implementation whether later commands in the queue run after a failure, so we can't rely on the error propagating.
This was confusing while investigating #415: the SIMD tests reported wrong results, and the actual error only showed up as CL_EXEC_STATUS_ERROR_FOR_EVENTS_IN_WAIT_LIST on an unrelated later launch. Options are to keep the event of the last launch(es) per queue and check their status when synchronizing, or to have reads wait on them explicitly.
pocl_jll 7.2.2+0, OpenCL.jl #533, Julia 1.13.1, Windows Server 2022 (VM).
- Dominant language
- Julia
- Stars
- 313
- Forks
- 50
- Avg merge
- 1d 8h
- Merged PRs (30d)
- 44
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 2/5 1-3 hours Newbie friendliness 90/100
Maintainers usually reply within 1 day
-
A failed SVM allocation returns a CLArray at address 0, and kernels that write to it fault the GPUOpen
Difficulty 3/5 1-2 days Newbie friendliness 74/100
Maintainers usually reply within 1 day
-
Difficulty 4/5 3-5 days 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
-
kernels latency regression
Difficulty 4/5 3-5 days Newbie friendliness 52/100
Maintainers usually reply within 1 day
All issues in JuliaGPU/OpenCL.jl
Similar issues
-
documentation invalid
Difficulty 1/5 1-3 hours Newbie friendliness 88/100
JuliaPhysics/BeamletOptics.jl#190 ·
Maintainers usually reply within 2 days
-
mul! with a Symmetric or Hermitian factor throws for a matrix view whose columns are not contiguousOpen
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
JuliaLang/LinearAlgebra.jl#1829 ·
Maintainers usually reply within 1 day
-
`EnsembleSummary` `ci_type = :SEM` ribbon is `sqrt(N)` too wide for scalar statesPossibly taken @isaacsas claimed this today. Open
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
SciML/SciMLBase.jl#1654 ·
Maintainers usually reply within 3 days
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
MagneticResonanceImaging/MRIReco.jl#320 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
rfordatascience/tidytuesday#1098 ·