PackageCompiler error creating sysimage

Hello,

I’m having issues using PackageCompiler on a Linux on aarch64(nVidia Jetson TX2) machine. Running through the basic example from the documentation causes this error.

julia> create_sysimage(["Example"]; sysimage_path="ExampleSysimage.so")
⣠ [01m:01s] PackageCompiler: compiling incremental system imagefatal: error thrown and no exception handler available.
StackOverflowError()
⣄ [01m:01s] PackageCompiler: compiling incremental system imagejl_serialize_value_ at /buildworker/worker/package_linuxaarch64/build/src/staticdata.c:421
jl_serialize_value_ at /buildworker/worker/package_linuxaarch64/build/src/staticdata.c:458
⢰ [01m:02s] PackageCompiler: compiling incremental system image
ERROR: failed process: Process(`/usr/lib/julia/bin/julia --color=yes --startup-file=no --cpu-target=native -O3 --sysimage=/usr/lib/julia/lib/julia/sys.so --project=/home/ubuntu/NewSysImageEnv --output-o=/tmp/jl_kOZ89J.o /tmp/jl_215v2A`, ProcessExited(1)) [1]

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] top-level scope
   @ REPL[6]:1

I’m on Julia 1.7.1

julia> versioninfo()
Julia Version 1.7.1
Commit ac5cc99908 (2021-12-22 19:35 UTC)
Platform Info:
  OS: Linux (aarch64-unknown-linux-gnu)
  CPU: unknown
  WORD_SIZE: 64
  LIBM: libopenlibm
  LLVM: libLLVM-12.0.1 (ORCJIT, cortex-a57)

Any ideas what is happening here?

I’m not sure if it’s related to this ARM CPU JIT issue https://github.com/JuliaLang/julia/issues/41852 but seems similar to the create_app issue although it’s coming from different location…

Cheers,

I am using PackageCompiler to creating a sysimage for a Raspberry Pi 3 device. Per its documentation, MCU is a BCM 2837, AArch64, ARM Cortex-A53. Sysimage is being created on a much larger Linux instance, but also AArch64.

The following attempts created sysimages that ran smoothly at the larger system, but failed at the raspberry pi:

create_sysimage(["Flux", "CUDA"]; sysimage_path="img.so")
create_sysimage(["Flux", "CUDA"]; sysimage_path="img.so", cpu_target="generic")
create_sysimage(["Flux", "CUDA"]; sysimage_path="img.so", cpu_target="cortex-a53")

On the first case, the following error occurred:

ERROR: Unable to find compatible target in system image.

For the other cases, error is as follows:

fatal: error thrown and no exception handler available.
InitError(mod=:LLVMExtra_jll, error=ErrorException("Cannot locate artifact 'LLVMExtra' in '/home/ubuntu/.julia/packages/LLVMExtra_jll/Yq3Eb/Artifacts.toml'"))
error at ./error.jl:35
#ensure_artifact_installed#22 at /cache/build/default-armageddon-4/julialang/julia-release-1-dot-8/usr/share/julia/stdlib/v1.8/Pkg/src/Artifacts.jl:405
unknown function (ip: 0xffff946f03a7)
_jl_invoke at /cache/build/default-armageddon-4/julialang/julia-release-1-dot-8/src/gf.c:2377 [inlined]
ijl_apply_generic at /cache/build/default-armageddon-4/julialang/julia-release-1-dot-8/src/gf.c:2559
ensure_artifact_installed##kw at /cache/build/default-armageddon-4/julialang/julia-release-1-dot-8/usr/share/julia/stdlib/v1.8/Pkg/src/Artifacts.jl:397
unknown function (ip: 0xffff946f0127)
_jl_invoke at /cache/build/default-armageddon-4/julialang/julia-release-1-dot-8/src/gf.c:2377 [inlined]
ijl_apply_generic at /cache/build/default-armageddon-4/julialang/julia-release-1-dot-8/src/gf.c:2559
_artifact_str at /cache/build/default-armageddon-4/julialang/julia-release-1-dot-8/usr/share/julia/stdlib/v1.8/Artifacts/src/Artifacts.jl:548
jfptr__artifact_str_64644 at /home/ciro/flux-env/unetfluxarmgen.so (unknown line)
_jl_invoke at /cache/build/default-armageddon-4/julialang/julia-release-1-dot-8/src/gf.c:2377 [inlined]
ijl_apply_generic at /cache/build/default-armageddon-4/julialang/julia-release-1-dot-8/src/gf.c:2559
jl_apply at /cache/build/default-armageddon-4/julialang/julia-release-1-dot-8/src/julia.h:1843 [inlined]
jl_f__call_latest at /cache/build/default-armageddon-4/julialang/julia-release-1-dot-8/src/builtins.c:774
#invokelatest#2 at ./essentials.jl:729 [inlined]
invokelatest at ./essentials.jl:726 [inlined]
macro expansion at /cache/build/default-armageddon-4/julialang/julia-release-1-dot-8/usr/share/julia/stdlib/v1.8/Artifacts/src/Artifacts.jl:690 [inlined]
find_artifact_dir at /home/ubuntu/.julia/packages/JLLWrappers/QpMQW/src/wrapper_generators.jl:13 [inlined]
__init__ at /home/ubuntu/.julia/packages/LLVMExtra_jll/Yq3Eb/src/wrappers/aarch64-linux-gnu-cxx11-llvm_version+13.jl:7
jfptr___init___79790 at /home/ciro/flux-env/unetfluxarmgen.so (unknown line)
_jl_invoke at /cache/build/default-armageddon-4/julialang/julia-release-1-dot-8/src/gf.c:2377 [inlined]
ijl_apply_generic at /cache/build/default-armageddon-4/julialang/julia-release-1-dot-8/src/gf.c:2559
jl_apply at /cache/build/default-armageddon-4/julialang/julia-release-1-dot-8/src/julia.h:1843 [inlined]
jl_module_run_initializer at /cache/build/default-armageddon-4/julialang/julia-release-1-dot-8/src/toplevel.c:75
_finish_julia_init at /cache/build/default-armageddon-4/julialang/julia-release-1-dot-8/src/init.c:765
julia_init at /cache/build/default-armageddon-4/julialang/julia-release-1-dot-8/src/init.c:698
jl_repl_entrypoint at /cache/build/default-armageddon-4/julialang/julia-release-1-dot-8/src/jlapi.c:713
main at julia (unknown line)
unknown function (ip: 0xffffbd3973fb)
__libc_start_main at /lib/aarch64-linux-gnu/libc.so.6 (unknown line)
unknown function (ip: 0x4009ab)
unknown function (ip: 0x4009ab)

Julia’s developers documentation indicates usage of the flag
MCPU=armv8-a
that is apparently not accepted by create_sysimage.

Any advise is appreciated. Thanks.