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

hello_xr Vulkan renderer synchronization issue #526

Open
Rectus opened this issue Jan 9, 2025 · 1 comment
Open

hello_xr Vulkan renderer synchronization issue #526

Rectus opened this issue Jan 9, 2025 · 1 comment
Labels
synced to gitlab Synchronized to OpenXR internal GitLab

Comments

@Rectus
Copy link

Rectus commented Jan 9, 2025

When running the vulkan2 implementation of hello_xr, the program thread execution gets blocked for about 5ms when RenderView() is called the first time in a frame. The Function calls m_cmdBuffer.Wait() which is supposed to wait on the fence set in the previous frame. It should return instantly since the frame should already be rendered, but for some reason it doesn't. This causes the application to miss the optimal xrEndFrame timing, and in an application with an actual GPU workload, it would likely cause a missed frame.

I'm not sure if this is an issue in the application, or if it's caused by something else. Regardless, it seems that blocking on GPU work from the previous frame is a bad practice to teach, since it would break the CPU -> GPU pipelining in a real workload. RenderView() is also run twice per frame, once for each eye. It blocks until the GPU has rendered the first eye before rendering the second (interestingly this does not block for a significant time). A best practice would probably be to have a set of command lists for each swapchain image, with either one list per eye or handling both eyes in the same submission.

Tested on a Valve Index using SteamVR 2.9.5 under Windows 10.

Trace from Nvidia Nsight Systems
bild

@rpavlik-bot
Copy link
Collaborator

An issue (number 2426) has been filed to correspond to this issue in the internal Khronos GitLab (Khronos members only: KHR:openxr/openxr#2426 ), to facilitate working group processes.

This GitHub issue will continue to be the main site of discussion.

@rpavlik-bot rpavlik-bot added the synced to gitlab Synchronized to OpenXR internal GitLab label Jan 10, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
synced to gitlab Synchronized to OpenXR internal GitLab
Projects
None yet
Development

No branches or pull requests

2 participants