`wait(kernel(...)` performs much worse on Julia v1.7
Created by: lmh91
Sometimes wait(kernel(...))
hangs up.
MWE:
using KernelAbstractions
using CUDA, CUDAKernels
using ProgressMeter
@kernel function test_kernel(a::AbstractArray{T}) where {T}
index = @index(Global)
a[index] = T(1)
end
a = CuArray(zeros(Float32, 500, 500));
ndrange = size(a)
k = test_kernel(CUDADevice())
wait(k(a; ndrange))
@showprogress for i in 1:1000000 # get stuck at some point
wait(k(a; ndrange))
end
I observed this on Julia v1.7.1 and v1.7.2. On Julia v1.6.5, however, it works and never gets stuck. Package versions:
(@v1.7) pkg> st
Status `~/.julia/linux-ubuntu-20.04-x86_64/environments/v1.7/Project.toml`
[052768ef] CUDA v3.8.3
[72cfdca4] CUDAKernels v0.3.3
[63c18a36] KernelAbstractions v0.7.2
[92933f4c] ProgressMeter v1.7.1
I tested it also with different machines (Ubuntu and Windows) and different GPUs (all NVIDIA's).
As @maleadt
suggested this might be related to https://github.com/JuliaGPU/CUDA.jl/issues/1350 and https://github.com/JuliaGPU/CUDA.jl/pull/1369.