oreon-engine icon indicating copy to clipboard operation
oreon-engine copied to clipboard

Loading fonts image via VkImageHelper.loadImageFromFile(...) causes error output in console

Open aromanelli opened this issue 5 years ago • 11 comments

The following error appears on the console when starting up VkOreonworlds. Specifically, when line 133 in VkGUI.java makes a call to VkImageHelper.loadImageFromFile(...) ...

ERROR OCCURED: Object: 0x7ff8c8826cc8 (Type = 6) | vkCmdPipelineBarrier(): dstStageMask flag VK_PIPELINE_STAGE_FRAGMENT_SHADER_BIT is not compatible with the queue family properties of this command buffer. The spec valid usage text states 'Any pipeline stage included in srcStageMask or dstStageMask must be supported by the capabilities of the queue family specified by the queueFamilyIndex member of the VkCommandPoolCreateInfo structure that was used to create the VkCommandPool that commandBuffer was allocated from, as specified in the table of supported pipeline stages.' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdPipelineBarrier-srcStageMask-01183)

The above error is outputted to the console when method vkCmdPipelineBarrier(...), at line 390, in CommandBuffer, is called. See attached screenshots for further info.

oreonengine ij error screenshot 1 oreonengine ij error screenshot 2

aromanelli avatar Sep 01 '18 01:09 aromanelli

when you start the demo, there is an initial output in the console: the graphics device and the queue families of the system. What is the output for you there? Because the error is device specific

fynnfluegge avatar Sep 01 '18 07:09 fynnfluegge

@oreonengine Here's the output from a run (see file). The app runs, and you see the water and Sun, with no glitches/studders. If you didn't look at the console, you'd think everything was running fine.

Do note that there are multiple continuous errors being displayed in the log. I ended up manually closing the app to get the console output to stop rolling along. I opened this ticket just on the first error outputted to the console, and not for any follow-up errors output.

My OS is Ubuntu Budgie 18.04.1 LTS (64-bit), using Gnome 3.28.2. Processor is Intel Core i7 CPU 980 @ 3.33GHz x 12, with 24GB RAM. I'm using a GigaBytte GeForce GTX 1050 OC Edition, with 2GB GDDR5 (PCIe/SSE2). Its a DirectX 12 ready card, and is six months old.

oreonengine console output.txt

EDIT: Forgot the most important thing, the video driver info ... software and updates - nvidia software driver info

aromanelli avatar Sep 01 '18 18:09 aromanelli

Alright thank you, this is a warning by Vulkan. I guess the selected queue family capabilities does not match the use cases the engine needs. It works correctly since the the pipeline barrier (vkCmdPipelineBarrier) is skipped but not even needed by your device. The GTX 1050 is fast enough that the pipeline barriers are not even triggered. However, for slow devices this can be critical and should be fixed.

fynnfluegge avatar Sep 04 '18 08:09 fynnfluegge

@oreonengine FYI, there's other follow-up errors to the console in that log file. For example, closing a channel before the children are closed, etc. I didn't know if they were artifacts of the original error, or their own errors, but I decided on the former, and didn't open additional tickets for the latter. You may want to look at the whole log file to see if I am correct in that assumption, or not (subsequent errors are because of the initial error, instead of their own self-contained errors).

aromanelli avatar Sep 04 '18 18:09 aromanelli

Please go to VkGUI class starting at line 133 where fonts image is loaded.:

VkImage fontsImage = VkImageHelper.loadImageFromFile(
	device.getHandle(), memoryProperties,
	device.getTransferCommandPool().getHandle(),
	device.getTransferQueue(),
	"gui/tex/Fonts.png",
	VK_IMAGE_USAGE_SAMPLED_BIT,
	VK_IMAGE_LAYOUT_SHADER_READ_ONLY_OPTIMAL,
	VK_ACCESS_SHADER_READ_BIT,
	VK_PIPELINE_STAGE_FRAGMENT_SHADER_BIT,
	VK_QUEUE_FAMILY_IGNORED);

change

device.getTransferCommandPool().getHandle(),
device.getTransferQueue(),

to

device.getGraphicsCommandPool().getHandle(),
device.getGraphicsQueue(),

or if that doesn't help to

device.getComputeCommandPool().getHandle(),
device.getComputeQueue(),

fynnfluegge avatar Sep 05 '18 15:09 fynnfluegge

