Skip to content

Julia 1.12: Deadlock detected in loading Flux ext #2625

@fps

Description

@fps
julia> versioninfo()
Julia Version 1.12.0
Commit b907bd0600 (2025-10-07 15:42 UTC)
Build Info:
  Official https://julialang.org release
Platform Info:
  OS: Windows (x86_64-w64-mingw32)
  CPU: 24 × Intel(R) Core(TM) Ultra 9 285
  WORD_SIZE: 64
  LLVM: libLLVM-18.1.7 (ORCJIT, arrowlake-s)
  GC: Built with stock GC
Threads: 1 default, 1 interactive, 1 GC (on 24 virtual cores)

I think I am running into this same issue: JuliaLang/julia#58045

] activate --temp
add Flux, CUDA, cuDNN
# Backspace here to go out of package mode
import CUDA
import Flux

gives:

┌ Error: Error during loading of extension FluxCUDAcuDNNExt of Flux, use `Base.retry_load_extensions()` to retry.
│   exception =
│    1-element ExceptionStack:
│    ConcurrencyViolationError("deadlock detected in loading FluxCUDAExt using FluxCUDAExt (while loading FluxCUDAcuDNNExt)") 
│    Stacktrace:
│      [1] canstart_loading(modkey::Base.PkgId, build_id::UInt128, stalecheck::Bool)
│        @ Base .\loading.jl:2182
│      [2] _require_search_from_serialized(pkg::Base.PkgId, sourcepath::String, build_id::UInt128, stalecheck::Bool; reasons::Dict{String, Int64}, DEPOT_PATH::Vector{String})
│        @ Base .\loading.jl:2016
│      [3] __require_prelocked(pkg::Base.PkgId, env::Nothing)
│        @ Base .\loading.jl:2599
│      [4] _require_prelocked(uuidkey::Base.PkgId, env::Nothing)
│        @ Base .\loading.jl:2465
│      [5] _require_prelocked(uuidkey::Base.PkgId)
│        @ Base .\loading.jl:2459
│      [6] run_extension_callbacks(extid::Base.ExtensionId)
│        @ Base .\loading.jl:1579
│      [7] run_extension_callbacks(pkgid::Base.PkgId)
│        @ Base .\loading.jl:1616
│      [8] run_package_callbacks(modkey::Base.PkgId)
│        @ Base .\loading.jl:1432
│      [9] _require_prelocked(uuidkey::Base.PkgId, env::String)
│        @ Base .\loading.jl:2473
│     [10] macro expansion
│        @ .\loading.jl:2393 [inlined]
│     [11] macro expansion
│        @ .\lock.jl:376 [inlined]
│     [12] __require(into::Module, mod::Symbol)
│        @ Base .\loading.jl:2358
│     [13] require
│        @ .\loading.jl:2334 [inlined]
│     [14] __init__()
│        @ FluxCUDAExt C:\Users\fschmidt26\.julia\packages\Flux\uRn8o\ext\FluxCUDAExt\FluxCUDAExt.jl:8
│     [15] run_module_init(mod::Module, i::Int64)
│        @ Base .\loading.jl:1415
│     [16] register_restored_modules(sv::Core.SimpleVector, pkg::Base.PkgId, path::String)
│        @ Base .\loading.jl:1403
│     [17] _include_from_serialized(pkg::Base.PkgId, path::String, ocachepath::String, depmods::Vector{Any}; register::Bool)  
│        @ Base .\loading.jl:1291
│     [18] _include_from_serialized
│        @ .\loading.jl:1246 [inlined]
│     [19] _require_search_from_serialized(pkg::Base.PkgId, sourcepath::String, build_id::UInt128, stalecheck::Bool; reasons::Dict{String, Int64}, DEPOT_PATH::Vector{String})
│        @ Base .\loading.jl:2087
│     [20] __require_prelocked(pkg::Base.PkgId, env::Nothing)
│        @ Base .\loading.jl:2599
│     [21] _require_prelocked(uuidkey::Base.PkgId, env::Nothing)
│        @ Base .\loading.jl:2465
│     [22] _require_prelocked(uuidkey::Base.PkgId)
│        @ Base .\loading.jl:2459
│     [23] run_extension_callbacks(extid::Base.ExtensionId)
│        @ Base .\loading.jl:1579
│     [24] run_extension_callbacks(pkgid::Base.PkgId)
│        @ Base .\loading.jl:1616
│     [25] run_package_callbacks(modkey::Base.PkgId)
│        @ Base .\loading.jl:1432
│     [26] _require_prelocked(uuidkey::Base.PkgId, env::String)
│        @ Base .\loading.jl:2473
│     [27] macro expansion
│        @ .\loading.jl:2393 [inlined]
│     [28] macro expansion
│        @ .\lock.jl:376 [inlined]
│     [29] __require(into::Module, mod::Symbol)
│        @ Base .\loading.jl:2358
│     [30] require(into::Module, mod::Symbol)
│        @ Base .\loading.jl:2334
│     [31] top-level scope
│        @ REPL[4]:1
│     [32] __repl_entry_eval_expanded_with_loc(mod::Module, ast::Any, toplevel_file::Ref{Ptr{UInt8}}, toplevel_line::Ref{Int32})
│        @ REPL C:\Users\fschmidt26\AppData\Local\Programs\Julia-1.12.0\share\julia\stdlib\v1.12\REPL\src\REPL.jl:301
│     [33] toplevel_eval_with_hooks(mod::Module, ast::Any, toplevel_file::Any, toplevel_line::Any)
│        @ REPL C:\Users\fschmidt26\AppData\Local\Programs\Julia-1.12.0\share\julia\stdlib\v1.12\REPL\src\REPL.jl:308
│     [34] toplevel_eval_with_hooks(mod::Module, ast::Any, toplevel_file::Any, toplevel_line::Any)
│        @ REPL C:\Users\fschmidt26\AppData\Local\Programs\Julia-1.12.0\share\julia\stdlib\v1.12\REPL\src\REPL.jl:312
│     [35] toplevel_eval_with_hooks
│        @ C:\Users\fschmidt26\AppData\Local\Programs\Julia-1.12.0\share\julia\stdlib\v1.12\REPL\src\REPL.jl:305 [inlined]    
│     [36] eval_user_input(ast::Any, backend::REPL.REPLBackend, mod::Module)
│        @ REPL C:\Users\fschmidt26\AppData\Local\Programs\Julia-1.12.0\share\julia\stdlib\v1.12\REPL\src\REPL.jl:330
│     [37] repl_backend_loop(backend::REPL.REPLBackend, get_module::Function)
│        @ REPL C:\Users\fschmidt26\AppData\Local\Programs\Julia-1.12.0\share\julia\stdlib\v1.12\REPL\src\REPL.jl:452
│     [38] start_repl_backend(backend::REPL.REPLBackend, consumer::Any; get_module::Function)
│        @ REPL C:\Users\fschmidt26\AppData\Local\Programs\Julia-1.12.0\share\julia\stdlib\v1.12\REPL\src\REPL.jl:427
│     [39] start_repl_backend
│        @ C:\Users\fschmidt26\AppData\Local\Programs\Julia-1.12.0\share\julia\stdlib\v1.12\REPL\src\REPL.jl:424 [inlined]    
│     [40] run_repl(repl::REPL.AbstractREPL, consumer::Any; backend_on_current_task::Bool, backend::Any)
│        @ REPL C:\Users\fschmidt26\AppData\Local\Programs\Julia-1.12.0\share\julia\stdlib\v1.12\REPL\src\REPL.jl:653
│     [41] run_repl(repl::REPL.AbstractREPL, consumer::Any)
│        @ REPL C:\Users\fschmidt26\AppData\Local\Programs\Julia-1.12.0\share\julia\stdlib\v1.12\REPL\src\REPL.jl:639
│     [42] run_std_repl(REPL::Module, quiet::Bool, banner::Symbol, history_file::Bool)
│        @ Base .\client.jl:478
│     [43] run_main_repl(interactive::Bool, quiet::Bool, banner::Symbol, history_file::Bool)
│        @ Base .\client.jl:499
│     [44] repl_main
│        @ .\client.jl:586 [inlined]
│     [45] _start()
│        @ Base .\client.jl:561
└ @ Base loading.jl:1589

That issue report suspected this to be the culprit:

Base.require(Main, :cuDNN)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions