Containers and GPUs

By Edward Grundy, Bay Information Systems. Published . In Infrastructure.

Our private AI server guide notes that macOS does not allow containers access to the GPU. Most of what makes an inference service operable comes from the container: the same image on a laptop and in production, isolation between services, a scheduler, and a rollback. Each hardware platform delivers different parts of that stack.

In this article, we set out what containers give an inference service, how it accesses a GPU, each platform supports, and how the large GPU operators run their fleets.

Why containers?

Reproducibility. An image pins everything above the kernel: the Python version, PyTorch, the CUDA runtime and libraries, the serving engine and its configuration. The image digest names that whole stack, so a service that worked in testing runs the same bytes in production. Model behaviour already varies with quantisation and serving parameters; a container removes the software stack from the list of issues.

Isolation. Two services on one machine can need different CUDA runtimes, different PyTorch, vLLM or other dependency builds. Separate containers allow these to coexist. Outside containers each is a risk to the host system configuration and each other.

Scheduling. Kubernetes treats a GPU as a countable resource, as nvidia.com/gpu or amd.com/gpu. A deployment asks for one GPU and the scheduler places it on a node with one free; when a node fails, the pod moves.

Rollback. Redeploying a previous container image restores the previous service exactly. The same property makes air-gapped deployment tractable: images are mirrored and run without a network.

GPU access from a container

A linux container shares the host’s kernel, so the GPU’s kernel driver cannot travel in the image. The host owns the driver; the image carries everything above it. At start-up, something has to bridge the two, giving the container the device nodes and the user-space half of the driver that matches the host’s kernel module.

On NVIDIA, that bridge is the NVIDIA Container Toolkit. In its original form, a hook runs after the container is created and before it starts, mounting the GPU devices and the host’s driver libraries, including libcuda, into the container. Newer releases describe the same injection through the Container Device Interface (CDI), an open specification that Docker, Podman and containerd read directly.

The image’s CUDA runtime needs a host driver at least as new as its release family requires (CUDA 13 needs the 580 driver series or later). NVIDIA ships a forward compatibility package that lets newer runtimes run on older drivers, but only on data centre GPUs, select RTX server SKUs and Jetson boards. On a GeForce card, the host driver must keep up with the newest image in use.

(The bridge runs with host privileges, which makes it a target. In July 2025 Wiz disclosed CVE-2025-23266, a container escape through one of the toolkit’s initialisation hooks, rated 9.0 out of 10; it followed CVE-2024-0132 in the same toolkit. The driver layer’s wider role is covered in our CUDA article.)

CUDA container images are large. vLLM’s official image is about 8 to 11GB compressed for x86-64, depending on the CUDA build, and slightly larger for Arm64. A node pulls that before serving, which affects autoscaling and any registry with a bandwidth bill.

Platform by platform

NVIDIA on x86-64 Linux has every piece: the toolkit, CDI, a Kubernetes device plugin and the GPU Operator, which installs the driver, toolkit and plugin on each node. The same image runs on a workstation under a desk and on a cloud instance.

NVIDIA on Arm64 (DGX Spark, Jetson Thor, and the Grace CPUs in GH200 and GB200 systems) runs the same toolkit, with images built for linux/arm64. Grace has made Arm64 CUDA a data centre platform, and vLLM now ships both architectures for each release. Jetson Thor still uses the older --runtime=nvidia in place of --gpus all; which breaks tooling that assumes the standard flag.

AMD with ROCm works on x86-64 hosts only. A container sees the GPU through /dev/kfd and /dev/dri, with its user in the video and render groups, and AMD’s device plugin and GPU Operator expose amd.com/gpu to Kubernetes. The model is the same as NVIDIA’s; the catalogue of ready-made images is thinner and the supported GPU list narrower (see the GPU options guide).

Apple Silicon is a major exception. Every container runtime on macOS runs Linux in a virtual machine, and Linux has no Metal driver, so the container cannot reach the GPU. Apple’s own Containerization framework, announced in June 2025, runs each container in its own lightweight VM, which improves isolation but leaves the GPU outside. Workarounds run the model server as a native macOS process beside the containers (Docker Model Runner does this for vllm-metal), or pass a Vulkan or remoted Metal device into a Podman VM for llama.cpp alone, as set out in the unified memory article.

