View a markdown version of this page

Enable swap on Deadline Cloud Linux workers - Deadline Cloud

Enable swap on Deadline Cloud Linux workers

The swap_for_smf host configuration script creates and enables a swap file on Deadline Cloud Linux service-managed fleet workers. Use this script for memory-intensive workloads that temporarily exceed physical RAM, such as ComfyUI.

Some workloads need to memory-map large files through CPU RAM before loading them onto the GPU. For example, loading a 16 GB diffusion model on a g6.xlarge instance (16 GB RAM) can OOM-kill the process without swap. A swap file provides overflow capacity so that these loads succeed.

The script does the following:

  1. Creates a 32 GB swap file at /swapfile (skips if one already exists).

  2. Enables the swap file immediately.

  3. Adds an /etc/fstab entry so that swap persists across reboots.

To change the swap size, edit linux.sh and update the SWAP_SIZE variable.

For an alternative that changes the kernel's overcommit behavior instead of adding swap, see the overcommit_override_for_smf script in the samples repository.