Stuttering in Oculus Rift in packaged build

I keep getting a very strange problem with my packaged Oculus Rift project.

When running the packaged game I experience massive stuttering, while playing in editor is fine. At first I thought it had to be the scalability settings, but that’s not it. In fact, even at 50% screen res the stuttering does not improve.

The thing that makes it weird: the oculus debug tool shows the performance headroom is fine. It’s just dropping many application frames for some reason. The counter is constantly incrementing. Checking “stat unit” and the scene rendering stats confirms: everything seems rendered fast enough. A frame (almost never) takes more than 8ms. The mirrored image on the screen is also butter smooth. I even captured movies for the trailer in this state, while the headset was stuttering all the time.

Even weirder: at times the problem goes away, and not just in a new build but also in all my older archived builds. Then a couple of days or weeks later the problem returns (in all builds). I don’t think I’ve ever seen the problem before the new Rift Home update arrived, but I’m not 100% sure about that.

Development build vs shipping build, 32-bit vs 64-bit does not make a difference.

I have no idea how to approach this problem. Any ideas?

Using the CPU profiler I discovered that the GameThread is taking too much time in FrameTime → GameEngine Tick → RedrawViewports → Self.

Edit: using more stat counters I’ve tracked the problem down to a ovrp_WaitToBeginFrame call. In the editor this only takes 4ms. In the packaged build it takes 8 or 9ms, often tipping the gamethread total to over 12ms, causing the stuttering. I don’t know if this even makes sense, or if I’m looking at it the wrong way.

The problem went away when I updated my nvidia drivers.

I have this same problem in 4.22 but updating my Nvidia drivers did not solve it. .