LWJGL / lwjgl3-demos

Demo suite for LWJGL 3
BSD 3-Clause "New" or "Revised" License
346 stars 85 forks source link

Synchronisation problem? #54

Open jdf-id-au opened 7 months ago

jdf-id-au commented 7 months ago

Hi, thanks for the wonderful introductions to Vulkan in LWJGL.

To prevent the following error when runnning InstancedSpheresDemo.java, I need to put Thread.sleep(40); before vkQueueWaitIdle(queue);:

[mvk-warn] VK_TIMEOUT: vkQueueWaitIdle timed out after 10 frames while awaiting 1 swapchain image presentations to complete.
ERROR OCCURED: VK_TIMEOUT: vkQueueWaitIdle timed out after 10 frames while awaiting 1 swapchain image presentations to complete.
libc++abi: terminating due to uncaught exception of type std::__1::system_error: mutex lock failed: Invalid argument

I don't think it's specific to this demo, this is just an example. I'm only starting to learn the Vulkan API so can't quite work out whether perhaps Host access to queue must be externally synchronised is violated, or there is some other reason for the timeout.

I'm using the JVM flag -XstartOnFirstThread because I'm on macOS; could that be relevant?

(repo revision, Vulkan 1.3.268.1 (MoltenVK), Java 17.0.4, macos 14.1.2, Intel Xeon W, Radeon Pro Vega 56)

Snowiiii commented 5 months ago

Yeah there are many Users having the same Problem, https://github.com/KhronosGroup/MoltenVK/issues/1990

It has to do with MacOS and MoltenVK