@oreonengine Attaching two text files, with the output after each of the two changes you requested. After each change, the errors still occurred. I manually stopped the client in both cases after about 20-30 seconds of displaying/running. I double-checked that I'm still running the same video card driver now as of when I opened this bug report.

oreonengine getGraphicsXXX console output.txt oreonengine getComputeXXX console output.txt

aromanelli avatar Sep 05 '18 17:09 aromanelli

Alright, I will go deeper into it. It is possible that I have the same erros with a Titan Xp but somehow this device doesn't outputs validation messages... I guess somewhere I specified a commandPool from a queue family which is not compatible with the queue to which the command buffer is submitted, it should be a small fix, but I need to search for the affected command buffer(s).

fynnfluegge avatar Sep 06 '18 13:09 fynnfluegge

@oreonengine Just to point out explicitly, I'm using the open source version of the Nvidia driver, and not the closed-source version from Nvidia itself (Ubuntu Budgie doesn't give me the option to install the closed version), so the open-sourced version may have additional error outputting to console, that the closed version does not, hence why you don't see those errors, maybe??

If there's any additional debugging help I can do for you, please feel free to reach out to me. I'll keep monitoring this bug report page.

aromanelli avatar Sep 06 '18 16:09 aromanelli

I am getting this: C:\dev\java\oreon-engine\oreonengine\examples-vulkan\target>java -jar examples-vulkan-3.0.0.jar Could not decode image file [ile:/C:/dev/java/oreon-engine/oreonengine/examples-vulkan/target/examples-vulkan-3.0.0.jar!/gui/tex/Fonts.png]: [Unable to open file] Exception in thread "main" java.lang.NullPointerException at org.oreon.core.vk.wrapper.buffer.StagingBuffer.(StagingBuffer.java:19) at org.oreon.core.vk.wrapper.image.VkImageHelper.loadImage(VkImageHelper.java:74) at org.oreon.core.vk.wrapper.image.VkImageHelper.loadImageFromFile(VkImageHelper.java:49) at org.oreon.vk.components.ui.VkGUI.init(VkGUI.java:133) at org.oreon.examples.vk.oreonworlds.VkSystemMonitor.init(VkSystemMonitor.java:24) at org.oreon.vk.engine.VkDeferredEngine.init(VkDeferredEngine.java:180) at org.oreon.examples.vk.oreonworlds.VkOreonworlds.main(VkOreonworlds.java:17)

any idea why? opengl example works fine tho.

civortech avatar Jul 05 '21 01:07 civortech

@civortech

I am getting this: C:\dev\java\oreon-engine\oreonengine\examples-vulkan\target>java -jar examples-vulkan-3.0.0.jar Could not decode image file [ile:/C:/dev/java/oreon-engine/oreonengine/examples-vulkan/target/examples-vulkan-3.0.0.jar!/gui/tex/Fonts.png]: [Unable to open file] Exception in thread "main" java.lang.NullPointerException at org.oreon.core.vk.wrapper.buffer.StagingBuffer.(StagingBuffer.java:19) at org.oreon.core.vk.wrapper.image.VkImageHelper.loadImage(VkImageHelper.java:74) at org.oreon.core.vk.wrapper.image.VkImageHelper.loadImageFromFile(VkImageHelper.java:49) at org.oreon.vk.components.ui.VkGUI.init(VkGUI.java:133) at org.oreon.examples.vk.oreonworlds.VkSystemMonitor.init(VkSystemMonitor.java:24) at org.oreon.vk.engine.VkDeferredEngine.init(VkDeferredEngine.java:180) at org.oreon.examples.vk.oreonworlds.VkOreonworlds.main(VkOreonworlds.java:17)

any idea why? opengl example works fine tho.

Going off of the stacktrace only (bolded/italicized part), and not having looked at the code referenced by the stacktrace, either the .jar file is bad, or it does not have inside of it (jars are just zip files) the Fonts.png file. Another possibility is upper/lower case issues if running under Linux.

Try using zip to open the .jar file and look inside of it for the Fonts.png file, see if its there.

aromanelli avatar Jul 05 '21 05:07 aromanelli

thx for response. running on win10pro with i7 4th gen, 32gb ram and gtx1080, jdk 8, vulkansd 1.2.154.1, netbeans 13 the resource is there: image

seems to be an issue in org.oreon.core.vk.image VkImageLoader.decodeImage with the stbi_load not liking the absolute path.

civortech avatar Jul 06 '21 02:07 civortech