I’ve been having this problem for the last day or two that my game is using nearly 100% of my GPU at all times, which is something it never did before. The fans on my GPU spin like crazy after a short while and the game is laggy from the start. In the build, it’s even quite noticeable that it’s skipping multiple frames every second.
Two “solutions” that I could find on Google included;
“Turn on V-Sync”, which helps to reduce the GPU usage somewhat, but the lag still remains.
“It’s okay for a GPU to hit 100%”, which is cool with me, except that it has never really gone above 75%-ish in the year that I’ve been working on it and it doesn’t explain the very noticeable lag in the editor and in the builds of the game.
If I revert back to a backup from not too long ago, there’s no lag, nor will the GPU exceed any high percentages.
The changes that I’ve made since the last stable version of the project have been rather minor, or at least in the sense that it’s nothing that should have significant impact on performance. (Problem persists if I disable the changes)
I also don’t have any errors, warnings or prints in the console that are stacking up and the profiler is not showing anything out of the ordinary, so I’m confused as to why the GPU is struggling to keep up.
I considered the fact that my GPU might be the problem, but I can run bigger games like GTA 5, DOOM and Forza Horizon 4 at (nearly) ultra settings with ease. No lag or high GPU usage, so I doubt it’s my GPU.
I would include some screenshots, but I wouldn’t know of what, since there are no errors and the profiler is not showing anything strange. Only thing is that that the game lags because of a high GPU usage.
Tl;dr: Recently, the editor and builds of my game started using 100% of my GPU at all times. No errors, no oddities in the profiler. It has never done this before and now the game lags for whatever reason.
I’m using Unity 2018.3.8f1
16GB DDR4
GeForce GTX 970 4GB
You say the profiler is not showing anything out of the ordinary, but the profiler should be showing what Unity is having the GPU working on regardless. I’d compare the profiler output between your current version and your last stable version to see what increased in usage.
Thank you for you response, and I have checked the profiler again, but that’s the strange part; Comparing this version with an older version doesn’t show much of a difference, at least not bigger than a 5-10% increase at certain points. But Task Manager is still showing the GPU for Unity reaching those high numbers. Even if it’s a different scene, the issue remains.
The profiler though should be at least showing you what it is working on, even if it is hard to tell what changed. Whatever Unity is spending so much time on, work on reducing that.
I have a 1080 Ti which I use for Deep Learning and want to try ML-Agents. I made a scene with two cubes and if I built the game and started the executable then my GPU usage went up to +98% and even my computer restarted sometimes, even though I don’t even use my GPU for display but I have my monitors connected to my motherboard. And then I thought that it may be the case that Unity may assume that if there is a GPU then yeah, sure, there is the business to do. So I hooked my monitors to the GPU and GPU usage is down at 4%.
Hope this helps others.
Is there a way to tell Unity not to use the GPU for rendering? I want my GPU to only handle deep learning stuff so that while training I can do other stuff without facing laggy display.
You can launch the Unity player with command line arguments to disable graphics output
I would also suggest running some stress tests (prime95, furmark etc). Your computer should not be crashing under any workload, and it is a sign that something is wrong with it.
Been trying to find the answer to this with my colleague for a week, they have the problem on their device but I dont on mine.
On my device the game runs at 60fps. On his it runs at 2500fps. Not found the solution in the settings yet but the solutions is to force a frame limit so unity doesnt automatically set the graphics settings too damn high. Goodluck with your builds team!
I have added a script that, in the Awake method, sets a frame rate limit per second based on the refresh rate of the screen: Application.targetFrameRate = (int)Screen.currentResolution.refreshRateRatio.value;
However, the load on the graphics processor (GPU) has not disappeared. Then I discovered that Vsync was turned off in the resolution selection menu. After I turned it on, the problem was solved.