Optimizing the Work with Unreal Engine from Home
Note: The following recommendations were tested and verified with Unreal Engine 4.24, and an asymmetrical bandwidth connection of 100 Mbps down, 5 Mbps up.
Using Unreal Engine from home with a limited upload bandwidth may result in a significant performance decrease. There are two main reasons for this decrease in performance:
Unreal Engine creates in each build very large PCH files.
Links for the target toolset (such as Visual Studio compiler toolset) are running remotely, syncing many OBJ and PDB files to remote machines.
These attempts to sync large PCH, OBJ, and PDB files to remote machines over a very limited upload bandwidth, slow down the task execution dramatically, and can even cause abrupt termination of tasks and disconnections. Therefore, in order to overcome the decrease in performance and to achieve acceleration, these two issues need to be addressed.
Disabling the Usage of PCH Files
To increase performance when building with Unreal Engine from home, it is recommended to disable the usage of PCH files. This is done through the BuildConfiguration.xml file of the Unreal Engine version you are using.
Note: The BuildConfiguration.xml file is located at:
install_dir\Unreal Engine\UnrealBuildTool\BuildConfiguration.xml
> To disable the PCH files usage:
Add the following XML element to the BuildConfiguration.xml file of your Unreal Engine:
<BuildConfiguration> <bUsePCHFiles>false</bUsePCHFiles> </BuildConfiguration>
For example, the usage of PCH files was disabled in the following BuildConfiguration.xml file:
<?xml version="1.0" encoding="utf-8" ?>
<Configuration xmlns="https://www.unrealengine.com/BuildConfiguration">
<BuildConfiguration>
<bUsePCHFiles>false</bUsePCHFiles>
</BuildConfiguration>
</Configuration>
Forcing Links to Run Locally
To increase performance when building with Unreal Engine from home, it is also recommended to force links NOT to run remotely, and to avoid syncing large OBJ and PDB files to remote machines over a limited bandwidth connection.
This is done by setting as False
the linker flag - LinkAction.bCanExecuteRemotely
. By setting it to False
, this flag instructs the Unreal Build System that is integrated with IncrediBuild to execute all link tasks on the local machine. This flag is applied separately to each toolset, and it resides in the .cs file of the selected toolset.
By default, for most toolsets the LinkAction.bCanExecuteRemotely
flag is already set to False
. In these cases, the links will run only on your local machine and you do not need to change their settings. However, there are two toolsets for which you need to change the settings:
VCToolChain
The settings file is located at:
Install_dir:\UE4\Engine\Source\Programs\UnrealBuildTool\Platform\Windows\VCToolChain.csHoloLensToolChain
The settings file is located at:
Install_dir:\UE4\Engine\Source\Programs\UnrealBuildTool\Platform\HoloLens\HoloLensToolChain.cs
> To force links to run locally:
Open the .cs file that applies to the toolset you are using.
Locate the
LinkAction.bCanExecuteRemotely
flag, and set its value toFalse
.
For example, the links of VCToolChain were set NOT to run remotely in the following VCToolChain.cs file: