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

SDL + Vulkan backend logs errors in debug builds #663

Closed
mctb32 opened this issue Mar 1, 2025 · 8 comments
Closed

SDL + Vulkan backend logs errors in debug builds #663

mctb32 opened this issue Mar 1, 2025 · 8 comments

Comments

@mctb32
Copy link

mctb32 commented Mar 1, 2025

I'm having some problems with the Vulkan backend. In debug builds, randomly over the first few frames I'm getting errors in the log:

Image

The app I'm testing with is basically Diligent Tutorial01_HelloTriangle, but using SDL3 for window creation (also happened when I switched to SDL2). Here is the code: https://github.com/mctb32/sdl3_diligent_test/tree/main

I'm not getting any such errors in the actual Diligent Samples with the Vulkan backend, or when using other backends with SDL.

Any ideas what those errors mean, or if I'm doing something wrong? The SDL windows are created with the SDL_WINDOW_VULKAN flag.

@TheMostDiligent
Copy link
Contributor

Yes, these errors do sometimes appear in some Diligent samples too.
They started to pop up in Vulkan SDK 1.4.304.0 - it is not yet clear whether those are real issues or false positives from validation layers.
Which SDK do you use, 1.4.304.0 or 1.4.304.1?

@mctb32
Copy link
Author

mctb32 commented Mar 1, 2025

I'm on 1.4.304.0. I recently updated to this version because my validation layers were not in sync with SDK. I'm also investigating some random crashes I have when using the vulkan backned in a larger codebase, and I was hoping this could be somehow related and of some known cause.

@mctb32
Copy link
Author

mctb32 commented Mar 2, 2025

I found the cause of those errors on my system and it’s kind of strange as it is a combination of several factors…

First, all of the vulkan errors appear during diligent_swapchain->Present(1) and vSync on is necessary for the errors to appear. I wasn’t getting the errors in diligent samples, because vsync was off by default, but as soon I turn the checkbox on, I get the same errors over several frames and then they stop.

Second, my system is a bit peculiar as I’ve got a single display connected to my GPU via DisplayPort and a home theater amplifier connected over HDMI for sound. For this to work, Windows display is set to duplicate as only then I can have the display working and the sound via hdmi. And this causes the error to appear. As soon as I set windows display to only one screen without the HDMI output, the errors go away.

So it’s a combination of debug mode, vsync on, and windows display set to duplicate (with the second display receiving only sound, not doing any actual display – I don’t think it even supports the resolution/refresh rate I’m using on my primary screen).

So do you think this is something that can be fixed inside diligent, or is this a core Vulkan issue?

@TheMostDiligent
Copy link
Contributor

I honestly don't think these errors are specific to your system setup as I also see them sometimes. The swap chain implementation has not changed for a long time, so if it is a real issue, it is not new. So far I lean towards this being false positive, there was a very similar false positive error.
If it was a real synchronization error, I would expect it to happen every frame, not just few first frames.
I will keep an eye on this problem, will see if it still happens in 1.4.304.1.

@mctb32
Copy link
Author

mctb32 commented Mar 3, 2025

Upgraded to sdk 1.3.204.1 and the errors went away and I can't reproduce them. So I guess you were right. Thanks and sorry for the false report.

@mctb32 mctb32 closed this as completed Mar 3, 2025
@TheMostDiligent
Copy link
Contributor

Upgraded to sdk 1.3.204.1 and the errors went away and I can't reproduce them

Did you mean 1.4.304.1?

@mctb32
Copy link
Author

mctb32 commented Mar 4, 2025

Did you mean 1.4.304.1?

Yes. Sorry for the typo.

@TheMostDiligent
Copy link
Contributor

I tried 1.4.304.1, and I still see the same errors. Also, validation layer developers suggested that 1.4.304.1 is essentially the same as 1.4.304.0 with a couple of critical fixes. Not sure why errors don't happen for you.
Let's see what happens in the next release - they said it is supposed to be in a week or two.

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

No branches or pull requests

2 participants