Closed IlyaOrson closed 2 years ago
The problem is Flux v0.12.8
on julia v1.7
.
I can reproduce by running create_sysimage([:Flux]; sysimage_path="flux.so", precompile_execution_file="Foo.jl")
with the following precompile file:
module Foo
using Flux
end
I think this is a duplicate of #643
Yeah I have similar issues/error when trying to create_app
with flux. It however works on V1.7.6. The app is not relocatable however then due to this line. When I don't include Data.jl
in Flux it however works. Maybe this is the cause for the incremental compiling failing on versions >V1.7.6 too?
Same problem with Julia 1.7.1 and Julia 1.6.5
pkg> st
Project tool v0.1.0
Status `~/tool/Project.toml`
[052768ef] CUDA v3.6.2
[587475ba] Flux v0.12.8
[9b87118b] PackageCompiler v2.0.4
julia> create_app("./","tool")
PackageCompiler: bundled artifacts:
├── LLVMExtra_jll - 5.370 MiB
└── OpenSpecFun_jll - 577.252 KiB
Total artifact file size: 5.934 MiB
✔ [02m:24s] PackageCompiler: compiling base system image (incremental=false)
Precompiling project...
73 dependencies successfully precompiled in 302 seconds
⠙ [00m:39s] PackageCompiler: compiling incremental system imagejulia: /buildworker/worker/package_linux64/build/usr/include/llvm/Support/Casting.h:269: typename llvm::cast_retty<X, Y*>::ret_type llvm::cast(Y*) [with X = llvm::GlobalVariable; Y = llvm::GlobalValue; typename llvm::cast_retty<X, Y*>::ret_type = llvm::GlobalVariable*]: Assertion `isa<X>(Val) && "cast<Ty>() argument of incompatible type!"' failed.
signal (6): Aborted
in expression starting at none:0
gsignal at /lib/x86_64-linux-gnu/libc.so.6 (unknown line)
abort at /lib/x86_64-linux-gnu/libc.so.6 (unknown line)
unknown function (ip: 0x7f8b77daa41e)
__assert_fail at /lib/x86_64-linux-gnu/libc.so.6 (unknown line)
cast<llvm::GlobalVariable, llvm::GlobalValue> at /buildworker/worker/package_linux64/build/usr/include/llvm/Support/Casting.h:269 [inlined]
operator() at /buildworker/worker/package_linux64/build/src/llvm-multiversioning.cpp:711
fix_gv_uses at /buildworker/worker/package_linux64/build/src/llvm-multiversioning.cpp:726 [inlined]
runOnModule at /buildworker/worker/package_linux64/build/src/llvm-multiversioning.cpp:1053
_ZN4llvm6legacy15PassManagerImpl3runERNS_6ModuleE at /opt/julia-1.7.1/bin/../lib/julia/libLLVM-12jl.so (unknown line)
operator() at /buildworker/worker/package_linux64/build/src/aotcompile.cpp:556 [inlined]
jl_dump_native at /buildworker/worker/package_linux64/build/src/aotcompile.cpp:567
jl_write_compiler_output at /buildworker/worker/package_linux64/build/src/precompile.c:94
jl_atexit_hook at /buildworker/worker/package_linux64/build/src/init.c:211
jl_repl_entrypoint at /buildworker/worker/package_linux64/build/src/jlapi.c:702
main at /buildworker/worker/package_linux64/build/cli/loader_exe.c:42
__libc_start_main at /lib/x86_64-linux-gnu/libc.so.6 (unknown line)
_start at /opt/julia-1.7.1/bin/julia (unknown line)
Allocations: 75582852 (Pool: 75557635; Big: 25217); GC: 59
✖ [00m:40s] PackageCompiler: compiling incremental system image
ERROR: failed process: Process(`/opt/julia-1.7.1/bin/julia --color=yes --startup-file=no '--cpu-target=generic;sandybridge,-xsaveopt,clone_all;haswell,-rdrnd,base(1)' -O3 --sysimage=/tmp/jl_r3Kswn/sys.ji --project=/home/mateusz/tool --output-o=/tmp/jl_lZULta.o /tmp/jl_561Amj`, ProcessSignaled(6)) [0]
Stacktrace:
[1] pipeline_error
@ ./process.jl:531 [inlined]
[2] run(::Cmd; wait::Bool)
@ Base ./process.jl:446
[3] run
@ ./process.jl:444 [inlined]
[4] #14
@ ~/.julia/packages/PackageCompiler/tdgyo/ext/TerminalSpinners.jl:157 [inlined]
[5] spin(f::PackageCompiler.var"#14#15"{Cmd}, s::PackageCompiler.TerminalSpinners.Spinner{Base.TTY})
@ PackageCompiler.TerminalSpinners ~/.julia/packages/PackageCompiler/tdgyo/ext/TerminalSpinners.jl:164
[6] macro expansion
@ ~/.julia/packages/PackageCompiler/tdgyo/ext/TerminalSpinners.jl:157 [inlined]
[7] create_sysimg_object_file(object_file::String, packages::Vector{String}, packages_sysimg::Set{Base.PkgId}; project::String, base_sysimage::String, precompile_execution_file::Vector{String}, precompile_statements_file::Vector{String}, cpu_target::String, script::Nothing, sysimage_build_args::Cmd, extra_precompiles::String)
@ PackageCompiler ~/.julia/packages/PackageCompiler/tdgyo/src/PackageCompiler.jl:356
[8] create_sysimage(packages::Vector{String}; sysimage_path::String, project::String, precompile_execution_file::Vector{String}, precompile_statements_file::Vector{String}, incremental::Bool, filter_stdlibs::Bool, cpu_target::String, script::Nothing, sysimage_build_args::Cmd, include_transitive_dependencies::Bool, base_sysimage::Nothing, julia_init_c_file::Nothing, version::Nothing, soname::Nothing, compat_level::String, extra_precompiles::String)
@ PackageCompiler ~/.julia/packages/PackageCompiler/tdgyo/src/PackageCompiler.jl:507
[9] create_app(package_dir::String, app_dir::String; executables::Nothing, precompile_execution_file::Vector{String}, precompile_statements_file::Vector{String}, incremental::Bool, filter_stdlibs::Bool, force::Bool, c_driver_program::String, cpu_target::String, include_lazy_artifacts::Bool, sysimage_build_args::Cmd, include_transitive_dependencies::Bool)
@ PackageCompiler ~/.julia/packages/PackageCompiler/tdgyo/src/PackageCompiler.jl:718
[10] create_app(package_dir::String, app_dir::String)
@ PackageCompiler ~/.julia/packages/PackageCompiler/tdgyo/src/PackageCompiler.jl:689
[11] top-level scope
@ REPL[8]:1
Same problem with Julia 1.7.1 and Julia 1.6.5
I think this is different, for apps you need to remove any @ccallable
that you might have left from using the earlier PackageCompiler.
Made an issue upstream: https://github.com/JuliaLang/julia/issues/43665.
Should be fixed on the upcoming Julia 1.7.2
This should have been fixed in 1.7.2. Please comment if you still see this on 1.7.2.
I reported this issue here https://github.com/JuliaGPU/CUDA.jl/issues/1365#issuecomment-1035056509 As it seems to be related not to Flux but to it's dependency CUDA.jl
The problem was reproducible on all Julia versions I tested 1.6.5, 1.7.1 and 1.7.2.
The script to create a sysimage in this repo throws the following error with
PackageCompiler v2.0.2
while loading the project and module works fine:Not sure if this warning is related to the issue, but it appears when loading the project:
My version info: