Use this recipe to profile a game built with Unreal Engine. See how you can run Intel® VTune™ Profiler within the Unreal Engine environment to profile your game.
Often, the most important factor that affects the performance of a game is the frame rate. This is the speed with which the GPU renders game graphics. However, the CPU can also impact game performance in several ways:
Here are the hardware and software requirements for this performance recipe.
Application: Unreal Engine 4.25.4. The sample game in this version of Unreal Engine is the Action RPG tutorial.
Tools: Intel® VTune™ Profiler version 2022 - Hotspots Analysis (using User-Mode Sampling)
Starting with the 2020 release, Intel® VTune™ Amplifier has been renamed to Intel® VTune™ Profiler.
Most recipes in the Intel® VTune™ Profiler Performance Analysis Cookbook are flexible. You can apply them to different versions of Intel® VTune™ Profiler. In some cases, minor adjustments may be required.
Get the latest version of Intel® VTune™ Profiler:
From the Intel® VTune™ Profiler product page.
Download the latest standalone package from the Intel® oneAPI standalone components page.
CPU/GPU: 11th Generation Intel® Core™ i7-1165G7 CPU @ 2.80GHz with Intel® Iris® Xe MAX Graphics
Operating system: Windows* 11 Enterprise
Open the game in the Unreal editor.
Build the game. Make sure to select the Development Build Configuration and Include Debug Files options.
Open Intel® VTune™ Profiler and click New Project on the Welcome screen.
Specify a project name and a location for your project.
In the WHERE pane, select Local Host.
In the Application field of the WHAT pane, enter the path to the game executable.
In the Application parameters field, enter -VTune.
In the HOW pane, select the Hotspots analysis type and enable user-mode sampling.
Click Start to run the analysis.
When the data collection stops, Intel® VTune™ Profiler finalizes the results. This process may take a few minutes as Intel® VTune™ Profiler finds and resolves debug symbols.
Once results have been finalized, the Summary tab displays information about:
Switch to the Bottom-up window to see a list of functions. The default sorting is by descending order of CPU time.
Change the grouping from Function / Call Stack to Task Domain / Task Type / Function / Call Stack to focus on Unreal Engine tasks which were identified by the Intel® VTune™ Profiler Instrumentation and Tracing Technology API (ITT API).
In this example, there is considerable spin time in the Render and Game threads. Also, nearly half of the overall CPU utilization was spent spinning, or waiting for a resource to return.
The CPU utilization histogram (in the Summary tab) tells us something important. Although this game was running over 100 threads, for the majority of the run, this game only utilized a single CPU or was mostly idle.
From here, you can try to identify whether the high amount of spin is affecting performance negatively. You can also examine how to make use of more CPU capability. Generally games are not expected to consume the full amount of hardware resources, but there is room on this system for more parallelism.
For additional insights into hotspots, open the Flame Graph view to see a graphical representation of call stacks from the top down.