2024-03-13 19:35:00 -04:00
|
|
|
[Horde](../../README.md) > Getting Started: Remote Compilation
|
2024-01-25 13:45:53 -05:00
|
|
|
|
|
|
|
|
# Getting Started: Remote Compilation
|
|
|
|
|
|
|
|
|
|
## Introduction
|
|
|
|
|
|
2024-03-20 20:04:01 -04:00
|
|
|
Horde implements a platform for generic remote execution workloads, allowing clients to leverage idle CPU cycles on
|
2024-03-12 12:56:12 -04:00
|
|
|
other machines to accelerate workloads that would otherwise be executed locally. With Horde's remote execution platform,
|
|
|
|
|
you can issue explicit commands to remote agents sequentially, such as "upload these files", "run this process",
|
2024-01-25 13:45:53 -05:00
|
|
|
"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
|
2024-03-12 12:56:12 -04:00
|
|
|
third-party programs (such as C++ compilers), allowing it to run on a remote machine - requesting information from the
|
|
|
|
|
initiating machine as 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-03-19 15:13:37 -04:00
|
|
|
**Unreal Build Tool** can use Unreal Build Accelerator with Horde to offload compilation tasks to connected agents,
|
2024-02-20 07:14:49 -05:00
|
|
|
spreading the workload over multiple machines.
|
|
|
|
|
|
2024-03-20 20:04:01 -04:00
|
|
|
> **Note:** Unreal Build Accelerator only supports Windows in Unreal Engine 5.4. Support for Mac and Linux are planned for
|
2024-03-19 15:13:37 -04:00
|
|
|
a future release.
|
|
|
|
|
|
2024-01-25 13:45:53 -05:00
|
|
|
## Prerequisites
|
|
|
|
|
|
2024-03-12 12:56:12 -04: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-12 12:56:12 -04:00
|
|
|
Replace `SERVER_HOST_NAME` with the address associated with your Horde server installation.
|
2024-03-08 14:09:44 -05:00
|
|
|
|
2024-03-12 12:56:12 -04:00
|
|
|
* `BuildConfiguration.xml` can be sourced from many locations in the filesystem, depending on 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
|
2024-03-12 12:56:12 -04:00
|
|
|
a graphical overview of how the build progresses over multiple machines.
|
2024-02-20 07:14:49 -05:00
|
|
|
|
2024-03-12 12:56:12 -04:00
|
|
|
For debugging and tuning purposes, it can be useful to force remote execution all compile workloads. 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>
|
|
|
|
|
```
|
2024-03-19 15:13:37 -04:00
|
|
|
|
2024-03-20 20:04:01 -04:00
|
|
|
> **Note:** It is not recommended to run a Horde Agent on the same machine as the Horde Server for performance reasons.
|
2024-03-19 15:13:37 -04:00
|
|
|
|
2024-03-20 20:04:01 -04:00
|
|
|
> **Note:** When using Horde's build automation functionality, be mindful of mixing pools of agents for UBA and
|
2024-03-19 15:13:37 -04:00
|
|
|
pools of agents for build automation. Agents used for build automation typically have higher requirements
|
|
|
|
|
and are a more scarce resource than compute helpers.
|
|
|
|
|
|