FluxML / Flux.jl

Relax! Flux is the ML library that doesn't make you tensor
https://fluxml.ai/
Other
4.54k stars 610 forks source link

Flux installation error under Julia 1.10 on Apple Silicon #2366

Closed GlenHenshaw closed 8 months ago

GlenHenshaw commented 10 months ago
        (@v1.10) pkg> add Flux
           Resolving package versions...
           Installed Accessors ─── v0.1.33
           Installed Transducers ─ v0.4.79
            Updating `~/.julia/environments/v1.10/Project.toml`
        ⌃ [587475ba] + Flux v0.13.4
            Updating `~/.julia/environments/v1.10/Manifest.toml`
          [7d9f7c33] + Accessors v0.1.33
          [dce04be8] + ArgCheck v2.3.0
          [a9b6321e] + Atomix v0.1.0
          [198e06fe] + BangBang v0.3.39
          [9718e550] + Baselet v0.1.1
          [082447d4] + ChainRules v1.58.1
          [a33af91c] + CompositionsBase v0.1.2
          [6add18c4] + ContextVariablesX v0.1.3
          [244e2a9f] + DefineSingletons v0.1.2
          [cc61a311] + FLoops v0.2.1
          [b9860ae5] + FLoopsBase v0.1.1
        ⌃ [587475ba] + Flux v0.13.4
          [9c68100b] + FoldsThreads v0.1.2
        ⌅ [d9f16b24] + Functors v0.2.8
          [7869d1d1] + IRTools v0.4.11
          [22cec73e] + InitialValues v0.3.1
          [3587e190] + InverseFunctions v0.1.12
          [b14d175d] + JuliaVariables v0.2.4
          [63c18a36] + KernelAbstractions v0.9.15
          [d8e11817] + MLStyle v0.4.17
        ⌅ [f1d291b0] + MLUtils v0.2.11
          [128add7d] + MicroCollections v0.1.4
        ⌅ [872c559c] + NNlib v0.8.21
        ⌃ [a00861dc] + NNlibCUDA v0.2.3
          [71a1bf82] + NameResolution v0.1.5
        ⌅ [3bd65402] + Optimisers v0.2.9
          [8162dcfd] + PrettyPrint v0.2.0
          [33c8b6b6] + ProgressLogging v0.1.4
          [605ecd9f] + ShowCases v0.1.0
          [dc90abb0] + SparseInverseSubset v0.1.2
          [171d559e] + SplittablesBase v0.1.15
          [28d57a85] + Transducers v0.4.79
          [013be700] + UnsafeAtomics v0.2.1
        ⌃ [d80eeb9a] + UnsafeAtomicsLLVM v0.1.1
        ⌃ [e88e6eb3] + Zygote v0.6.41
                Info Packages marked with ⌃ and ⌅ have new versions available. Those with ⌃ may be upgradable, but those with ⌅ are restricted by compatibility constraints from upgrading. To see why use `status --outdated -m`
        Precompiling project...
          ✗ NNlibCUDA
          ✗ Flux
          39 dependencies successfully precompiled in 19 seconds. 376 already precompiled. 1 skipped during auto due to previous errors.
          2 dependencies errored.
          For a report of the errors see `julia> err`. To retry use `pkg> precompile`

        julia> err
        PkgPrecompileError: The following 1 direct dependency failed to precompile:

        Flux [587475ba-b771-5e3f-ad9e-33799f191a9c]

        Failed to precompile Flux [587475ba-b771-5e3f-ad9e-33799f191a9c] to "/Users/glenhenshaw/.julia/compiled/v1.10/Flux/jl_h8E1fk".
        ERROR: LoadError: ParseError:
        # Error @ /Users/glenhenshaw/.julia/packages/CUDA/lwSps/lib/cudadrv/context.jl:11:21

        @enum_without_prefix CUctx_flags CU_
        #                   └──────────────┘ ── extra tokens after end of expression
        Stacktrace:
          [1] top-level scope
            @ ~/.julia/packages/CUDA/lwSps/lib/cudadrv/context.jl:11
          [2] include(mod::Module, _path::String)
            @ Base ./Base.jl:495
          [3] include(x::String)
            @ CUDA ~/.julia/packages/CUDA/lwSps/src/CUDA.jl:1
          [4] top-level scope
            @ ~/.julia/packages/CUDA/lwSps/lib/cudadrv/CUDAdrv.jl:24
          [5] include(mod::Module, _path::String)
            @ Base ./Base.jl:495
          [6] include(x::String)
            @ CUDA ~/.julia/packages/CUDA/lwSps/src/CUDA.jl:1
          [7] top-level scope
            @ ~/.julia/packages/CUDA/lwSps/src/CUDA.jl:49
          [8] include
            @ Base ./Base.jl:495 [inlined]
          [9] include_package_for_output(pkg::Base.PkgId, input::String, depot_path::Vector{String}, dl_load_path::Vector{String}, load_path::Vector{String}, concrete_deps::Vector{Pair{Base.PkgId, UInt128}}, source::String)
            @ Base ./loading.jl:2216
         [10] top-level scope
            @ stdin:3
        in expression starting at /Users/glenhenshaw/.julia/packages/CUDA/lwSps/lib/cudadrv/context.jl:11
        in expression starting at /Users/glenhenshaw/.julia/packages/CUDA/lwSps/lib/cudadrv/CUDAdrv.jl:24
        in expression starting at /Users/glenhenshaw/.julia/packages/CUDA/lwSps/src/CUDA.jl:1
        in expression starting at stdin:3
        ERROR: LoadError: Failed to precompile CUDA [052768ef-5323-5732-b1bb-66c8b64840ba] to "/Users/glenhenshaw/.julia/compiled/v1.10/CUDA/jl_qxh1n7".
        Stacktrace:
          [1] error(s::String)
            @ Base ./error.jl:35
          [2] compilecache(pkg::Base.PkgId, path::String, internal_stderr::IO, internal_stdout::IO, keep_loaded_modules::Bool)
            @ Base ./loading.jl:2462
          [3] compilecache
            @ Base ./loading.jl:2334 [inlined]
          [4] (::Base.var"#968#969"{Base.PkgId})()
            @ Base ./loading.jl:1968
          [5] mkpidlock(f::Base.var"#968#969"{Base.PkgId}, at::String, pid::Int32; kwopts::@Kwargs{stale_age::Int64, wait::Bool})
            @ FileWatching.Pidfile ~/.julia/juliaup/julia-1.10.0+0.aarch64.apple.darwin14/share/julia/stdlib/v1.10/FileWatching/src/pidfile.jl:93
          [6] #mkpidlock#6
            @ FileWatching.Pidfile ~/.julia/juliaup/julia-1.10.0+0.aarch64.apple.darwin14/share/julia/stdlib/v1.10/FileWatching/src/pidfile.jl:88 [inlined]
          [7] trymkpidlock(::Function, ::Vararg{Any}; kwargs::@Kwargs{stale_age::Int64})
            @ FileWatching.Pidfile ~/.julia/juliaup/julia-1.10.0+0.aarch64.apple.darwin14/share/julia/stdlib/v1.10/FileWatching/src/pidfile.jl:111
          [8] #invokelatest#2
            @ Base ./essentials.jl:889 [inlined]
          [9] invokelatest
            @ Base ./essentials.jl:884 [inlined]
         [10] maybe_cachefile_lock(f::Base.var"#968#969"{Base.PkgId}, pkg::Base.PkgId, srcpath::String; stale_age::Int64)
            @ Base ./loading.jl:2977
         [11] maybe_cachefile_lock
            @ Base ./loading.jl:2974 [inlined]
         [12] _require(pkg::Base.PkgId, env::String)
            @ Base ./loading.jl:1964
         [13] __require_prelocked(uuidkey::Base.PkgId, env::String)
            @ Base ./loading.jl:1806
         [14] #invoke_in_world#3
            @ Base ./essentials.jl:921 [inlined]
         [15] invoke_in_world
            @ Base ./essentials.jl:918 [inlined]
         [16] _require_prelocked(uuidkey::Base.PkgId, env::String)
            @ Base ./loading.jl:1797
         [17] macro expansion
            @ Base ./loading.jl:1784 [inlined]
         [18] macro expansion
            @ Base ./lock.jl:267 [inlined]
         [19] __require(into::Module, mod::Symbol)
            @ Base ./loading.jl:1747
         [20] #invoke_in_world#3
            @ Base ./essentials.jl:921 [inlined]
         [21] invoke_in_world
            @ Base ./essentials.jl:918 [inlined]
         [22] require(into::Module, mod::Symbol)
            @ Base ./loading.jl:1740
         [23] include
            @ Base ./Base.jl:495 [inlined]
         [24] include_package_for_output(pkg::Base.PkgId, input::String, depot_path::Vector{String}, dl_load_path::Vector{String}, load_path::Vector{String}, concrete_deps::Vector{Pair{Base.PkgId, UInt128}}, source::Nothing)
            @ Base ./loading.jl:2216
         [25] top-level scope
            @ stdin:3
        in expression starting at /Users/glenhenshaw/.julia/packages/Flux/KkC79/src/Flux.jl:1
        in expression starting at stdin:

        julia>
ToucheSir commented 10 months ago

I would report the LoadError from CUDA.jl error there since Flux has no control over it, but the more immediate issue is that something else in your global environment is forcing Flux to be downgraded. My recommendation would be to create a new environment for Flux + other non-global packages as is good practice, but if you must have it globally then try force ] adding the latest version of Flux and see what Pkg says about compat conflicts.

CarloLucibello commented 8 months ago

I cannot reproduce this