GPU running 100% while Unity build is minimized and running in background

This is with Unity 5.2.2f1.
I understand that other versions are also affected.

The issue is when Application.runInBackground = true and then the window is minimized, the GPU spikes up to 100%. It seems to happen more often when a scene has less objects in it. I’m assuming the data that is cached in larger scenes is helping restrict the framerate.

My understanding is that because it’s minimized and the GPU has less work to do, it’s running full speed. This is a known bug.

I’ve seen one other post related to this from a few years ago. The answer was to set the target frame rate to something lower. That does not solve the issue however.

I’ve also tried turning VSYNC count to 0 before the program is minimized (as VSYNC was to blame in the prior post and also in a Unity bug up for vote to fix).

The only option appears to be to turn Application.runInBackground to false. However, this is not an acceptable fix when you do need it running in the background.

Turning the thread speed down also has come to no avail.

I’m pretty sure I’m just out of luck until Unity Devs fix this. I’m hoping someone else has run into this issue and has some idea of how to limit the GPU. I’m not sure why lowering the framerate manually or turning off certain features doesn’t appear to work… there’s more going wrong in the background that I’m unable to see.

Thanks!

It appears to work if I first turn VYSNC off and then adjust the targetFrameRate before minimizing. Then when maximized change back to my desired settings.

QualitySettings.vSyncCount = 0;
Application.targetFrameRate = 1;

This is still a Unity bug. The GPU shouldn’t run unrestricted while it is minimized… it’s crazy that performance becomes unbearable when there should be less resources demanded by the GPU. There is an issue related to this, I voted on it yesterday and added a comment with further versions affected. If it’s an issue for you, please vote on it as well.
Here is that issue

Feel free to add input if there is a better way to do this. At the moment this appears to work just fine.