Gnimuc / CImGui.jl

Julia wrapper for cimgui
https://github.com/cimgui/cimgui
MIT License
253 stars 25 forks source link

No GUI shown with compiled julia app using CImGui #68

Open sairus7 opened 2 years ago

sairus7 commented 2 years ago

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 commented 2 years ago

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

sairus7 commented 2 years ago

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

Gnimuc commented 2 years ago

Does the JIT-ed version look good?

sairus7 commented 2 years ago

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 commented 2 years ago

On Ubuntu it is completely invisible:

image
L1ghtingBolt commented 1 year ago

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 commented 1 year ago

Which version?

FaresX commented 1 year ago

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 commented 1 year ago

cc @pxl-th

pxl-th commented 1 year ago

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 commented 1 year ago

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 commented 1 year ago

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 commented 1 year ago

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 commented 1 year ago

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