Is it possible to monitor CPU and GPU usage in a UE4 game through Blueprints?

Is it possible to monitor CPU and GPU usage in a UE4 game? I ask because I procedurally generate most of my game, and I would like the world to be very large. If I generate a world at the start of each new game, the world generation process usually takes a few hours, but has before taken almost a day. Rather than wait that long, I thought that I could generate the basics for the world, and then an area around the player start. Then, while the player plays, the game continues to generate. The problem is, the generation eats up too much of the computer, and the game lags excessively until the generation is done.

Notes :

  • I do not know whether the generation is being done on the CPU, GPU.
  • I do not know how much RAM the generation process is using.
  • I would like to allot certain amounts of CPU/GPU/RAM to certain tasks in my UE4 game.
  • I use Blueprint, but know C++. If the management I am looking for can only be done with C++, could somebody direct me to a resource where I could learn how to integrate C++ and Blueprint?
  • Current UE version : 4.1
  • I posted this on the UE subreddit, do I have permission to post your answer there if you don’t post it yourself?

Thanks in advance!

There 2 ways i know to monitor

1.“stat” command, it a eries of monitoing tools there few of them, type in stat and you will have suggestions

2.There profiler in Window->Session Frontend->Profiler Tab, which allows you to record function call and then compare them against a lot of stats

You mean how to make new nodes? That easy :slight_smile: you just flag functions in UFUNCTION and they turn in to new once

Hi Durpies,

We have not heard back from you in a few days, so we are marking this post as Resolved for tracking purposes. If you are still experiencing the issue you reported, please respond to this message with additional information and we will offer further assistance.

Thank you.

I posted this same question on the UnrealEngine subreddit here. This is TechLethal’s updated answer.


Console Commands


AnswerHub
https://answers.unrealengine.com/questions/2845/gameplay-profiler.html


dumpframe

stat dumpframe -ms=## -depth=## -root=name

This command dumps a frame of stats.

  • Depth is used to cull everything deeper than the specified value in the callstack, default value is max_int.
  • MS is used to cull the callstack, by default this value is set to 5ms, so everything that takes less than 5ms will be aggregated and displayed as other children.
  • Root is a substring search and is used to cull the result to the particular name, can be used to search for issues with assets, objects etc. By default root is empty.

Examples

  1. stat dumpframe
  2. stat dumpframe -ms=.001 -root=initviews -depth=1
  3. stat dumpframe -ms=.001 -root=shadow
  4. stat dumpframe -ms=.001 -root=asset_name
  5. stat dumpframe -ms=.001 -root=skeletalmesh

DumpAve, DumpMax, DumpAdd

  1. stat DumpAve [-start | -stop | -num=###] -ms=## -depth=##
  2. stat DumpMax [-start | -stop | -num=###] -ms=## -depth=##
  3. stat DumpAdd [-start | -stop | -num=###] -ms=## -depth=##

These commands aggregate stats over multiple frames and then dump the results. If you want to start aggregating use command with -start or enter the number of frames. To stop use the command with -stop or if you entered a specific number of frames, just wait for the results. Num by default is set to 30 frames.

  • DumpAve gives the per-frame average.
  • DumpMax gives the worst frame for all callstacks.
  • DumpAdd gives the sum of all callstacks.

Examples

  1. stat dumpmax -start
  2. …play the game…
  3. stat dumpmax -stop
  4. stat dumpave -num=2000
  5. stat dumpmax -num=2000

DumpHitches

  1. stat DumpHitches

This command is a toggle. When it is on, it dumps out every frame that hitches. t.HitchThreshold is the console variable that controls what is considered a hitch. The default is 75ms.