CUDArt.jl
CUDArt.jl copied to clipboard
Intermittent GC-related test failure (`isempty(cuda_ptrs)`)
@maleadt noticed that every so often the CI would fail due to a test error in gc.jl. The specific test that fails is: https://github.com/JuliaGPU/CUDArt.jl/blob/7c7157019fa69539b2547b5317d9770c89d7d462/test/gc.jl#L57
g = CUDArt.CudaArray(a)
# In case the next gc() test yields an error, the next two lines let
# us do some archaeology
dictcopy = deepcopy(CUDArt.cuda_ptrs)
gptrcopy = copy(pointer(g))
gc() # Check that this doesn't delete the new g
@test !isempty(CUDArt.cuda_ptrs)
h_g = CUDArt.to_host(g)
CUDArt.free(g)
With a little bit of debug information added and TRACE=1 I get:
while TRACE=1 julia --compilecache=no -e 'Pkg.test("CUDArt")'; do :; done
TRACE: Malloc CudaPtr Ptr{Void} @0x0000002303ee0000
TRACE: Finalizing CuContext at Ptr{Void} @0x00007f06843d85d0
TRACE: Not destroying context CUDAdrv.CuContext(Ptr{Void} @0x0000000003f03500,false,false) because we don't own it
TRACE: Freeing CudaPtr CUDArt.CudaPtr{Float64}(Ptr{Float64} @0x0000002303ee0000,CUDAdrv.CuContext(Ptr{Void} @0x0000000003f03500,false,false))
I am currently travelling but should get to this before long.
Did some testing, this bug is also present on 0.2.3 + Julia 5. So even though it would be nice to fix it before release, we're blocking way too many other packages.
Seeing how this is still broken, I'm going to disable the test since it makes it much harder to judge PRs etc.