-
Notifications
You must be signed in to change notification settings - Fork 407
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
Performance issue with debugPrintfEXT using Vulkan 1.1 #7562
Comments
I have zero explanation, but thanks for doing some debugging to narrow down this to being a strange Vulkan 1.1 issue I will try and reproduce and figure out what is going on |
Oddly, I can no longer reproduce this. I had multiple SDKs installed, removed all of them and only installed the most recent one. So most probably this was a problem with my setup. Sorry for the noise. |
ok, if you see it again PLEASE report it |
Reopening this. I have submitted a PR for a shader debugprintf sample at KhronosGroup/Vulkan-Samples#945 (review) and one of the reviewers seems to have the exact same problem. I couldn't reproduce it on my machine after cleaning up SDK installs. |
In case you need a repo, we have merged the shader debugprintf sample at https://github.com/KhronosGroup/Vulkan-Samples I can now reproduce this most of the time, and others have reported that problem too. It may be the sample's fault after all, though I can't seem to see why. |
Yep I saw and plan to use that! I have as of 2 days ago, started to really get working on Debug PrintF again, it had not had any real attention towards it and so hopefully very soon (pending I'm off next week) get fixed soon Thanks for keeping this issue alive |
I can also confirm the following results for the same shader_debugprintf sample on macOS Ventura (modified to enable the portability enumeration extension and flag), using Vulkan SDK 1.3.283.0:
|
ok, sorry for the delay, grabbed latest ToT of Vulkan-Samples and can experience this... time to dig in |
ok so the slow frame is occurring from The issue is not just DebugPrintf, but also GPU-AV which as of #7321 started to use --- a/layers/gpu/instrumentation/gpu_shader_instrumentor.cpp
+++ b/layers/gpu/instrumentation/gpu_shader_instrumentor.cpp
@@ -236,8 +236,8 @@ void GpuShaderInstrumentor::PreCallRecordCreateDevice(VkPhysicalDevice physicalD
}
} else if (api_version == VK_API_VERSION_1_1) {
// Add our new extensions (will only add if found)
- const std::string_view ts_ext{"VK_KHR_timeline_semaphore"};
- vku::AddExtension(*modified_create_info, ts_ext.data());
+ // const std::string_view ts_ext{"VK_KHR_timeline_semaphore"};
+ // vku::AddExtension(*modified_create_info, ts_ext.data());
add_missing_features();
}
} confirmed this by adjusting the samples to // framework/core/device.cpp
VkDeviceCreateInfo create_info{VK_STRUCTURE_TYPE_DEVICE_CREATE_INFO};
+ enabled_extensions.push_back(VK_KHR_TIMELINE_SEMAPHORE_EXTENSION_NAME);
// samples/extensions/shader_debugprintf/shader_debugprintf.cpp
app_info.pEngineName = "Vulkan Samples";
- app_info.apiVersion = VK_API_VERSION_1_1;
+ app_info.apiVersion = VK_API_VERSION_1_2; and I get the same slowdown effects |
ok, so was able to find the real source
this means when the app was using If I swap the app to |
I think I see what is going on. The 'logic' I put into calling vvl::Queue::PostSubmit() occasionally misses a submission. This is usually hidden by calling the wrong version of vkWaitSemaphores(). THAT is hidden by the stub functions we create. So we're 3 bugs deep so far but getting closer |
@SaschaWillems the latest VVL (at bottom of https://github.com/KhronosGroup/Vulkan-ValidationLayers/actions/runs/10115568549 when it finish building) should have this fixed, unfortunately it missed the 1.3.290 SDK, but thanks for reporting this as this would have been worse to figure out later why the synchronization inside GPU-AV was not working for something more complex |
Thank you for fixing this. Very much appreciated :) |
I'm seeing the same issue again with the latest SDK, see KhronosGroup/Vulkan-Samples#1187 Might be a regression. |
I will take a look today/tomorrow (and reply on the Samples PR), thanks for pinging here |
You can check if it started happening after #8546 |
going to just reopen, will take a look at the #8546 thanks @artem-lunarg for pointing that out |
I just grabbed the last Samples, and hacked to be - set_api_version(instanceApiVersion <= VK_MAKE_API_VERSION(0, 1, 3, 290) ? VK_API_VERSION_1_2 : VK_API_VERSION_1_1);
+ set_api_version(VK_API_VERSION_1_1);
- app_info.apiVersion = instanceApiVersion <= VK_MAKE_API_VERSION(0, 1, 3, 290) ? VK_API_VERSION_1_2 : VK_API_VERSION_1_1;
+ app_info.apiVersion = VK_API_VERSION_1_1; and I can't reproduce even on old SDK versions locally |
There have been some new discoveries in the linked issue at KhronosGroup/Vulkan-Samples#1187. tl;dr: It only seems to happen when VulkanConfigurator is active and might be an issue on our side. Not quite sure yet. |
pulled down that PR and found 283 - 1 fps gonna try and find the commit that changes it for me |
add more fuel to the confusion, I tried the 1.3.290 SDK and get 1 FPS, but if I build with that commit tag (a926291) I don't see the slowdown ... officially confused 😢 |
Did some researching (@artem-lunarg might need help here) On Windows AMD CPU there is no issue, but on NVIDIA it is getting blocked (so not a platform issue itself) I turned off the DebugPrintf pass so it is not instrumenting anything, and it is the same, so it around the queue being blocked The blocking is happening at
If I change I tried to just make it Edit - So I noticed there were two things hitting this cc @SRSaunders |
@spencer-lunarg I can check this later today, maybe will come up with questions how to reproduce.
One useful tip! When debugging this code almost always I want to modify |
Environment:
Describe the Issue
When using
debugPrintfEXT
along withVkValidationFeaturesEXT
to fetch the debug output with a debug messenger callback, performance is so severely impacted, that the application is no longer interactive.The setup:
Application:
Vertex shader:
After some debugging with a minimal sample, I noticed that this only happens with Vulkan 1.1 (set in
VkApplicationInfo
). Using any other api version, performance is fine.Summary:
I can only imagine that the combination of
debugPrintfEXT
,VkValidationFeaturesEXT
andVK_API_VERSION_1_1
triggers an odd constellation in the layers that somehow causes a severe slowdown.Expected behavior
Using
debugPrintfEXT
withVkValidationFeaturesEXT
shows the same performance no matter what API version.Valid Usage ID
n/a
Additional context
n/a
The text was updated successfully, but these errors were encountered: