Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

LazyInitialized is not GC-safe #2216

Closed
maleadt opened this issue Jan 3, 2024 · 0 comments · Fixed by #2335
Closed

LazyInitialized is not GC-safe #2216

maleadt opened this issue Jan 3, 2024 · 0 comments · Fixed by #2335
Labels
bug Something isn't working

Comments

@maleadt
Copy link
Member

maleadt commented Jan 3, 2024

Yet another issue caused by finalizers not running on their own thread:

Stacktrace:
  [1] try_yieldto(undo::typeof(Base.ensure_rescheduled))
    @ Base ./task.jl:921
  [2] wait()
    @ Base ./task.jl:995
  [3] yield()
    @ Base ./task.jl:875
  [4] initialize!(x::CUDA.APIUtils.LazyInitialized{Vector{Vector{Union{Nothing, Bool}}}, CUDA.var"#1003#1004"}, constructor::CUDA.var"#1005#1006")
    @ CUDA.APIUtils ~/Julia/pkg/CUDA/lib/utils/threading.jl:57
  [5] get!
    @ CUDA.APIUtils ~/Julia/pkg/CUDA/lib/utils/threading.jl:28 [inlined]
  [6] macro expansion
    @ CUDA ~/Julia/pkg/CUDA/lib/utils/memoization.jl:69 [inlined]
  [7] stream_ordered(dev::CuDevice)
    @ CUDA ~/Julia/pkg/CUDA/src/pool.jl:163
  [8] #_free#1023
    @ ~/Julia/pkg/CUDA/src/pool.jl:510 [inlined]
  [9] _free
    @ ~/Julia/pkg/CUDA/src/pool.jl:503 [inlined]
 [10] macro expansion
    @ ~/Julia/pkg/CUDA/src/pool.jl:488 [inlined]
 [11] macro expansion
    @ ./timing.jl:395 [inlined]
 [12] #free#1022
    @ ~/Julia/pkg/CUDA/src/pool.jl:487 [inlined]
 [13] free
    @ ~/Julia/pkg/CUDA/src/pool.jl:476 [inlined]
 [14] (::CUDA.var"#1029#1030"{CUDA.Mem.DeviceBuffer, Bool})()
    @ CUDA ~/Julia/pkg/CUDA/src/array.jl:101
 [15] #context!#912
    @ ~/Julia/pkg/CUDA/lib/cudadrv/state.jl:170 [inlined]
 [16] context!(ctx::CuContext)
    @ CUDA ~/Julia/pkg/CUDA/lib/cudadrv/state.jl:165 [inlined]
 [17] _free_buffer(buf::CUDA.Mem.DeviceBuffer, early::Bool)
    @ CUDA ~/Julia/pkg/CUDA/src/array.jl:89
 [18] release(rc::GPUArrays.RefCounted{CUDA.Mem.DeviceBuffer}, args::Bool)
    @ GPUArrays ~/.julia/packages/GPUArrays/EoKy0/src/host/abstractarray.jl:42
 [19] unsafe_free!
    @ GPUArrays ~/.julia/packages/GPUArrays/EoKy0/src/host/abstractarray.jl:90 [inlined]
 [20] unsafe_finalize!(xs::CuArray{Float16, 2, CUDA.Mem.DeviceBuffer})
    @ CUDA ~/Julia/pkg/CUDA/src/array.jl:113
@maleadt maleadt added the bug Something isn't working label Jan 3, 2024
@maleadt maleadt linked a pull request Apr 22, 2024 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant