Skip to content
This repository was archived by the owner on Mar 14, 2026. It is now read-only.
This repository was archived by the owner on Mar 14, 2026. It is now read-only.

Intermittent GC-related test failure (isempty(cuda_ptrs)) #66

Description

@vchuravy

@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.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions