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

No GUI shown with compiled julia app using CImGui #68

Open
sairus7 opened this issue Aug 25, 2022 · 14 comments
Open

No GUI shown with compiled julia app using CImGui #68

sairus7 opened this issue Aug 25, 2022 · 14 comments

Comments

@sairus7
Copy link
Collaborator

sairus7 commented Aug 25, 2022

I have compiled an app using CImGui, but it doesn't show anything in main window:

image

Compilation script:

julia --project=@. --startup-file=no -e '
using PackageCompiler;
PackageCompiler.create_app(pwd(), "MyProjectCompiled";
    cpu_target="generic;sandybridge,-xsaveopt,clone_all;haswell,-rdrnd,base(1)",
    precompile_execution_file=["test/runtests.jl"])
'

Entrypoint:

function julia_main()::Cint
    try
        state = AppData()
        t = Renderer.render(
            ()->ui(state),
            width=500,
            height=500,
            title=""
        )
        wait(t)
    catch
        Base.invokelatest(Base.display_error, Base.catch_stack())
        return 1
    end
    return 0 # if things finished successfully
end

Any ideas why this can happen?
I'll try to make an MWE for this and link it below.

@sairus7
Copy link
Collaborator Author

sairus7 commented Aug 25, 2022

LOL, compiled MWE app shows GUI, but it is faded:
image

@sairus7
Copy link
Collaborator Author

sairus7 commented Aug 25, 2022

MWE for this issue, I've run it on Windows:
https://github.com/sairus7/CImGuiApp.jl

@Gnimuc
Copy link
Owner

Gnimuc commented Aug 25, 2022

Does the JIT-ed version look good?

@sairus7
Copy link
Collaborator Author

sairus7 commented Aug 25, 2022

Does the JIT-ed version look good?

When I work from REPL, it looks good:

julia> using CImGuiApp

julia> show_gui()
Task (runnable) @0x00000000b8047270

image

@sairus7
Copy link
Collaborator Author

sairus7 commented Aug 25, 2022

On Ubuntu it is completely invisible:
image

@L1ghtingBolt
Copy link

Similar problem. Mine does not open. A GUI appears for half a second and crashes
imagen
I don't have that line in my code so I assume it's from CImGui itself

@Gnimuc
Copy link
Owner

Gnimuc commented Dec 6, 2022

Which version?

@FaresX
Copy link

FaresX commented Mar 3, 2023

I have the same problem when I work with 1.82.0. It works well with 1.79.1.

Julia Version 1.8.5
Commit 17cfb8e65e (2023-01-08 06:45 UTC)
Platform Info:
  OS: Windows (x86_64-w64-mingw32)
  CPU: 16 × AMD Ryzen 7 5800X 8-Core Processor
  WORD_SIZE: 64
  LIBM: libopenlibm
  LLVM: libLLVM-13.0.1 (ORCJIT, znver3)
  Threads: 1 on 16 virtual cores

屏幕截图 2023-03-03 174747
屏幕截图 2023-03-03 174919

@Gnimuc
Copy link
Owner

Gnimuc commented Mar 3, 2023

cc @pxl-th

@pxl-th
Copy link
Collaborator

pxl-th commented Mar 3, 2023

I just tried https://github.com/sairus7/CImGuiApp.jl.
First time deploy/compile_app.sh segfaulted during package compilation with (but that may be a fluke with 1.9 beta):

[10478] signal (11.1): Segmentation fault
in expression starting at /home/pxl-th/code/CImGuiApp.jl/test/runtests.jl:4
unknown function (ip: (nil))
Allocations: 55690543 (Pool: 55669430; Big: 21113); GC: 64

But then I just re-ran it second time and everything worked fine
Screenshot from 2023-03-03 12-36-24

My info:

julia> versioninfo()
Julia Version 1.9.0-beta4
Commit b75ddb787ff (2023-02-07 21:53 UTC)
Platform Info:
  OS: Linux (x86_64-linux-gnu)
  CPU: 16 × AMD Ryzen 7 5800HS with Radeon Graphics
  WORD_SIZE: 64
  LIBM: libopenlibm
  LLVM: libLLVM-14.0.6 (ORCJIT, znver3)
  Threads: 16 on 16 virtual cores

(CImGuiApp) pkg> st
Project CImGuiApp v0.1.0
Status `~/code/CImGuiApp.jl/Project.toml`
  [5d785b6c] CImGui v1.82.0 `https://github.com/Gnimuc/CImGui.jl.git#master`
  [e8efc688] ImPlot v0.3.0 `https://github.com/wsphillips/ImPlot.jl.git#main`

@pxl-th
Copy link
Collaborator

pxl-th commented Mar 3, 2023

Similar problem. Mine does not open. A GUI appears for half a second and crashes imagen I don't have that line in my code so I assume it's from CImGui itself

Does this error happen with https://github.com/sairus7/CImGuiApp.jl or with something else?

@FaresX
Copy link

FaresX commented Mar 4, 2023

I tried https://github.com/sairus7/CImGuiApp.jl and found julia 1.8.5 would reproduce this problem and 1.9.0beta4 not. But as for my app, there is a bug report when I run my .exe compiled through 1.9.0beta4

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 0xffffffffffffffff -- unknown function (ip: ffffffffffffffff)
in expression starting at none:1
unknown function (ip: 0000000000000000)
Allocations: 29050549 (Pool: 29032828; Big: 17721); GC: 43

@FaresX
Copy link

FaresX commented Mar 5, 2023

I tried https://github.com/sairus7/CImGuiApp.jl and found julia 1.8.5 would reproduce this problem and 1.9.0beta4 not. But as for my app, there is a bug report when I run my .exe compiled through 1.9.0beta4

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 0xffffffffffffffff -- unknown function (ip: ffffffffffffffff)
in expression starting at none:1
unknown function (ip: 0000000000000000)
Allocations: 29050549 (Pool: 29032828; Big: 17721); GC: 43

The bug I met was caused by other reasons. My app now can be compiled successfully through julia 1.9.0beta4.

@Kyjor
Copy link

Kyjor commented Jun 2, 2023

I had the faded GUI issue with julia 1.8.5. I upgraded to 1.9.0 and I was able to compile successfully as well

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

6 participants