praydog / UEVR

Universal Unreal Engine VR Mod (4.8 - 5.4)
http://uevr.io
3.08k stars 158 forks source link

[BUG] bad performance of some games/apps if SteamVR is the runtime #289

Open randomVRguy opened 5 days ago

randomVRguy commented 5 days ago

I noticed a performance issue if an Unreal application runs in SteamVR and uses OpenGL. Now, what's the problem? Running a UEVR session where the respective app uses OpenGL as API + SteamVR as runtime results in a very low, stuttery frame rate and my GPU cannot reach a proper utilization. Further, there a is a certain stress on the GPU, called "compute 0" which is usually at zero in other scenarios. Btw, I'm not an expert enough to explain that "compute 0" thing, but it puts additional load on the GPU and prevents it from smooth rendering. To visualize this behavior, I put a screenshot from the Titanic 401 project here:

Bild1

Exactly the same happens in Senua’s Saga: Hellblade II (which interestingly also uses OpenGL) making it unplayable. Now, one might say, its a problem of AMD cards / drivers. Well, not really. The thing is, if I do the whole thing with Windows Mixed Reality as runtime (by using e. g. a Reverb G2), there is no such problem. Then, I can easily max out my GPU w/o any issues and of course I achieve much higher FPS. But once I switch to my PSVR2 on PC, which has to rely on SteamVR as runtime even for openXR, that mess happens.

I'm not sure if UEVR can do anything about it. But at least I want to bring this up here, in case there is a solution and to make people aware of that.

Btw, it was not easy to track down this problem. Initially I was just wondering why the performance is so bad in the PSVR2 in comparison to the Reverb G2. And only after a lot of testing I was able to narrow down this problem to the combination of OpenGL + SteamVR.

PC Specs: UEVR 1.04 Windows 10 RX 6800 Ryzen R5 3600 PSVR2 / HP Reverb G2 OpenXR in all cases (WITHOUT OpenXR Toolkit Companion app) WMR runtime & SteamVR

praydog commented 5 days ago

UEVR does not support OpenGL. It only supports DX11 and DX12. Whatever you are using is either showing an incorrect graphics API or you are showing the SteamVR mirror which might use OpenGL and is hogging GPU resources.

This does not sound like it's an issue with UEVR unless you can prove that GPU usage is not getting the same limitation in other apps.

randomVRguy commented 4 days ago

Oh, interesting about OpenGL. So the metrics overlay seems to be misinterpreting something (it's the official overlay provided by the AMD graphics driver). When I run the application without (UE)VR, it just tells me "N/A", so it might really be detecting something other than the main app even if that is in focus. Btw this does not happen with other games like Stray for instance (usually this tool is reliable). I have also adjusted the heading accordingly.

Anyway; here some more information about the actual problem. I did a 1:1 comparison with and without UEVR for that specific application. All settings are completely untouched between the 2 tests and there are no frame caps or anything. It turns out, w/o VR everthing is basically fine. I get over 300fps and nearly fulll GPU usage (even though there is already a little of the that "compute 0" load).

Demo401 - without VR

If I run the same scene now with UEVR I get a lot of "compute 0" going on and rendering goes crazy, see also the SteamVR frame time graph for reference. Like I said, in the headset you experience very stuttery like 20...30 fps although the the picture is perfect 3D and so on.

Demo401 - with VR

Want to mention again: if I do the whole thing with WMR as runtime, I don't get this problem (unfortunately I can not show this anymore as I do not own a Reverb G2 any longer). This only happens with SteamVR as runtime. So UEVR is not the core problem but maybe it's somehow involved. Other users with a native SteamVR headset should be able to reproduce it. Would be interesting if this also happens with Nvidia GPUs.