EarlyUpdate.XRUpdate taking about 75% of main thread cpu time. Is this normal?

@colinleet any word on the bug case number?

EDIT: I agree with @Clavus , I believe the early xr update is just there to maintain the Oculus FPS

@ColtonKadlecik_VitruviusV

I finally got a response after a month in mid August, they couldn’t reproduce the behavior and requested some videos of the bug happening. I sent them them three videos about a week later and added a webcam feed to simulate irregular frame timing (along with moving to 2020.1). The updated code is on the repo I posted above. I haven’t heard anything back in the last two weeks since then. I can post my videos here if anyone is interested – if so let me know here.

1 Like

So this still hasn’t be answered? I’m also getting high CPU usage and there no answers anywhere.

We haven’t gotten an answer/fix yet as far as I’m aware. And @colinleet if you could share the videos that’d be awesome, just for us to validate that yes we are having the same problem indeed.

My performance problems were largely resolved after Oculus released v19 of their utilities plugin, which fixed a big performance regression with Rift S users in the editor.

Are you referring to version 19 of the Oculus Integration asset from the asset store, @Clavus ? As the performance problems I and others in this thread have been describing is a part of the Unity XR Plugin Management. I personally don’t even have the Oculus Integration installed, only the Oculus XR Plugin from the Package Manager.

1 Like

Yeah, this is an XR specific bug.
I’ve been pulled away working on in game content and I’ll re-grab the repo Colin linked to and report a bug case on it this weekend. I’m getting back into testing builds :wink:

@Clavus Yes I made this thread only in reference to XRManagement Plugin not the old Oculus SDK.

@Autarkis @ExodusOTH
Here is the bulk of the message I sent back three weeks ago:

"There were a number of changes in behaviour I’ve been seeing since switching to 2020.1:

  1. Basically the early update call now is usually around 1 full vr frame instead of 2 … most of the time.

  2. The performance issues are much more apparent when there is inconsistent code which runs periodically (slow code every few frames).

This gives the xrEarlyUpdate call a hard time figuring out what it’s timing should be, and causes it to wait a very large amount of time for most frames (8-12 ms on average, spiking sometimes to around 20 ms). To simulate this I added a script to render my webcam within the scene, since it adds around a 3 ms script call that is called about every 3rd VR frame. (30 fps vs 90 fps).

  1. The issue is much much more apparent in the editor when the scene view is open.

  2. The bug only shows in standalone when I have a webcam running in the build (simulating inconsistent frame timings).

My updated version (with the webcam) of the test scene can be pulled from here:

The videos show a bunch of combinations of all the test cases above.

First video is 9 minutes of editor tests, the first 3 minutes is mostly me explaining my computer setup. The last 6 minutes are editor timings.

External build with no webcam (good performance):

External build with webcam (bad performance):

"
I haven’t gotten any updates yet.

1 Like

Interesting that you’re seeing no slow perf hit when you don’t have a webcam enabled. Havent tried that, i’ll get on it this week :slight_smile:

It’s having an uneven background task which does it (editor/webcam/whatever). It’s not "only"with the webcam, a webcam is just an easy to code processing-intensive backgrounds task to generate a repeatable test case with. Hence XREarlyUpdate almost always being a problem in editor.

1 Like

Hi @colinleet

Could you post a link to that ticket you created in the Issue tracker? I can’t find it by doing a search for ‘EarlyUpdate.XRUpdate

I can confirm that I’m getting the exact same problem in 2019.4.9 LTS

I never received an issue tracker. Just one email response saying that they couldn’t find the issue asking for the videos I posted above. No response to the videos yet (a month out).

1 Like

Thanks @colinleet Doesn’t bode well. I’ve submitted my own bug report (essentially duplicating your own) and I’d recommend that anyone with the same issue do the same.

The more people flag up the issue, the more Unity are likely to take it seriously. It really does make the editor unusable for VR development.

Hi, this issue has been passed to the developers: Unity Issue Tracker - [XR SDK][Oculus] EarlyUpdate.XRUpdate spikes inconsistently

4 Likes

Thanks @Tomana5 Much appreciated.
Fingers crossed for a quick fix :slight_smile:

@Tomana5 Thank you for the update it is very much appreciated!

@Autarkis @ExodusOTH @Clavus @TheMaximL @mutp @turdann @ROBYER1_1
@ImpossibleRobert
@ColtonKadlecik_VitruviusV @Katerpilet

TLDR: We’ve got a bug report to upvote!

(* tagging everyone who has commented)

Long version: Thank you everyone who has commented and helped with this post over the last three months, it has given me major respect for the development community here as a whole. Hearing other confused voices is a seriously bright light in a very long dark tunnel when you’ve been facing down a undefeatable bug for so long. Last thing for us to do now is just upvote the tracker to the stars.

5 Likes

voted :slight_smile:

Along the lines of the Bug Report that we have listed, does anybody else experience the EarlyUpdate.XRUpdate WAY overcompensate when trying to “match 11ms”? For example, mine is taking 16ms on a consistent basis (not inconsistent like the bug ticket we have), to bring my total to 22ms. The rest of my game is only taking 6ms.

1 Like

Yes that’s the exact conditions I reported about at the start of this thread (see the last photo I posted in this thread). For me it was not 100% constant in editor but with 2019.4/early 2020.1 releases I did have XREarlyUpdate overshoot more than a full VR frame often, especially when the scene view was open. It was more rare in standalone builds.

1 Like