Why is Unreal Engine Laggy when I am NOT playing a youtube video in the background?

I just started using Unreal Engine for the first time a few weeks ago and recently the whole engine, whether I’m selecting Actors, grabbing something out of the content drawer, or running the game in the window gets really laggy.

I have a fantastic computer and never lag on any application, but since I was new to Unreal Engine, I just googled how to fix lag, because maybe it’s just a really heavy application or something.

Well, while watching tutorial videos on how to profile and fix lag and yada yada yada, I noticed something, if there is a video on my second monitor PLAYING, ALL lag goes away, for the whole engine, AND while playing the game. It is only when I PAUSE THE VIDEO, does the lag come back for all aspects of the engine.

I don’t know how to represent engine lag here, but I can include the “Stat Unit” Values I get during each scenario (watching a video in background, not watching video in background).

while VIDEO IS PLAYING in google chrome on second monitor:
Frame: 10.61ms
Game: 10.60ms
Draw: .5ms
GPU: 5.05ms
RHIT: 2.84ms
DynRes: Unsupported
Draws: 400
Prims: 44.3k

while VIDEO IS PAUSED in google chrome on second monitor (or just while nothing is playing, google chrome doesn’t necessarily have to be open, or any other application for that matter)
Frame: 50.36ms
Game: 9.8ms
Draw: .12ms
GPU: 5.4ms
RHIT: 16.77ms
DynRes: Unsupported
Draws: 400
Prims: 44.3k

Any help with this would be greatly appreciated, I’ve never posted on any forum with any question, but this question is extremely specific and also kind of inverse of what should happen, so I’m hoping to find some help here. Thanks!

EDIT:
Upon further investigation, I noticed I get that nice performance in unreal engine and high frame rates when priority is given to ANYTHING BUT unreal engine, for instance, if I press the windows key on my keyboard, I instantly start getting great frames again, of course until I click back into unreal engine and it goes back to being bad. But it seems that the chrome youtube video KEEPS the priority OFF of unreal engine, therefor giving me great frames and great performance whenever a video is playing.

ALSO

Not sure if this helps, but it gets worse as time goes on:

First 5 minutes of Unreal Engine being open:
Frame (Unfocused): 10ms
Frame (Focused): 10ms

After 10 minutes of unreal engine being open, even if I don’t do anything:
Frame (Unfocused): 10ms
Frame (Focused): 20ms

After 20 minutes of unreal engine being open, even if I don’t do anything:
Frame (Unfocused): 10ms
Frame (Focused): 30ms

And so on and so forth until it caps out at about 50-60ms after about 45 minutes

Have you tried to restart the editor, even maybe created a new project?
Also try to restart your computer. (force restart)

Either way, if that does not fix the problem try go to Edit->Editor Pref->Performance->Use Less CPU when in background. Also play with the Monitor Editor Perfomance in the same section.

Let me know if anything helps, cheers.

Strange. Normally the engine will be laggy when it is out of focus, not the other way around. Are you running it on a laptop? Try setting the performance mode to max (click battery icon) could be some optimization method is running which dynamically updates when watching HD media or something, but that is just a guess.

Thanks for the reply! Unfortunately that stuff didn’t work, but you did help me find out more information about the issue! I’m going to edit the original question now

That’s actually a super logical answer, unfortunately no though, I’m using a PC, and I actually don’t have it on max performance on the Windows settings side of things (For some reason it always switches itself back so I just gave up after like the 100th time) BUT, I do have it on max performance in the nvidia control settings! hopefully that is the same thing.

Edit:

I just switched my windows settings to performance, even if it changes later, and it unfortunately did not fix it.

Is this laptop or have you turned on energy saving by any chance?
To turn that stuff it is enough to change monitor sleep time and click on whole energy saving plan, not just screen saving.

So it may be that playing video un-throttles some stuff in energy saving, while unreal does not do anything like that.

Oh looks like you checked this.

ps.
You can try setting maximum FPS for unreal engine. Years ago (when cool kids wanted dual cards), i had such setup, and everything was great, however unreal boiled them, in about 5min they got to 100C+ range. It is because with “no limit for max fps” Unreal happily used all it could.

So my next guess: your GFX may throttle, or your CPU. get someting like RIVA tuner, CPUz, AIDA, to see temperatures. OR limit FPS in unreal to 60max.

Hey Guys I found the issue, just incase someone else has this problem in the future I’ll post it here. It wasn’t an Unreal Engine specific problem.

When I clicked to focus on Unreal Engine, my GPU usage dropped to 10%, when I clicked off, it would rise to about 40-50%.

FOR ME it was my graphics driver, so I installed DDU (driver uninstaller), uninstalled the nvidia graphics driver, then reinstalled it, and now everything works fine.

BUT do not assume it will be you graphics driver, because the only reason I found out this solution is because someone had a similar problem in a video game they were playing and FOR THEM, it wasn’t the graphics driver the game was waiting on, it was the keyboard and mouse drivers, when they focused the game it would lag, when they unfocused the game it woudn’t lag, same scenario. So they just used a ps4 controller instead of using their keyboard and mouse and boom, max fps, no lag.

fortunately for me, unfortunate for you reading this, I got lucky that it was just a graphics driver, apparently it can be like any driver at all, and I have no idea how to check which driver its waiting on, I just took a guess, so good luck future people.

2 Likes

Thanks for letting us know. Glad you found the issue, this one was very specific.

Just had to pop in to say I was having this same very odd issue, and to say that the clean graphic drivers solution using DDU fixed it for me also. Thanks, it was driving me nuts!