How to profile Shipping build?

Hello,

Since I upgraded my project from ue5.3.2 to ue5.4.2, I noticed my packaged shipping build exhibits a large CPU spike every few seconds.

I tried to pinpoint the issue using PIE / Standalone / Packaged Develop build to no avail - the CPU spikes ONLY happens in packaged shipping build.

Since UnrealInsight cannot profile shipping build, I ran out of ideas on how to solve this issue.

Any ideas, advice, suggestions will be welcomed, thank you!

I see stuff in the docs about profiling shipping builds, although I’ve never done it

Thank you for the quick response!

I tried to use UnrealInsight to profile my shipping build, however, I stuck at the point where I need to type in console command : trace.send localhost - since there is no console command in shipping build for me to type in.

I then tried to type in -trace=default in MyShippingGame.exe shortcut, and that didn’t work either (my game didn’t show up in UnrealInsight session). :frowning:

Are there other ways to hookup shipping build into UnrealInsight?

Edit: 2024/07/12
According to this documentation:

Shipping build - This is the configuration for optimal performance and shipping your game. This configuration strips out console commands, stats, and profiling tools.

It looks like we aren’t able to profile shipping build?

You found this out in the future? :joy:

image

Oh, I must’ve miss typed.
Anyways, thanks for the reminder, I’ll correct it.

I don’t know if this is a shipping build or not… ( at timestamp ) - could be totally wrong :thinking:

1 Like

As an idea for a further search, in c++ there are such defines as:

#define ALLOW_CONSOLE_IN_SHIPPING 0
#define ALLOW_PROFILEGPU_IN_SHIPPING 0

i don’t see something like allow cpu profiling, but overall my idea is that profiling of shipping build is probably possible with proper build settings

2 Likes

Yeah, I was following this video tutorial, but sadly, the -trace=default commands didn’t work in shipping build. :frowning:

Thanks for sharing these flags, I’ll give it a try!

Edit 2024/07/13:
It turns out I need to download the engine source code and build my own UE5 for these flags to successfully compile in a shipping build.

1 Like

Was starting to suspect that… :blush:

This is a follow-up on my problem:
I found out that the problem has something to do with t.MaxFPS console command.

If I set t.MaxFPS = 60 the shipping build will run at 60fps most of the time, and occasionally, CPU (RHI) time will spike from 5~10(ms) to 20~30(ms) which causes the overall FPS to drop from 60fps to 40~30fps

If I set t.MaxFPS = 120 the shipping build will still run at 60fps, however, CPU (RHI) time is stable at 10~11(ms) - no spikes anymore.

I’ve done the above test under both windowed mode and fullscreen mode with shipping build and yielded the same result.
I suspect the RHI time spike has to do with GPU barely maintaining at 60fps - set it to 120fps and that condition goes away - however, an explanation of what actually happened will be very appreciated.

1 Like

I have no idea why this is happening, but I’ve also seen people report that frame rate smoothing, can also make the frame rate spikey… :melting_face: