ValveSoftware / openvr

OpenVR SDK
http://steamvr.com
BSD 3-Clause "New" or "Revised" License
6.07k stars 1.28k forks source link

High GPU usage in Unity overlay applications #1593

Open MattFiler opened 2 years ago

MattFiler commented 2 years ago

When using the latest SteamVR plugin and the new XR management system in Unity (testing with 2019.4.26), setting my "Application Type" to "Overlay" in the OpenVR settings produces unusually high GPU usage.

An example in a new, clean, empty project, containing only the SteamVR plugin: "Scene" uses around 11% GPU in build at runtime, "Overlay" uses around 85% GPU.

Is this a known issue?

MattFiler commented 2 years ago

To come back to this issue - we did some further exploration and discovered that the problem was due to overlay applications ignoring any frame limits (targetFrameRate, vsync, etc), which allowed the overlay app to run at ~3000fps...

Our hacky solution was to use Thread.Sleep to limit the update rate, which clearly isn't ideal (but allowed us to ship)! Would be cool if this could be looked into further for a proper official fix.