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

gtk_init_check() failed during initialization of module Gtk4 #84

Open
deszoeke opened this issue Jan 24, 2025 · 3 comments
Open

gtk_init_check() failed during initialization of module Gtk4 #84

deszoeke opened this issue Jan 24, 2025 · 3 comments

Comments

@deszoeke
Copy link

Gtk4 (a dependency of ImageView) fails to precompile with Julia 1.11.3 on linux:

ERROR: The following 1 direct dependency failed to precompile:

ImageView 

Failed to precompile ImageView [86fae568-95e7-573e-a6b2-d8a6b900c9ef] to "/home/ceoas/deszoeks/.julia/compiled/v1.11/ImageView/jl_YVoHb7".
ERROR: LoadError: InitError: gtk_init_check() failed.
Stacktrace:
  [1] error(s::String)
    @ Base ./error.jl:35
  [2] __init__()
    @ Gtk4 ~/.julia/packages/Gtk4/4KLGk/src/Gtk4.jl:172
  [3] run_module_init(mod::Module, i::Int64)
    @ Base ./loading.jl:1378
  [4] register_restored_modules(sv::Core.SimpleVector, pkg::Base.PkgId, path::String)
    @ Base ./loading.jl:1366
  [5] _include_from_serialized(pkg::Base.PkgId, path::String, ocachepath::String, depmods::Vector{Any}, ignore_native::Nothing; register::Bool)
    @ Base ./loading.jl:1254
  [6] _include_from_serialized (repeats 2 times)
    @ ./loading.jl:1210 [inlined]
  [7] _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:2057
  [8] _require(pkg::Base.PkgId, env::String)
    @ Base ./loading.jl:2527
  [9] __require_prelocked(uuidkey::Base.PkgId, env::String)
    @ Base ./loading.jl:2388
 [10] #invoke_in_world#3
    @ ./essentials.jl:1089 [inlined]
 [11] invoke_in_world
    @ ./essentials.jl:1086 [inlined]
 [12] _require_prelocked(uuidkey::Base.PkgId, env::String)
    @ Base ./loading.jl:2375
 [13] macro expansion
    @ ./loading.jl:2314 [inlined]
 [14] macro expansion
    @ ./lock.jl:273 [inlined]
 [15] __require(into::Module, mod::Symbol)
    @ Base ./loading.jl:2271
 [16] #invoke_in_world#3
    @ ./essentials.jl:1089 [inlined]
 [17] invoke_in_world
    @ ./essentials.jl:1086 [inlined]
 [18] require(into::Module, mod::Symbol)
    @ Base ./loading.jl:2260
 [19] include
    @ ./Base.jl:557 [inlined]
 [20] 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:2881
 [21] top-level scope
    @ stdin:6
during initialization of module Gtk4
in expression starting at /home/ceoas/deszoeks/.julia/packages/ImageView/3ADSj/src/ImageView.jl:1
in expression starting at stdin:

Here are the deps in the Project.toml:

[deps]
ApproxFun = "28f2ccd6-bb30-5033-b560-165f7b14dc2f"
CSV = "336ed68f-0bac-5ca0-87d4-7b16caf5d00b"
CalculusWithJulia = "a2e0e22d-7d4c-5312-9169-8b992201a882"
DSP = "717857b8-e6f2-59f4-9121-6e50c889abd2"
DataFrames = "a93c6f00-e57d-5684-b7b6-d8193f3e46c0"
DataStructures = "864edb3b-99cc-5e75-8d2d-829cb0a9cfe8"
Dates = "ade2ca70-3891-5945-98fb-dc099432e06a"
Distances = "b4f34e82-e78d-54a5-968a-f98e89d6e8f7"
FFTW = "7a1cc6ca-52ef-59f5-83cd-3a7055c09341"
FileIO = "5789e2e9-d7fb-5bc7-8068-2c6fae9b9549"
GMT = "5752ebe1-31b9-557e-87aa-f909b540aa54"
ImageFeatures = "92ff4b2b-8094-53d3-b29d-97f740f06cef"
ImageFiltering = "6a3955dd-da59-5b1f-98d4-e7296123deb5"
ImageSegmentation = "80713f31-8817-5129-9cf8-209ff8fb23e1"
ImageTracking = "7632190a-71f5-11e9-04ef-99e081817785"
ImageTransformations = "02fcd773-0e25-5acc-982a-7f6622650795"
ImageView = "86fae568-95e7-573e-a6b2-d8a6b900c9ef"
Images = "916415d5-f1e6-5110-898d-aaa5f9f070e0"
Interpolations = "a98d9a8b-a2ab-59e6-89dd-64a1c18fca59"
JLD2 = "033835bb-8acc-5ee8-8aae-3f567f8a3819"
LaTeXStrings = "b964fa9f-0449-5b57-a5c2-d3ea65f4040f"
LinearAlgebra = "37e2e46d-f89d-539d-b4ee-838fcccc9c8e"
Missings = "e1d29d7a-bbdc-5cf2-9ac0-f12de2c33e28"
NCDatasets = "85f8d34a-cbdd-5861-8df4-14fed0d494ab"
NearestNeighbors = "b8a86587-4115-5ab1-83bc-aa920d37bbce"
NetCDF = "30363a11-5582-574a-97bb-aa9a979735b9"
NumericalIntegration = "e7bfaba1-d571-5449-8927-abc22e82249b"
Polynomials = "f27b6e38-b328-58d1-80ce-0feddd5e7a45"
Printf = "de0858da-6303-5e67-8744-51eddeeeb8d7"
ProgressMeter = "92933f4c-e287-5a05-a399-4b506db050ca"
PyCall = "438e738f-606a-5dbb-bf0a-cddfbfd45ab0"
PyPlot = "d330b81b-6aea-500a-939a-2ce795aea3ee"
SciPy = "ebc72ef8-9537-4fb0-b64e-ac76025fed2d"
StaticArrays = "90137ffa-7385-5640-81b9-e52037218182"
StatsBase = "2913bbd2-ae8a-5f71-8c99-4fb6c76f3a91"
SymPy = "24249f21-da20-56a4-8eb1-6a02cf4ae2e6"
TestImages = "5e47fb64-e119-507b-a336-dd2b206d9990"
VideoIO = "d6d074c3-1acf-5d4c-9a43-ef38773959a2"

And relevant deps in Manifest.toml:

[[deps.ImageView]]
deps = ["AxisArrays", "Cairo", "Compat", "Graphics", "Gtk4", "GtkObservables", "ImageBase", "ImageCore", "ImageMetadata", "MultiChannelColors", "PrecompileTools", "RoundingIntegers", "StatsBase"]
git-tree-sha1 = "e535c709a4fb6f0ae65026fa9bfac624abec016f"
uuid = "86fae568-95e7-573e-a6b2-d8a6b900c9ef"
version = "0.12.6"

[[deps.Gtk4]]
deps = ["BitFlags", "CEnum", "Cairo", "Cairo_jll", "ColorTypes", "FixedPointNumbers", "GTK4_jll", "Glib_jll", "Graphene_jll", "Graphics", "JLLWrappers", "Libdl", "Librsvg_jll", "Pango_jll", "Preferences", "Reexport", "Scratch", "Xorg_xkeyboard_config_jll", "adwaita_icon_theme_jll", "gdk_pixbuf_jll", "hicolor_icon_theme_jll", "libpng_jll"]
git-tree-sha1 = "64d43c91b4e304604e7f204a96f3efccb8d17076"
uuid = "9db2cae5-386f-4011-9d63-a5602296539b"
version = "0.7.2"

[[deps.GtkObservables]]
deps = ["Cairo", "Colors", "Dates", "FixedPointNumbers", "Graphics", "Gtk4", "IntervalSets", "LinearAlgebra", "Observables", "PrecompileTools", "Reexport", "RoundingIntegers"]
git-tree-sha1 = "00111abceb335becbbc4d38f26228671f5dd6ecc"
uuid = "8710efd8-4ad6-11eb-33ea-2d5ceb25a41c"
version = "2.1.4"
@jwahlstrand
Copy link
Member

Can't reproduce this on my Linux system in Julia 1.11.3. According to the GTK docs, gtk_init_check fails "if the windowing system can’t be initialized". Are you accessing the system through an SSH connection? If so, this is related to timholy/ProfileView.jl#219. If not, does PyPlot work on your system?

@deszoeke
Copy link
Author

Are you accessing the system through an SSH connection? If so, this is related to timholy/ProfileView.jl#219.

Yes. I have a module that has code to analyze images, which I want to compile and run on headless HPC nodes. The module also has code to visualize the input and results.

@deszoeke
Copy link
Author

does PyPlot work on your system?

PyPlot compiles and runs fine with no failure at all. It even outputs PyObjects on the headless node. Of course it doesn't display anything.

julia> using PyPlot

julia> plot([1,0])
1-element Vector{PyCall.PyObject}:
 PyObject <matplotlib.lines.Line2D object at 0x14f9d598caf0>

This behavior would not cause other components in the module to fail to compile.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants