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

Adding CUDA to a PackageCompiler sysimage causes segfault #2428

Closed
KSepetanc opened this issue Jul 1, 2024 · 3 comments
Closed

Adding CUDA to a PackageCompiler sysimage causes segfault #2428

KSepetanc opened this issue Jul 1, 2024 · 3 comments
Labels
bug Something isn't working needs information Further information is requested

Comments

@KSepetanc
Copy link

Describe the bug

There is segmentation fault when creating system image with PackagePrecompiler whenever I add CUDA as dependency, even if I don't precompile the CUDA (which I will need to compile too).

To reproduce

The Minimal Working Example (MWE) for this bug:

base) karlo@karlo-System-Product-Name:~/AC OPF2$ julia
               _
   _       _ _(_)_     |  Documentation: https://docs.julialang.org
  (_)     | (_) (_)    |
   _ _   _| |_  __ _   |  Type "?" for help, "]?" for Pkg help.
  | | | | | | |/ _` |  |
  | | |_| | | | (_| |  |  Version 1.10.4 (2024-06-04)
 _/ |\__'_|_|_|\__'_|  |  Official https://julialang.org/ release
|__/                   |

(@v1.10) pkg> add PowerModels,PackageCompiler,CUDA
  Installing known registries into `~/.julia`
    Updating registry at `~/.julia/registries/General.toml`
   Resolving package versions...
   Installed GPUArraysCore ─────────────── v0.1.6
   Installed IrrationalConstants ───────── v0.2.2
   Installed Crayons ───────────────────── v4.1.1
   Installed Adapt ─────────────────────── v4.0.4
   Installed ColorTypes ────────────────── v0.11.5
   Installed DiffRules ─────────────────── v1.15.1
   Installed Scratch ───────────────────── v1.2.1
   Installed MutableArithmetics ────────── v1.4.5
   Installed CUDA_Driver_jll ───────────── v0.9.0+0
   Installed DiffResults ───────────────── v1.1.0
   Installed TableTraits ───────────────── v1.0.1
   Installed JSON ──────────────────────── v0.21.4
   Installed GPUCompiler ───────────────── v0.26.5
   Installed NLsolve ───────────────────── v4.5.1
   Installed Preferences ───────────────── v1.4.3
   Installed PrettyTables ──────────────── v2.3.2
   Installed LLVMLoopInfo ──────────────── v1.0.0
   Installed SentinelArrays ────────────── v1.4.3
   Installed CodecBzip2 ────────────────── v0.8.2
   Installed Parsers ───────────────────── v2.8.1
   Installed RelocatableFolders ────────── v1.0.1
   Installed BenchmarkTools ────────────── v1.5.0
   Installed SpecialFunctions ──────────── v2.4.0
   Installed Bzip2_jll ─────────────────── v1.0.8+1
   Installed PooledArrays ──────────────── v1.4.3
   Installed Tables ────────────────────── v1.11.1
   Installed Setfield ──────────────────── v1.1.1
   Installed DataAPI ───────────────────── v1.16.0
   Installed InlineStrings ─────────────── v1.4.1
   Installed TimerOutputs ──────────────── v0.5.24
   Installed StaticArraysCore ──────────── v1.4.3
   Installed JLLWrappers ───────────────── v1.5.0
   Installed FixedPointNumbers ─────────── v0.8.5
   Installed AbstractFFTs ──────────────── v1.5.0
   Installed IteratorInterfaceExtensions ─ v1.0.0
   Installed NaNMath ───────────────────── v1.0.2
   Installed StaticArrays ──────────────── v1.9.6
   Installed JuMP ──────────────────────── v1.22.2
   Installed CUDA_Runtime_Discovery ────── v0.3.4
   Installed ConstructionBase ──────────── v1.5.5
   Installed NVTX ──────────────────────── v0.3.4
   Installed PrecompileTools ───────────── v1.2.1
   Installed LLVMExtra_jll ─────────────── v0.0.29+0
   Installed OrderedCollections ────────── v1.6.3
   Installed NVTX_jll ──────────────────── v3.1.0+2
   Installed PackageCompiler ───────────── v2.1.17
   Installed DataValueInterfaces ───────── v1.0.0
   Installed LaTeXStrings ──────────────── v1.3.1
   Installed TranscodingStreams ────────── v0.10.10
   Installed PowerModels ───────────────── v0.21.1
   Installed UnsafeAtomicsLLVM ─────────── v0.1.5
   Installed CEnum ─────────────────────── v0.5.0
   Installed NLSolversBase ─────────────── v7.8.3
   Installed Memento ───────────────────── v1.4.1
   Installed InvertedIndices ───────────── v1.3.0
   Installed GPUArrays ─────────────────── v10.2.2
   Installed InfrastructureModels ──────── v0.7.8
   Installed ArrayInterface ────────────── v7.11.0
   Installed Random123 ─────────────────── v1.7.0
   Installed LineSearches ──────────────── v7.2.0
   Installed BFloat16s ─────────────────── v0.5.0
   Installed Reexport ──────────────────── v1.2.2
   Installed ForwardDiff ───────────────── v0.10.36
   Installed DataFrames ────────────────── v1.6.1
   Installed JuliaNVTXCallbacks_jll ────── v0.2.1+0
   Installed CUDA_Runtime_jll ──────────── v0.14.0+1
   Installed DataStructures ────────────── v0.18.20
   Installed Requires ──────────────────── v1.3.0
   Installed Colors ────────────────────── v0.12.11
   Installed LogExpFunctions ───────────── v0.3.28
   Installed RandomNumbers ─────────────── v1.5.3
   Installed KernelAbstractions ────────── v0.9.22
   Installed CommonSubexpressions ──────── v0.3.0
   Installed MacroTools ────────────────── v0.5.13
   Installed ExprTools ─────────────────── v0.1.10
   Installed OpenSpecFun_jll ───────────── v0.5.5+0
   Installed StatsAPI ──────────────────── v1.7.0
   Installed UnPack ────────────────────── v1.0.2
   Installed Compat ────────────────────── v4.15.0
   Installed Parameters ────────────────── v0.12.3
   Installed UnsafeAtomics ─────────────── v0.2.1
   Installed CUDA ──────────────────────── v5.4.2
   Installed Glob ──────────────────────── v1.3.1
   Installed CodecZlib ─────────────────── v0.7.4
   Installed Distances ─────────────────── v0.10.11
   Installed StringManipulation ────────── v0.3.4
   Installed SortingAlgorithms ─────────── v1.2.1
   Installed Missings ──────────────────── v1.2.0
   Installed LLVM ──────────────────────── v7.2.1
   Installed MathOptInterface ──────────── v1.31.0
   Installed DocStringExtensions ───────── v0.9.3
   Installed Atomix ────────────────────── v0.1.0
   Installed FiniteDiff ────────────────── v2.23.1
  Downloaded artifact: Bzip2
  Downloaded artifact: LLVMExtra
  Downloaded artifact: NVTX
  Downloaded artifact: JuliaNVTXCallbacks
  Downloaded artifact: OpenSpecFun
    Updating `~/.julia/environments/v1.10/Project.toml`
  [052768ef] + CUDA v5.4.2
  [9b87118b] + PackageCompiler v2.1.17
  [c36e90e8] + PowerModels v0.21.1
    Updating `~/.julia/environments/v1.10/Manifest.toml`
  Downloaded artifact: CUDA_Driver

[pid 140323] waiting for IO to finish:
 Handle type        uv_handle_t->data
 timer              0x1986a50->0x78be2baad570
This means that a package has started a background task or event source that has not finished running. For precompilation to complete successfully, the event source needs to be closed explicitly. See the developer documentation on fixing precompilation hangs for more help.

[pid 140323] waiting for IO to finish:
 Handle type        uv_handle_t->data
 timer              0x1986a50->0x78be2baad570
This means that a package has started a background task or event source that has not finished running. For precompilation to complete successfully, the event source needs to be closed explicitly. See the developer documentation on fixing precompilation hangs for more help.
  [621f4979] + AbstractFFTs v1.5.0
  [79e6a3ab] + Adapt v4.0.4
  [4fba245c] + ArrayInterface v7.11.0
  [a9b6321e] + Atomix v0.1.0
  [ab4f0b2a] + BFloat16s v0.5.0
  [6e4b80f9] + BenchmarkTools v1.5.0
  [fa961155] + CEnum v0.5.0
  [052768ef] + CUDA v5.4.2
  [1af6417a] + CUDA_Runtime_Discovery v0.3.4
  [523fee87] + CodecBzip2 v0.8.2
  [944b1d66] + CodecZlib v0.7.4
  [3da002f7] + ColorTypes v0.11.5
  [5ae59095] + Colors v0.12.11
  [bbf7d656] + CommonSubexpressions v0.3.0
  [34da2185] + Compat v4.15.0
  [187b0558] + ConstructionBase v1.5.5
  [a8cc5b0e] + Crayons v4.1.1
  [9a962f9c] + DataAPI v1.16.0
  [a93c6f00] + DataFrames v1.6.1
  [864edb3b] + DataStructures v0.18.20
  [e2d170a0] + DataValueInterfaces v1.0.0
  [163ba53b] + DiffResults v1.1.0
  [b552c78f] + DiffRules v1.15.1
  [b4f34e82] + Distances v0.10.11
  [ffbed154] + DocStringExtensions v0.9.3
  [e2ba6199] + ExprTools v0.1.10
  [6a86dc24] + FiniteDiff v2.23.1
  [53c48c17] + FixedPointNumbers v0.8.5
  [f6369f11] + ForwardDiff v0.10.36
  [0c68f7d7] + GPUArrays v10.2.2
  [46192b85] + GPUArraysCore v0.1.6
⌃ [61eb1bfa] + GPUCompiler v0.26.5
  [c27321d9] + Glob v1.3.1
  [2030c09a] + InfrastructureModels v0.7.8
  [842dd82b] + InlineStrings v1.4.1
  [41ab1584] + InvertedIndices v1.3.0
  [92d709cd] + IrrationalConstants v0.2.2
  [82899510] + IteratorInterfaceExtensions v1.0.0
  [692b3bcd] + JLLWrappers v1.5.0
  [682c06a0] + JSON v0.21.4
  [4076af6c] + JuMP v1.22.2
  [63c18a36] + KernelAbstractions v0.9.22
⌅ [929cbde3] + LLVM v7.2.1
  [8b046642] + LLVMLoopInfo v1.0.0
  [b964fa9f] + LaTeXStrings v1.3.1
  [d3d80556] + LineSearches v7.2.0
  [2ab3a3ac] + LogExpFunctions v0.3.28
  [1914dd2f] + MacroTools v0.5.13
  [b8f27783] + MathOptInterface v1.31.0
  [f28f55f0] + Memento v1.4.1
  [e1d29d7a] + Missings v1.2.0
  [d8a4904e] + MutableArithmetics v1.4.5
  [d41bc354] + NLSolversBase v7.8.3
  [2774e3e8] + NLsolve v4.5.1
  [5da4648a] + NVTX v0.3.4
  [77ba4419] + NaNMath v1.0.2
  [bac558e1] + OrderedCollections v1.6.3
  [9b87118b] + PackageCompiler v2.1.17
  [d96e819e] + Parameters v0.12.3
  [69de0a69] + Parsers v2.8.1
  [2dfb63ee] + PooledArrays v1.4.3
  [c36e90e8] + PowerModels v0.21.1
  [aea7be01] + PrecompileTools v1.2.1
  [21216c6a] + Preferences v1.4.3
  [08abe8d2] + PrettyTables v2.3.2
  [74087812] + Random123 v1.7.0
  [e6cf234a] + RandomNumbers v1.5.3
  [189a3867] + Reexport v1.2.2
  [05181044] + RelocatableFolders v1.0.1
  [ae029012] + Requires v1.3.0
  [6c6a2e73] + Scratch v1.2.1
  [91c51154] + SentinelArrays v1.4.3
  [efcf1570] + Setfield v1.1.1
  [a2af1166] + SortingAlgorithms v1.2.1
  [276daf66] + SpecialFunctions v2.4.0
  [90137ffa] + StaticArrays v1.9.6
  [1e83bf80] + StaticArraysCore v1.4.3
  [82ae8749] + StatsAPI v1.7.0
  [892a3eda] + StringManipulation v0.3.4
  [3783bdb8] + TableTraits v1.0.1
  [bd369af6] + Tables v1.11.1
  [a759f4b9] + TimerOutputs v0.5.24
  [3bb67fe8] + TranscodingStreams v0.10.10
  [3a884ed6] + UnPack v1.0.2
  [013be700] + UnsafeAtomics v0.2.1
  [d80eeb9a] + UnsafeAtomicsLLVM v0.1.5
  [6e34b625] + Bzip2_jll v1.0.8+1
  [4ee394cb] + CUDA_Driver_jll v0.9.0+0
→ [76a88914] + CUDA_Runtime_jll v0.14.0+1
  [9c1d0b0a] + JuliaNVTXCallbacks_jll v0.2.1+0
⌅ [dad2f222] + LLVMExtra_jll v0.0.29+0
  [e98f9f5b] + NVTX_jll v3.1.0+2
  [efe28fd5] + OpenSpecFun_jll v0.5.5+0
  [0dad84c5] + ArgTools v1.1.1
  [56f22d72] + Artifacts
  [2a0f44e3] + Base64
  [ade2ca70] + Dates
  [8ba89e20] + Distributed
  [f43a241f] + Downloads v1.6.0
  [7b1f6079] + FileWatching
  [9fa8497b] + Future
  [b77e0a4c] + InteractiveUtils
  [4af54fe1] + LazyArtifacts
  [b27032c2] + LibCURL v0.6.4
  [76f85450] + LibGit2
  [8f399da3] + Libdl
  [37e2e46d] + LinearAlgebra
  [56ddb016] + Logging
  [d6f4376e] + Markdown
  [a63ad114] + Mmap
  [ca575930] + NetworkOptions v1.2.0
  [44cfe95a] + Pkg v1.10.0
  [de0858da] + Printf
  [9abbd945] + Profile
  [3fa0cd96] + REPL
  [9a3f8284] + Random
  [ea8e919c] + SHA v0.7.0
  [9e88b42a] + Serialization
  [6462fe0b] + Sockets
  [2f01184e] + SparseArrays v1.10.0
  [10745b16] + Statistics v1.10.0
  [4607b0f0] + SuiteSparse
  [fa267f1f] + TOML v1.0.3
  [a4e569a6] + Tar v1.10.0
  [8dfed614] + Test
  [cf7118a7] + UUIDs
  [4ec0a83e] + Unicode
  [e66e0078] + CompilerSupportLibraries_jll v1.1.1+0
  [deac9b47] + LibCURL_jll v8.4.0+0
  [e37daf67] + LibGit2_jll v1.6.4+0
  [29816b5a] + LibSSH2_jll v1.11.0+1
  [c8ffd9c3] + MbedTLS_jll v2.28.2+1
  [14a3606d] + MozillaCACerts_jll v2023.1.10
  [4536629a] + OpenBLAS_jll v0.3.23+4
  [05823500] + OpenLibm_jll v0.8.1+2
  [bea87d4a] + SuiteSparse_jll v7.2.1+1
  [83775a58] + Zlib_jll v1.2.13+1
  [8e850b90] + libblastrampoline_jll v5.8.0+1
  [8e850ede] + nghttp2_jll v1.52.0+1
  [3f19e933] + p7zip_jll v17.4.0+2
        Info Packages marked with → are not downloaded, use `instantiate` to download
        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`
  Downloaded artifact: CUDA_Runtime
Precompiling project...
  110 dependencies successfully precompiled in 68 seconds. 8 already precompiled.

(@v1.10) pkg> instantiate

julia> using PackageCompiler

julia> PackageCompiler.create_sysimage(["PowerModels"];sysimage_path="image.so")
Precompiling project...
  107 dependencies successfully precompiled in 57 seconds. 11 already precompiled.
⠸ [00m:34s] PackageCompiler: compiling incremental system image
[145433] signal (11.1): Segmentation fault
in expression starting at none:0
Allocations: 19928328 (Pool: 19911844; Big: 16484); GC: 13
✖ [00m:34s] PackageCompiler: compiling incremental system image
ERROR: failed process: Process(`/snap/julia/100/bin/julia --color=yes --startup-file=no --pkgimages=no --cpu-target=native --sysimage=/snap/julia/100/lib/julia/sys.so --project=/home/karlo/.julia/environments/v1.10 --output-o=/tmp/jl_SzIFSVAluj.o /tmp/jl_IdED0XUb0j`, ProcessSignaled(11)) [0]

Stacktrace:
  [1] pipeline_error
    @ ./process.jl:565 [inlined]
  [2] run(::Cmd; wait::Bool)
    @ Base ./process.jl:480
  [3] run
    @ ./process.jl:477 [inlined]
  [4] #20
    @ ~/.julia/packages/PackageCompiler/nT5sD/ext/TerminalSpinners.jl:157 [inlined]
  [5] spin(f::PackageCompiler.var"#20#22"{Cmd}, s::PackageCompiler.TerminalSpinners.Spinner{Base.TTY})
    @ PackageCompiler.TerminalSpinners ~/.julia/packages/PackageCompiler/nT5sD/ext/TerminalSpinners.jl:164
  [6] macro expansion
    @ ~/.julia/packages/PackageCompiler/nT5sD/ext/TerminalSpinners.jl:157 [inlined]
  [7] create_sysimg_object_file(object_file::String, packages::Vector{…}, packages_sysimg::Set{…}; project::String, base_sysimage::String, precompile_execution_file::Vector{…}, precompile_statements_file::Vector{…}, cpu_target::String, script::Nothing, sysimage_build_args::Cmd, extra_precompiles::String, incremental::Bool)
    @ PackageCompiler ~/.julia/packages/PackageCompiler/nT5sD/src/PackageCompiler.jl:134
  [8] create_sysimg_object_file
    @ ~/.julia/packages/PackageCompiler/nT5sD/src/PackageCompiler.jl:311 [inlined]
  [9] create_sysimage(packages::Vector{…}; sysimage_path::String, project::String, precompile_execution_file::Vector{…}, precompile_statements_file::Vector{…}, 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, julia_init_h_file::Nothing, version::Nothing, soname::Nothing, compat_level::String, extra_precompiles::String)
    @ PackageCompiler ~/.julia/packages/PackageCompiler/nT5sD/src/PackageCompiler.jl:628
 [10] top-level scope
    @ REPL[4]:1
Some type information was truncated. Use `show(err)` to see complete types.
Project.toml

(@v1.10) pkg> st
Status `~/.julia/environments/v1.10/Project.toml`
  [052768ef] CUDA v5.4.2
  [9b87118b] PackageCompiler v2.1.17
  [c36e90e8] PowerModels v0.21.1
 

Expected behavior

No segmentation fault

Version info

Details on Julia:

Julia Version 1.10.4
Commit 48d4fd48430 (2024-06-04 10:41 UTC)
Build Info:
  Official https://julialang.org/ release
Platform Info:
  OS: Linux (x86_64-linux-gnu)
  CPU: 32 × AMD Ryzen 9 5950X 16-Core Processor
  WORD_SIZE: 64
  LIBM: libopenlibm
  LLVM: libLLVM-15.0.7 (ORCJIT, znver3)
Threads: 1 default, 0 interactive, 1 GC (on 32 virtual cores)

Installed using Ubuntu 24.04 App Center

Details on CUDA:

julia> CUDA.versioninfo()
CUDA runtime 12.5, artifact installation
CUDA driver 12.2
NVIDIA driver 535.161.8

CUDA libraries: 
- CUBLAS: 12.5.2
- CURAND: 10.3.6
- CUFFT: 11.2.3
- CUSOLVER: 11.6.2
- CUSPARSE: 12.4.1
- CUPTI: 23.0.0
- NVML: 12.0.0+535.161.8

Julia packages: 
- CUDA: 5.4.2
- CUDA_Driver_jll: 0.9.0+0
- CUDA_Runtime_jll: 0.14.0+1

Toolchain:
- Julia: 1.10.4
- LLVM: 15.0.7

1 device:
  0: NVIDIA GeForce RTX 2070 (sm_75, 7.265 GiB / 8.000 GiB available)

@KSepetanc
Copy link
Author

KSepetanc commented Jul 2, 2024

Here is error report when running on Windows (same machine - it is dual boot).

I ran Julia in cmd with admin rights.

julia> create_sysimage(["CUDA"]; sysimage_path="C:\\AC OPF2\\ExampleSysimage.so")
⣄ [00m:11s] PackageCompiler: compiling incremental system image
Please submit a bug report with steps to reproduce this fault, and any error messages that follow (in their entirety). Thanks.
Exception: EXCEPTION_ACCESS_VIOLATION at 0x7ff8ca224d1d -- gc_mark_objarray at C:/workdir/src\gc.c:1957
in expression starting at none:0
gc_mark_objarray at C:/workdir/src\gc.c:1957
gc_mark_outrefs at C:/workdir/src\gc.c:2587 [inlined]
gc_mark_loop_serial_ at C:/workdir/src\gc.c:2697
gc_mark_loop_serial at C:/workdir/src\gc.c:2720
gc_mark_loop at C:/workdir/src\gc.c:2901 [inlined]
_jl_gc_collect at C:/workdir/src\gc.c:3234
ijl_gc_collect at C:/workdir/src\gc.c:3533
ijl_create_system_image at C:/workdir/src\staticdata.c:2715
ijl_write_compiler_output at C:/workdir/src\precompile.c:121
ijl_atexit_hook at C:/workdir/src\init.c:251
jl_repl_entrypoint at C:/workdir/src\jlapi.c:732
mainCRTStartup at C:/workdir/cli\loader_exe.c:58
BaseThreadInitThunk at C:\WINDOWS\System32\KERNEL32.DLL (unknown line)
RtlUserThreadStart at C:\WINDOWS\SYSTEM32\ntdll.dll (unknown line)
Allocations: 4753174 (Pool: 4750871; Big: 2303); GC: 4
✖ [00m:11s] PackageCompiler: compiling incremental system image
ERROR: failed process: Process(`'C:\Users\Korisnik\AppData\Local\Programs\Julia-1.10.4\bin\julia.exe' --color=yes --startup-file=no --pkgimages=no --cpu-target=native '--sysimage=C:\Users\Korisnik\AppData\Local\Programs\Julia-1.10.4\lib\julia\sys.dll' '--project=C:\Users\Korisnik\.julia\environments\v1.10' '--output-o=C:\Users\Korisnik\AppData\Local\Temp\jl_uXOhq9WRIN.o' 'C:\Users\Korisnik\AppData\Local\Temp\jl_Sj0HqpglAd'`, ProcessExited(3221225477)) [3221225477]

