UE4 using a single core on multi-core pc

Hello, I have a 14-core workstation, however when I compile my ue4 c++ project, it will use maybe 5% utilization on a single cpu. I read comments that all cpu’s are used by default, but I don’t see this on my box.

I am running Engine Version 4.21.2 It appears some of what I read online around the issue is obsolete now since 2.19.

I have attempted to modify the BuildConfiguration.xml by adding the ProcessorCountMultiplier=2 and MaxProcessorCount=4 as an example with no effect. I’m not sure if I did this correctly. Below is my modified BuildConfiguration.

<?xml version="1.0" encoding="utf-8" ?>
<Configuration xmlns="https://www.unrealengine.com/BuildConfiguration">
  <LocalExecutor>
    <ProcessorCountMultiplier>1</ProcessorCountMultiplier>
    <MaxProcessorCount>4</MaxProcessorCount>
  </LocalExecutor>
  <ParallelExecutor>
    <ProcessorCountMultiplier>1</ProcessorCountMultiplier>
    <MaxProcessorCount>4</MaxProcessorCount>
  </ParallelExecutor>
  <SNDBS>
    <ProcessorCountMultiplier>4</ProcessorCountMultiplier>
    <MaxProcessorCount>4</MaxProcessorCount>
  </SNDBS>
</Configuration>

I also attempted to modify my build.cs with
bFasterWithoutUnity = true;
however this caused build errors.

I was unable to add the bFasterWithoutUnity = false to the BuildConfiguration.xml as it also caused build errors.

Any help is greatly appreciated.

You are aware that it simply runs compiler on X number of cpp files? in order to actully use 14 cores you need at least 14 files to be compiling. post you compilation log, also try removing buildconfiguration.xml

Thanks for responding ,

My project has 61 .cpp files and about 17,000 lines of code, but I’m usually only working in a single file at any one time. I tried making edits to several .cpp files and the build still focused on one core.

I removed the BuildConfiguration.xml file that I edited earlier, from C:\Users\User\AppData\Roaming\Unreal Engine\UnrealBuildTool\ but no change.

I notice on my quad core laptop, the same project will compile in about 59 seconds (24% cpu utilization across all four cores) after editing a single .cpp.

On my 14-core i9 it takes about 39 seconds (7% cpu utilization - actually 1 core at 100% utilization). I would expect the 14-core to be much faster than the 4-core, but also the 4-core laptop should be a lot quicker than 59 seconds I would think. Both are 16gb ram, SSD drives.

I can’t help but think I’m missing some compile flag somewhere. My laptop and workstation are both running vanilla 4.21.2

I don’t think it missing flag, can you show compilation log? you can cover up cpp file names and project name

Compiling on VS, the Output Log looks like this:

1>------ Skipped Build: Project: UE4, Configuration: BuiltWithUnrealBuildTool Win32 ------
1>Project not selected to build for this solution configuration
2>------ Build started: Project: VGS, Configuration: Development_Editor x64 ------
2>Using ‘git status’ to determine working set for adaptive non-unity build (F:\VGS_UNREAL).
2>Creating makefile for hot reloading VGSEditor (source directory changed)
2>Compiling game modules for hot reload
2>Using Visual Studio 2017 14.16.27023 toolchain (C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Tools\MSVC\14.16.27023) and Windows 10.0.16299.0 SDK (C:\Program Files (x86)\Windows Kits\10).
2>Building 3 actions with 28 processes…
2> [1/3] Module.VGS.cpp
2> [2/3] UE4Editor-VGS-3012.lib
2> Creating library F:\VGS_UNREAL\Intermediate\Build\Win64\UE4Editor\Development\VGS\UE4Editor-VGS-3012.lib and object F:\VGS_UNREAL\Intermediate\Build\Win64\UE4Editor\Development\VGS\UE4Editor-VGS-3012.exp
2> [3/3] UE4Editor-VGS-3012.dll
2> Creating library F:\VGS_UNREAL\Intermediate\Build\Win64\UE4Editor\Development\VGS\UE4Editor-VGS-3012.suppressed.lib and object F:\VGS_UNREAL\Intermediate\Build\Win64\UE4Editor\Development\VGS\UE4Editor-VGS-3012.suppressed.exp
2>Deploying VGSEditor Win64 Development…
2>Total build time: 38.50 seconds (Parallel executor: 31.71 seconds)
========== Build: 1 succeeded, 0 failed, 0 up-to-date, 1 skipped ==========

Compiling from the Editor, the Compiler Log is as the image attached. Couldn’t find an option in the Editor to copy/paste the text so i took a screen grab.

I solved this issue. I modified the BuildConfiguration.xml in C:\Users\User\AppData\Roaming\Unreal Engine\UnrealBuildTool\

mine looks like this

