Comments (5)
Issue arise when we loop on the swapchain:
- in the other samples, we ask vk to wait for this semaphore (through the
ppWaitSemaphores
of the submit info)- in this sample, we don't wait for this one.
This should fix the issue. Sadly I fail for another reason which is [WARNING] vkAcquireNextImageKHR returned: VK_SUBOPTIMAL_KHR (same on all samples). I believe it's because I'm on wayland+sway, and the window gets resized slightly when being created, to the swapchain needs to be recreated.
@RenfengLiu is that patch fixing your issue?
diff --git a/projects/23_async_compute/main.cpp b/projects/23_async_compute/main.cpp index f3bf21a..f9e938f 100644 --- a/projects/23_async_compute/main.cpp +++ b/projects/23_async_compute/main.cpp @@ -925,16 +925,18 @@ void ProjApp::BlitAndPresent(PerFrame& frame, uint32_t swapchainImageIndex) } PPX_CHECKED_CALL(cmd->End()); - const grfx::Semaphore* ppWaitSemaphores[4] = { + const grfx::Semaphore* ppWaitSemaphores[] = { frame.composeData[0].completeSemaphore, frame.composeData[1].completeSemaphore, frame.composeData[2].completeSemaphore, - frame.composeData[3].completeSemaphore}; + frame.composeData[3].completeSemaphore, + frame.imageAcquiredSemaphore + }; grfx::SubmitInfo submitInfo = {}; submitInfo.commandBufferCount = 1; submitInfo.ppCommandBuffers = &cmd; - submitInfo.waitSemaphoreCount = 4; + submitInfo.waitSemaphoreCount = sizeof(ppWaitSemaphores) / sizeof(ppWaitSemaphores[0]); submitInfo.ppWaitSemaphores = ppWaitSemaphores; submitInfo.signalSemaphoreCount = 1; submitInfo.ppSignalSemaphores = &frame.renderCompleteSemaphore;
Thanks for the patch, this should work. I overlooked this when writing the sample since the pattern is different from other samples. Can you submit this as a PR?
from bigwheels.
I can't reproduce on my machine. Do you see this error consistently? What GPU do you have? I wonder if it's something related to the sample making assumption on graphics/compute queue availability or something of the sort.
from bigwheels.
I'm on a windows machine with vulkan 1.3.236. It's caused by https://github.com/google/bigwheels/blob/main/projects/23_async_compute/main.cpp#L757, the frame.imageAcquiredSemaphore
is signaled every time, but no one is waiting for it.
from bigwheels.
Can reproduce this on my machine:
CPU info for AMD Ryzen 9 3900X 12-Core Processor
Using Vulkan 1.1
Found GPU [0]: AMD Radeon RX 5700 XT (RADV NAVI10)
graphics queue count : 1
compute queue count : 4
transfer queue count : 4
Creating application graphics device using AMD Radeon RX 5700 XT (RADV NAVI10)
requested graphics queue count : 1
requested compute queue count : 1
requested transfer queue count : 0
[WARNING] Transfer queue will be shared with graphics or compute queue.
*** VULKAN VALIDATION ERROR MESSAGE ***
Severity : ERROR
Type : [VALIDATION]
Objects : [0]: <UNNAMED OBJECT>
Message : Validation Error: [ VUID-vkAcquireNextImageKHR-semaphore-01286 ] Object 0: handle = 0x72303f0000000052, type = VK_OBJECT_TYPE_SEMAPHORE; | MessageID = 0xe9e4b2a9 | vkAcquireNextImageKHR: Semaphore must not be currently signaled. The Vulkan spec states: If semaphore is not VK_NULL_HANDLE it must be unsignaled (https://www.khronos.org/registry/vulkan/specs/1.3-extensions/html/vkspec.html#VUID-vkAcquireNextImageKHR-semaphore-01286)
vk_23_async_compute: /home/nathan/projects/mainline/bigwheels/src/ppx/grfx/vk/vk_instance.cpp:115: VkBool32 ppx::grfx::vk::DebugUtilsMessengerCallback(VkDebugUtilsMessageSeverityFlagBitsEXT, VkDebugUtilsMessageTypeFlagsEXT, const VkDebugUtilsMessengerCallbackDataEXT*, void*): Assertion `false' failed
from bigwheels.
Issue arise when we loop on the swapchain:
- in the other samples, we ask vk to wait for this semaphore (through the
ppWaitSemaphores
of the submit info) - in this sample, we don't wait for this one.
This should fix the issue. Sadly I fail for another reason which is [WARNING] vkAcquireNextImageKHR returned: VK_SUBOPTIMAL_KHR (same on all samples).
I believe it's because I'm on wayland+sway, and the window gets resized slightly when being created, to the swapchain needs to be recreated.
@RenfengLiu is that patch fixing your issue?
diff --git a/projects/23_async_compute/main.cpp b/projects/23_async_compute/main.cpp
index f3bf21a..f9e938f 100644
--- a/projects/23_async_compute/main.cpp
+++ b/projects/23_async_compute/main.cpp
@@ -925,16 +925,18 @@ void ProjApp::BlitAndPresent(PerFrame& frame, uint32_t swapchainImageIndex)
}
PPX_CHECKED_CALL(cmd->End());
- const grfx::Semaphore* ppWaitSemaphores[4] = {
+ const grfx::Semaphore* ppWaitSemaphores[] = {
frame.composeData[0].completeSemaphore,
frame.composeData[1].completeSemaphore,
frame.composeData[2].completeSemaphore,
- frame.composeData[3].completeSemaphore};
+ frame.composeData[3].completeSemaphore,
+ frame.imageAcquiredSemaphore
+ };
grfx::SubmitInfo submitInfo = {};
submitInfo.commandBufferCount = 1;
submitInfo.ppCommandBuffers = &cmd;
- submitInfo.waitSemaphoreCount = 4;
+ submitInfo.waitSemaphoreCount = sizeof(ppWaitSemaphores) / sizeof(ppWaitSemaphores[0]);
submitInfo.ppWaitSemaphores = ppWaitSemaphores;
submitInfo.signalSemaphoreCount = 1;
submitInfo.ppSignalSemaphores = &frame.renderCompleteSemaphore;
from bigwheels.
Related Issues (20)
- Provide a way for applications to specify needed vulkan features/extensions
- [benchmark] [graphics_pipeline] dx12 crashes on startup HOT 5
- Allow fluid simulation class to be embedded in other apps HOT 1
- Rename `GeometryOptions` to `GeometryCreateInfo`
- Change Geometry's buffer growth rate to reduce allocations HOT 2
- GPU mipmap generation broken when running with SwiftShader HOT 1
- vk_24_push_constants segfaults on SwiftShader + Linux
- Organize benchmarks under folder benchmarks instead of samples
- [benchmark] invalid timestamp computation for multi-pass rendering HOT 12
- SPV shaders from previous builds in root directory overwrite compiled shaders in a custom directory HOT 1
- Update documentation on FluidSim::GetNormalizedSize
- ClearRenderTarget/ClearDepthStencil don't work with dynamic render passes HOT 1
- Remove the need for PPX_BUILD_XR in project level code HOT 1
- Consider removing function Profiler functionality
- Simplify RenderPass creation logic
- [graphics_pipeline] Wireframe mode crashes for Vulkan build
- [graphics_pipeline] Toggling 1x1 texture mode causes crash
- [Wayland] fix BigWheels when fractional scaling is enabled.
- [Wayland] fix BigWheels when scaling is enabled.
- vk_alloc has validation error "pAllocateInfo->allocationSize is 268435456 bytes from heap 2,but size of that heap is only 257949696 bytes"
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from bigwheels.