pub fn gpu_pool_for_policy(
policy: EncodePolicy,
codec: VideoCodec,
) -> Arc<GpuPool>Expand description
Build a GpuPool constrained to the given EncodePolicy. An empty pool
(e.g. a pinned index or vendor family that isn’t present) yields capacity 0,
so the orchestrator’s pre-flight probe / lease claim surfaces a clear error.
When more than one GPU is selected, cards that can’t actually encode the
REQUESTED codec (e.g. a pre-Ada NVIDIA that decodes via NVDEC but has no
AV1 encode silicon — yet can still encode H.264/H.265) are dropped from the
encode pool, so a worker never leases an incapable card and hard-fails
the run; the capable cards do the encoding. A single selected GPU is left
as-is, since the serial path’s non-pinned encoder dispatch already falls
through vendors. Dropped cards stay available for the decode pump
(policy_gpu_indices is intentionally NOT filtered).