<?xml version="1.0" encoding="utf-8" ?>
<Configuration xmlns="https://www.unrealengine.com/BuildConfiguration">
  <ParallelExecutor>
	<MaxProcessorCount>32</MaxProcessorCount>
	<ProcessorCountMultiplier>32</ProcessorCountMultiplier>
  </ParallelExecutor>
  
  <LocalExecutor>
	<MaxProcessorCount>32</MaxProcessorCount>
	<ProcessorCountMultiplier>32</ProcessorCountMultiplier>
  </LocalExecutor>
</Configuration>

I deleted the following folders from my Unreal project
.vs
Binaries
DerivedDataCache
Intermediate

I deleted IncrediBuild from Visual Studio Installer ← This is really important to do. Otherwise the project will build on a single core.

Run the project in Unreal.
In Ureal go to File → Refresh Visual Studio Project
In Unreal go to File → Open Visual Studio Project
Rebuild the entire solution

Results

Rebuild started...
1>------ Rebuild All started: Project: mvp, Configuration: Development_Editor x64 ------
2>------ Skipped Rebuild All: Project: UE4, Configuration: BuiltWithUnrealBuildTool Win32 ------
2>Project not selected to build for this solution configuration 
1>Cleaning mvpEditor and UnrealHeaderTool binaries...
1>Using 'git status' to determine working set for adaptive non-unity build (E:\repos\mvp).
1>Creating makefile for mvpEditor (no existing makefile)
1>Parsing headers for mvpEditor
1>  Running UnrealHeaderTool "E:\repos\mvp\mvp.uproject" "E:\repos\mvp\Intermediate\Build\Win64\mvpEditor\Development\mvpEditor.uhtmanifest" -LogCmds="loginit warning, logexit warning, logdatabase error" -Unattended -WarningsAsErrors -abslog="C:\Users\Vivi-Desktop\AppData\Local\UnrealBuildTool\Log_UHT.txt" -installed
1>LogInit: Display: Loading text-based GConfig....
1>Reflection code generated for mvpEditor in 3.7518003 seconds
1>Building mvpEditor...
1>Using Visual Studio 2022 14.31.31104 toolchain (C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.31.31103) and Windows 10.0.18362.0 SDK (C:\Program Files (x86)\Windows Kits\10).
1>Building 21 actions with 32 processes...
1>  [1/21] Default.rc2
1>  [2/21] SharedPCH.Engine.ShadowErrors.cpp
1>  Detected compiler newer than Visual Studio 2019, please update min version checking in WindowsPlatformCompilerSetup.h
1>  [3/21] mvp.cpp
1>  [4/21] MovingPlatform.cpp
1>  [5/21] NPCStandStill.cpp
1>  [6/21] mvpGameModeBase.cpp
1>  [7/21] NPC_Interactable.cpp
1>E:\repos\mvp\Source\mvp\RaynorScripts\NPC\NPC_Interactable.cpp(27): warning C4996: 'UTextRenderComponent::SetText': Passing text as FString is deprecated, please use FText instead (likely via a LOCTEXT). Please update your code to the new API before upgrading to the next release, otherwise your project will no longer compile.
1>  [8/21] NPCStandStill.gen.cpp
1>  [9/21] mvp.init.gen.cpp
1>  [10/21] mvpGameModeBase.gen.cpp
1>  [11/21] MvpCharacter.gen.cpp
1>  [12/21] FriendlyNPC_AnimInstance.gen.cpp
1>  [13/21] MovingPlatform.gen.cpp
1>  [14/21] NPC_Interactable.gen.cpp
1>  [15/21] MvpCharacter.cpp
1>  [16/21] FriendlyNPC_AnimInstance.cpp
1>  [17/21] FriendlyNPC.cpp
1>E:\repos\mvp\Source\mvp\NPC\FriendlyNPC.cpp(25): warning C4996: 'UTextRenderComponent::SetText': Passing text as FString is deprecated, please use FText instead (likely via a LOCTEXT). Please update your code to the new API before upgrading to the next release, otherwise your project will no longer compile.
1>  [18/21] FriendlyNPC.gen.cpp
1>  [19/21] UE4Editor-mvp-0001.lib
1>     Creating library E:\repos\mvp\Intermediate\Build\Win64\UE4Editor\Development\mvp\UE4Editor-mvp-0001.lib and object E:\repos\mvp\Intermediate\Build\Win64\UE4Editor\Development\mvp\UE4Editor-mvp-0001.exp
1>  [20/21] UE4Editor-mvp-0001.dll
1>     Creating library E:\reposmvp\Intermediate\Build\Win64\UE4Editor\Development\mvp\UE4Editor-mvp-0001.suppressed.lib and object E:\repos\mvp\Intermediate\Build\Win64\UE4Editor\Development\mvp\UE4Editor-mvp-0001.suppressed.exp
1>  [21/21] mvpEditor.target
1>Total time in Parallel executor: 28.84 seconds
1>Total execution time: 34.85 seconds
1>Done building project "mvp.vcxproj".
========== Rebuild All: 1 succeeded, 0 failed, 1 skipped ==========

As you can see it says Building 21 actions with 32 processes…

I have a 1950X CPU

1 Like