Stacktrace:
  [1] pipeline_error
    @ .\process.jl:565 [inlined]
  [2] run(::Cmd; wait::Bool)
    @ Base .\process.jl:480
  [3] run
    @ .\process.jl:477 [inlined]
  [4] #20
    @ C:\Users\Korisnik\.julia\packages\PackageCompiler\nT5sD\ext\TerminalSpinners.jl:157 [inlined]
  [5] spin(f::PackageCompiler.var"#20#22"{Cmd}, s::PackageCompiler.TerminalSpinners.Spinner{Base.TTY})
    @ PackageCompiler.TerminalSpinners C:\Users\Korisnik\.julia\packages\PackageCompiler\nT5sD\ext\TerminalSpinners.jl:164
  [6] macro expansion
    @ C:\Users\Korisnik\.julia\packages\PackageCompiler\nT5sD\ext\TerminalSpinners.jl:157 [inlined]
  [7] create_sysimg_object_file(object_file::String, packages::Vector{…}, packages_sysimg::Set{…}; project::String, base_sysimage::String, precompile_execution_file::Vector{…}, precompile_statements_file::Vector{…}, cpu_target::String, script::Nothing, sysimage_build_args::Cmd, extra_precompiles::String, incremental::Bool)
    @ PackageCompiler C:\Users\Korisnik\.julia\packages\PackageCompiler\nT5sD\src\PackageCompiler.jl:134
  [8] create_sysimg_object_file
    @ C:\Users\Korisnik\.julia\packages\PackageCompiler\nT5sD\src\PackageCompiler.jl:311 [inlined]
  [9] create_sysimage(packages::Vector{…}; sysimage_path::String, project::String, precompile_execution_file::Vector{…}, precompile_statements_file::Vector{…}, 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, julia_init_h_file::Nothing, version::Nothing, soname::Nothing, compat_level::String, extra_precompiles::String)
    @ PackageCompiler C:\Users\Korisnik\.julia\packages\PackageCompiler\nT5sD\src\PackageCompiler.jl:628
 [10] top-level scope
    @ REPL[2]:1
Some type information was truncated. Use `show(err)` to see complete types.

@KSepetanc KSepetanc changed the title Adding CUDA as dependancy results in segmentation fault for PackagePrecompiler Sysimage Adding CUDA as dependancy results in segmentation fault for PackageCompiler Sysimage Jul 2, 2024
@maleadt
Copy link
Member

maleadt commented Jul 19, 2024

I cannot reproduce doing create_sysimage(["CUDA"]), not on Linux, and not on Windows. I was using the master branch of CUDA.jl and its deps. Can you try reducing the package's contents to figure out what causes the issue?

In any case, with the backtrace not pointing to anything CUDA.jl related, this seems more likely to be a PackageCompiler.jl or Julia issue, so maybe it's better filed over there. FWIW, a segfault in gc_mark_objarray suggests that memory is being corrupted somewhere. If you think this is a CUDA.jl issue instead, I'm happy to keep the issue open here though.

Also note that CUDA.jl has not been thoroughly tested in a PackageCompiled environment, e.g., the loading of artifacts on Linux seems to be off. I wouldn't recommend it right now, unless you're comfortable debugging potential issues.

@maleadt maleadt closed this as completed Jul 19, 2024
@maleadt maleadt reopened this Jul 19, 2024
@maleadt maleadt added the needs information Further information is requested label Jul 19, 2024
@maleadt maleadt changed the title Adding CUDA as dependancy results in segmentation fault for PackageCompiler Sysimage Adding CUDA to a PackageCompiler sysimage causes segfault Jul 19, 2024
@KSepetanc
Copy link
Author

It worked now for me with master branch on Windows. I am on vacation so could not test it on Linux.
To fully test it for my purpose, I will need master revision released as I am adding it as dependency for my local package and I did not succeed in making master revision as dependency. This can be closed, but could be reopen in case I find more issues once the master is released.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working needs information Further information is requested
Projects
None yet
Development

No branches or pull requests

2 participants