You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[BUG] OpenXR: xrEndFrame blocks until vsync while xrWaitFrame returns immediately (Linux, Vulkan) #1071
On Linux, SteamVR's OpenXR runtime paces the application inside xrEndFrame
instead of xrWaitFrame:
xrWaitFrame returns almost immediately (median 0.05–0.3 ms), even when
called early in the frame interval.
xrEndFrame blocks for 4–6 ms (median 4.6–4.8 ms) and returns about 0.2 ms
after the next vsync.
The block does not track GPU load. The app's GPU work is about 1.3 ms per
frame and GPU utilisation is 15–25%.
The spec places throttling in xrWaitFrame ("xrWaitFrame throttles the
application frame loop in order to synchronize application frame submissions
with the display") and says xrEndFrame "may return immediately".
Why it matters
An engine that calls xrEndFrame on its render thread loses that thread for
the length of the block. The next frame cannot start until just after vsync,
and the compositor starts its work about 7.5 ms after vsync, so the app has
about 7.3 ms to produce a frame rather than 11.1 ms at 90 Hz. In a scene that
fits the full interval comfortably, 8–10% of frames were reprojected; with
the block kept off the render thread, about 1%.
I see the same on a Bigscreen Beyond 2e, but only for the first 1 to 55 s after an app starts. Then xrWaitFrame starts blocking:
at first
later
time in xrWaitFrame
0.01 ms
5.3-5.4 ms
time in xrEndFrame
9.0 ms
3.6-3.7 ms
predicted display time minus xrWaitFrame return
19.0-19.2 ms
22.9 ms
frame timing m_flWaitGetPosesCalledMs
+0.8 to +1.0 ms
-8.1 to -8.2 ms
frame timing m_flCompositorRenderStartMs
-2.8 to -2.9 ms
-0.5 to -0.7 ms
I started a small OpenXR/Vulkan test app 8 times for 2 minutes each, in two SteamVR sessions on the 2.19.3 beta. It does about 2 ms of CPU and 4.5 ms of GPU work per frame and logs when each call is made and when it returns. The table has the range of its per-start medians; the frame-timing rows are relative to vsync.
Each change came right after a late frame: one that was ready (m_flNewFrameReadyMs) 0.2 to 7.6 ms after the time the compositor usually starts (last row, left column). The compositor started as soon as that frame was in. Late frames that were ready before that, even by just 0.2 ms, changed nothing.
In seven of the eight starts that frame followed an xrEndFrame call that took 14-19 ms instead of 9.
After the change it didn't go back in the rest of any run (1 to 2 minutes). At most 5 single frames per run looked like the left column.
Every start began in the left column again, also the ones 2 to 7 minutes after the first in the same SteamVR session.
hello_xr (the OpenXR SDK sample) starts the same way in the frame timing, with its frames ready about 2 ms earlier. Two of four 40 s runs stayed that way to the end; the other two changed after 18 and 19 s.
Setup: Beyond 2e at 90 Hz, RTX 4090, NVIDIA 620.70.06, Arch, Linux 7.3.4, KWin Wayland. The logs, the test app and the script that makes the table are in the zip.
Activity
michaelkrauty commentedon Nov 15, 2026
I see the same on a Bigscreen Beyond 2e, but only for the first 1 to 55 s after an app starts. Then
xrWaitFramestarts blocking:xrWaitFramexrEndFramexrWaitFramereturnm_flWaitGetPosesCalledMsm_flCompositorRenderStartMsI started a small OpenXR/Vulkan test app 8 times for 2 minutes each, in two SteamVR sessions on the 2.19.3 beta. It does about 2 ms of CPU and 4.5 ms of GPU work per frame and logs when each call is made and when it returns. The table has the range of its per-start medians; the frame-timing rows are relative to vsync.
m_flNewFrameReadyMs) 0.2 to 7.6 ms after the time the compositor usually starts (last row, left column). The compositor started as soon as that frame was in. Late frames that were ready before that, even by just 0.2 ms, changed nothing.xrEndFramecall that took 14-19 ms instead of 9.hello_xr(the OpenXR SDK sample) starts the same way in the frame timing, with its frames ready about 2 ms earlier. Two of four 40 s runs stayed that way to the end; the other two changed after 18 and 19 s.Setup: Beyond 2e at 90 Hz, RTX 4090, NVIDIA 620.70.06, Arch, Linux 7.3.4, KWin Wayland. The logs, the test app and the script that makes the table are in the zip.
app-start-pacing.zip