GPU & Model Presets
Docker + NVIDIA Container Toolkit (CUDA 12.4 + PyTorch 2.5) Preset
Containerize ComfyUI on Ubuntu 24.04 Vultr GPU nodes with --gpus all, shared /dev/shm sizing, and persistent NVMe model mounts.
--shm-size=16g · CUDA 12.4 · Persistent extra_model_paths.yaml
Fixing the Silent 64 MB /dev/shm Docker Trap
Docker defaults /dev/shm to 64 MB, causing bus errors (SIGBUS) as soon as ComfyUI offloads T5-XXL or video tensors to shared host memory. Always mount --shm-size=16g or 32g.
Decoupling Weights With extra_model_paths.yaml
Mount models read-only from /mnt/nvme/comfyui-models and point extra_model_paths.yaml there so upgrading ComfyUI takes seconds without re-downloading 30 GB checkpoints.
Measured Thresholds & ComfyUI Configuration Matrix
| Parameter / Setting | Recommended Value | Operational Reason |
|---|---|---|
| Shared Memory (--shm-size) | 16g to 32g | Default 64 MB Docker /dev/shm crashes PyTorch pinned RAM |
| CUDA & PyTorch Base | CUDA 12.4 + PyTorch 2.5+ cu124 | Required for SageAttention and Ada FP8 matmul kernels |
| Model Volume Mount | -v /mnt/nvme/models:/opt/models:ro | Persists 40+ GB Flux/Wan2.2 weights across container rebuilds |
| Allocator Env | PYTORCH_CUDA_ALLOC_CONF | Passed via docker run -e for expandable CUDA segments |