2024-01-25 13:45:53 -05:00
|
|
|
[Horde](../Home.md) > Getting Started: Remote Compilation
|
|
|
|
|
|
|
|
|
|
# Getting Started: Remote Compilation
|
|
|
|
|
|
|
|
|
|
## Introduction
|
|
|
|
|
|
|
|
|
|
Horde implements a platform for generic remote execution workloads, allowing clients to leverage idle CPU cycles on
|
|
|
|
|
other machines to accelerate workloads that would otherwise be executed locally. Horde's remote execution platform
|
|
|
|
|
allows issuing explicit commands to remote agents sequentially, such as "upload these files", "run this process",
|
|
|
|
|
"send these files back", and so on.
|
|
|
|
|
|
2024-03-08 14:09:44 -05:00
|
|
|
**Unreal Build Accelerator** is a tool that implements lightweight virtualization for
|
|
|
|
|
third party programs (such as C++ compilers), allowing it to run on a remote machine - requesting information from the
|
|
|
|
|
initiating machine as it's required. The remotely executed process behaves as if it's executing
|
2024-01-25 13:45:53 -05:00
|
|
|
on the local machine, seeing the same view of the file system and so on, and files are transferred to and from the
|
|
|
|
|
remote machine behind the scenes as necessary.
|
|
|
|
|
|
2024-02-20 07:14:49 -05:00
|
|
|
Unreal Build Tool can use Unreal Build Accelerator together with Horde to offload build tasks to connected agents,
|
|
|
|
|
spreading the workload over multiple machines.
|
|
|
|
|
|
2024-01-25 13:45:53 -05:00
|
|
|
## Prerequisites
|
|
|
|
|
|
2024-03-08 18:43:57 -05:00
|
|
|
* Horde Server and one or more Horde Agents (see [Getting Started: Install Horde](InstallHorde.md))
|
2024-03-08 14:09:44 -05:00
|
|
|
* A workstation with a UE project under development.
|
|
|
|
|
* Network connectivity between your workstation and Horde Agents on port range 7000-7010.
|
2024-01-25 13:45:53 -05:00
|
|
|
|
2024-01-25 15:34:02 -05:00
|
|
|
## Steps
|
|
|
|
|
|
2024-03-08 14:09:44 -05:00
|
|
|
1. On the machine initiating the build, ensure your UE project is synced and builds locally.
|
|
|
|
|
2. Configure UnrealBuildTool to use your Horde Server by updating
|
|
|
|
|
`Engine/Saved/UnrealBuildTool/BuildConfiguration.xml` with the following:
|
2024-02-20 07:14:49 -05:00
|
|
|
|
|
|
|
|
```xml
|
|
|
|
|
<?xml version="1.0" encoding="utf-8" ?>
|
|
|
|
|
<Configuration xmlns="https://www.unrealengine.com/BuildConfiguration">
|
2024-03-08 14:09:44 -05:00
|
|
|
|
2024-02-20 07:14:49 -05:00
|
|
|
<BuildConfiguration>
|
2024-03-08 14:09:44 -05:00
|
|
|
<!-- Enable support for UnrealBuildAccelerator -->
|
2024-02-20 07:14:49 -05:00
|
|
|
<bAllowUBAExecutor>true</bAllowUBAExecutor>
|
|
|
|
|
</BuildConfiguration>
|
2024-03-08 14:09:44 -05:00
|
|
|
|
2024-02-20 07:14:49 -05:00
|
|
|
<Horde>
|
2024-03-08 14:09:44 -05:00
|
|
|
<!-- Address of the Horde server -->
|
2024-02-20 07:14:49 -05:00
|
|
|
<Server>http://{{ SERVER_HOST_NAME }}:13340</Server>
|
2024-03-08 14:09:44 -05:00
|
|
|
|
|
|
|
|
<!-- Pool of machines to offload work to. Horde configures Win-UE5 by default. -->
|
|
|
|
|
<WindowsPool>Win-UE5</WindowsPool>
|
2024-02-20 07:14:49 -05:00
|
|
|
</Horde>
|
2024-03-08 14:09:44 -05:00
|
|
|
|
2024-02-20 07:14:49 -05:00
|
|
|
<UnrealBuildAccelerator>
|
|
|
|
|
<!-- Enable for visualizing UBA's progress (optional) -->
|
|
|
|
|
<bLaunchVisualizer>true</bLaunchVisualizer>
|
|
|
|
|
</UnrealBuildAccelerator>
|
2024-03-08 14:09:44 -05:00
|
|
|
|
2024-02-20 07:14:49 -05:00
|
|
|
</Configuration>
|
|
|
|
|
```
|
|
|
|
|
|
2024-03-08 14:09:44 -05:00
|
|
|
Replace `SERVER_HOST_NAME` with the appropriate address of your Horde server installation.
|
|
|
|
|
|
|
|
|
|
* `BuildConfiguration.xml` can be sourced from many locations in the filesystem depending your preference
|
2024-03-08 18:43:57 -05:00
|
|
|
including locations typically under source control. See
|
|
|
|
|
[Build Configuration](https://docs.unrealengine.com/en-US/build-configuration-for-unreal-engine/).
|
2024-03-08 14:09:44 -05:00
|
|
|
in the UnrealBuildTool documentation for more details.
|
|
|
|
|
|
|
|
|
|
3. Compile your project through your IDE as normal. You should observe log lines such as:
|
|
|
|
|
|
|
|
|
|
```text
|
2024-02-20 07:14:49 -05:00
|
|
|
[Worker0] Connected to AGENT-1 (10.0.10.172) under lease 65d48fe1eb6ff84c8197a9b0
|
|
|
|
|
...
|
|
|
|
|
[17/5759] Compile [x64] Module.CoreUObject.2.cpp [RemoteExecutor: AGENT-1]
|
|
|
|
|
```
|
|
|
|
|
|
2024-03-08 14:09:44 -05:00
|
|
|
This indicates work is being spread to multiple agents. If you enabled the UBA visualizer, you can also see
|
|
|
|
|
a graphical overview how the build progresses over multiple machines.
|
2024-02-20 07:14:49 -05:00
|
|
|
|
2024-03-08 14:09:44 -05:00
|
|
|
For debugging and tuning purposes, it can be useful to force remote execution all compile workfloads. To do
|
2024-03-08 19:09:18 -05:00
|
|
|
so, enable the following option in your `BuildConfiguration.xml` file or pass `-UBAForceRemote` on the
|
2024-03-08 14:09:44 -05:00
|
|
|
UnrealBuildTool command line:
|
|
|
|
|
|
|
|
|
|
```xml
|
|
|
|
|
<UnrealBuildAccelerator>
|
|
|
|
|
<bForceBuildAllRemote>true</bForceBuildAllRemote>
|
|
|
|
|
</UnrealBuildAccelerator>
|
|
|
|
|
```
|