scenerygraphics / scenery

Flexible VR Visualisation for Volumetric and Geometric Data on the Java VM, powered by Kotlin and Vulkan.
https://scenery.graphics
GNU Lesser General Public License v3.0
129 stars 32 forks source link

Race conditions in Vulkan? #191

Closed kephale closed 5 years ago

kephale commented 6 years ago

Vulkan fails to start with these as the last messages. By fails to start I mean that when opening SciView the render output never shows up. However, this only works when log level is info. When log level is debug the startup time is a bit slower, hence the suspicion of a race condition. [ Note that this doesn't always happen, but it is repeatable ]

[SciJava-cfff6af-Thread-1] INFO VulkanRenderer - Recreating Swapchain at frame 0
[SciJava-cfff6af-Thread-1] INFO FXSwapchain - Created 2 swapchain images
[SciJava-2a073cbf-Thread-1] INFO VulkanRenderer - Recreating Swapchain at frame 0
[SciJava-2a073cbf-Thread-1] ERROR VulkanRenderer - Call to allocate image staging memory of size 1920000 failed: A device memory allocation has failed.

A related observation, sometimes when attempting to open volumes in Vulkan, they never show up (but other elements of the scene do show up).

skalarproduktraum commented 6 years ago

Slightly strange... what version of Nvidia's driver are you using? And could you try running this with validation layers enabled (with Vulkan SDK installed, run scenery/sciview with -Dscenery.VulkanRenderer.EnableValidations=true)?

skalarproduktraum commented 5 years ago

Any more info on this, @kephale? Otherwise I'll close this because I cannot reproduce it.

kephale commented 5 years ago

I haven't seen this in a while, but I've added an unsightly amount of Thread.sleep calls to my scripts. IMHO there is still a notable design issue that needs to be addressed with the async implementation relative to user expectations of synchronous control. The most common glaring example of this is the need to use Thread.sleep when doing screenshots and such.

skalarproduktraum commented 5 years ago

As there's no more information on this. I'll close it for the moment. Feel free to reopen in case this still occurs.