Open sunny-chung opened 1 week ago
Hey @sunny-chung What is the device you are running this on? Can you create a minimal reproducible with this problem and share it with us?
I can clearly see this in both cases:
Failed to create Skia Metal context!
I wonder why any metal commands are dispatched in a first place.
Hi @elijah-semyonov
I am running on a M2 MacBook Pro.
I can only provide the project I am working on to you, as I am not sure what is going on. The issue is not frequently reproducible. But once I hit it, I would keep hitting for a while. The file Main.kt may have what you need. Please let me know if I use Compose Desktop in a wrong way.
Thanks, I'll have a look.
Are there some specific circumstances, that you could note, that lead to this? Do you have some heavy graphics application running along? I've played with an app for several minutes but didn't manage to reproduce the behavior.
My wild guess is that id <MTLCommandQueue>
is null if there are windows(popups) opened and closed very quickly for continuous time span.
It was solved by this PR on iOS: https://github.com/JetBrains/compose-multiplatform-core/pull/1127 If it's indeed the case, I'll roll a speculative fix for skiko window management on macOS.
~It apparently only reproducible with IntelliJ IDEA and after I upgraded Compose Multiplatform from 1.6.0-rc02 to 1.6.2.~ It only happens while launching the application.
I did have running lots of browsers along. It seems my Mac runs apparently slower and displays some black pixels if I have Instagram with HDR media opening.
Near the end of Main.kt, there is a dummy Window
. It will be dismissed after some background loading and after 500ms, and immediately followed by launching another Window
. Perhaps that relates to the issue you mentioned.
I have just reproduced with:
run
with IntelliJ IDEA.:ux-and-transport-test:check
, the window created is an empty window.run
. Now the application also shows an empty window, with the reported error messages output in the console.run
, the issue still exists.clean
and then run
, the issue still exists.During the time, I have no other heavy graphic-demanding applications running.
Edit: Run ./gradlew run
in an external console yields the same result. Sometimes the issue is gone for a short while after reopening IntelliJ IDEA, sometimes after I rerun the :ux-and-transport-test:check
gradle task and let it completes for several times.
Describe the bug On running the gradle task
run
, an empty window is displayed, and some error messages are logged.Affected platforms
Versions
To Reproduce Steps and/or the code snippet to reproduce the behavior:
run
. Optionally, add the java VM option-Xmx4096m
to the run configuration.Expected behavior A window with application UI should be displayed.
Screenshots
Additional context
Log:
When "Insufficient Memory" appeared, I checked "Activity Monitor" in macOS and observed both IntelliJ IDEA and MainKt (the application) did not exceed the customized JVM memory limit. Their sum did not exceed the customized JVM memory limit set on IntelliJ IDEA as well.
"Insufficient Memory" does not always appear (e.g. the first screenshot).
This issue does not consistently appear all the time. I just want to know how could I workaround this when it appears, except restarting my computer.