Platform GPU inside a container Kubernetes resource Images
NVIDIA, x86-64 Linux Yes, toolkit or CDI nvidia.com/gpu x86-64, the widest catalogue
NVIDIA, Arm64 Linux Yes, toolkit or CDI nvidia.com/gpu Arm64 builds required
AMD ROCm, x86-64 Linux Yes, device passthrough amd.com/gpu x86-64, a thinner catalogue
Apple Silicon, macOS Not in Linux containers; macOS VMs get a paravirtualised GPU None for the GPU; Orka schedules macOS VMs macOS VM images, tens of GB

GPU fleets on neo-clouds

The GPU operators that describe their infrastructure in public have converged on one pattern. OpenAI described scaling a single Kubernetes cluster to 7,500 nodes in 2021, with many jobs taking a whole node per pod. CoreWeave runs Kubernetes directly on bare-metal GPU servers and offers Slurm, the batch scheduler of supercomputing, on top of it through SUNK, where each Slurm node runs from an OCI container image built for a given CUDA version. At the other end of the market, every Vast.ai rental is a Linux Docker container on a host’s machine, and the hosts range from a single gaming PC to tier-four data centres. Scale, price and tenancy differ. The unit of deployment is a Linux container image in all cases.

The Mac rack

Mac fleets exist, and they are run with real tooling. AWS, GitHub (whose macOS runners sit in Azure data centres), Scaleway and MacStadium all operate racks of Mac minis and Mac Studios. They run macOS virtual machines in place of containers: Tart, from Cirrus Labs, pushes and pulls macOS VMs through any OCI registry, MacStadium’s Orka orchestrates macOS VMs with Kubernetes. A macOS guest also gets a paravirtualised GPU with Metal, within about 10% of the host in one published Metal benchmark, which a Linux guest does not.

So most of the first section can be rebuilt, one level up, with three limits.

Two VMs per Mac. The macOS licence permits two additional copies of macOS in virtual machines on each Mac, and Apple’s Virtualization framework enforces the cap. A Mac Studio with 512GB of unified memory is limited to two isolated services.

A second set of images. A macOS VM image runs to tens of gigabytes (Tart’s base images are about 25GB) and is distinct from the service-equivalent Linux image.

A market built for CI. Providers sell these machines for building and testing Apple software. AWS offers Mac instances only as bare-metal dedicated hosts, one Mac per host, with a 24-hour minimum allocation to comply with the macOS licence, and Scaleway applies the same minimum. The M4 instances on AWS are Mac minis with 24GB of memory. Model serving through MLX and the paravirtualised GPU is possible in principle; it is not a configuration any provider documents or sells.

Apple’s Private Cloud Compute, which serves Apple Intelligence, runs on custom-built Apple Silicon servers with a new operating system, a hardened subset of iOS and macOS built for language model inference. Apple left out components usually considered essential to data centre administration, such as remote shells and observability tools, so that its own administrators cannot reach user data. None of it is for sale.

Choosing hardware with the operating model in view

The hardware question usually arrives as a memory question: which models fit, at what speed, for how much. The operating question arrives later, and the answer was fixed when the hardware was bought. On Linux with NVIDIA or AMD, the remaining choices are about image builds (x86-64 or Arm64) and the depth of the image catalogue, and every property in the first section survives. On a Mac, the model runs well and the operating model is rebuilt from tools designed for app builds, two services to a machine, with a second set of images to maintain.

A Mac Studio suits one developer’s desk, an evaluation bench or a single-user tool. A service that several applications depend on, has to survive a failed node and will need upgrades uses Linux containers. (For sizing the hardware itself, see the private AI server guide; for a deployment reviewed against your own constraints, get in touch.)


(Checklist: Do You Need Private Inference?. Eight questions on regulation, exposure, training risk, jurisdiction and usage, with a recommendation on how to deploy AI on sensitive data.)

Questions about this? Get in touch.