Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
aromanelli opened this issue Sep 1, 2018 · 11 comments

Comments

@aromanelli
Copy link
Contributor

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

@fynnfluegge
Copy link
Owner

fynnfluegge commented Sep 1, 2018

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

@aromanelli
Copy link
Contributor Author

aromanelli commented Sep 1, 2018

@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

@fynnfluegge
Copy link
Owner

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.

@aromanelli
Copy link
Contributor Author

@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).

@fynnfluegge
Copy link
Owner

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(),

@aromanelli
Copy link
Contributor Author

aromanelli commented Sep 5, 2018

@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

@fynnfluegge
Copy link
Owner

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).

@aromanelli
Copy link
Contributor Author

@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.

@civortech
Copy link

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.

@aromanelli
Copy link
Contributor Author

@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.

@civortech
Copy link

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants