Enable swap on Deadline Cloud Linux workers
The
swap_for_smf
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:
-
Creates a 32 GB swap file at
/swapfile(skips if one already exists). -
Enables the swap file immediately.
-
Adds an
/etc/fstabentry 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