GPUs
Miabi can attach NVIDIA GPUs to your application containers for inference servers, training jobs, transcoding, and other CUDA workloads — without giving every workspace unrestricted access to every card on the host. Access is controlled at three levels that mirror the CPU/memory story: a platform admin decides which devices each node exposes, each plan decides whether its workspaces may request a GPU and how many, and each app declares the GPUs it needs. The deploy attaches exactly those devices to the container.
Version 1 does whole-device NVIDIA passthrough with count-based accounting — the common case that unblocks real workloads. Fractional GPUs (MIG / time-slicing / MPS), VRAM quotas, AMD ROCm, and fleet-wide GPU-aware scheduling are not yet supported. See Limitations.

Prerequisites
A node can host GPU workloads when it has:
- NVIDIA drivers installed on the host.
- The NVIDIA Container Toolkit installed and registered with Docker (this adds the
nvidiacontainer runtime). - Miabi started with
MIABI_GPU_ENABLED=true(see Configuration).
Miabi detects the toolkit automatically from the node's Docker runtimes — no node-agent change is needed. A node without the toolkit is shown as such, and GPU deploys to it are refused up front rather than failing cryptically at container start.
How it works
Admin enables devices → Plan allows GPUs + sets a quota → App requests N GPUs → Deploy attaches them
(per node) (per workspace) (per app)
Nothing is stored in the database about which physical card an app got. Devices are resolved
fresh at each deploy from the node's currently-enabled GPUs, so replacing a card or moving the app to
another node just works. Each GPU container carries an io.miabi.gpus label listing the cards it
holds, and the scheduler reads those labels from the node's running containers when it picks cards
for the next deploy.
1. Enable GPUs on a node (admin)
Open Admin → Nodes → <node> → GPUs. Miabi inventories the node's physical cards by running a short probe over the Docker API and lists each one with its model, UUID, memory, and index.
- Rescan GPUs re-runs the inventory on demand (it also runs periodically). New cards are discovered automatically.
- A newly discovered device arrives disabled — discovering a card never exposes it to tenants. Toggle Enabled to offer it to workloads.
- Set each device's mode:
- Shared — many apps may request the device concurrently (good for inference and dev).
- Dedicated — reserved for one app at a time (good for training). While another app's container holds the card, no other app is given it. The holding app's own canary and redeploys may still use it.
If the node lacks the NVIDIA Container Toolkit, the page says so and lists no devices until you install it and rescan.
When a successful scan no longer reports a card (it failed, or was removed), the card is marked missing and is no longer given to deploys. It keeps its Enabled and mode settings, so it is offered again as soon as a later scan sees it. A failed probe never marks cards missing.
2. Allow GPUs on a plan (admin)
GPU access is off by default. In Admin → Plans & Quotas → <plan>:
- Allow GPU access — the capability gate. A workspace cannot request any GPU until its plan allows it.
- GPUs limit — the maximum number of GPU units the workspace's running apps may hold at
once, summed across apps (the same aggregate model as the CPU/memory limits).
0= none,-1= unlimited. A stopped app frees its units.
You can also override both per workspace under Admin → Workspaces → <workspace>.
3. Request GPUs for an app
In an app's Settings → Resources, set:
- GPUs — the number of whole devices to attach (
0= none). - GPU kind — optionally narrow the request to a vendor or model (e.g.
nvidia, or a model substring likeA100). Leave empty to use any enabled GPU on the app's node. - GPU driver capabilities — the NVIDIA driver features the container gets:
compute,utility,video,graphics,display,compat32. Leave all unchecked for the toolkit default (compute,utility). Check video for NVENC/NVDEC hardware transcoding (Jellyfin, Plex, ffmpeg), and graphics for OpenGL/Vulkan rendering.
The GPU controls are shown only when the workspace's plan allows GPUs — there is no dangling
field that always errors. The request also rides the declarative manifest
under resources.gpu / resources.gpuKind, so a GPU app is reproducible from a manifest.
resources:
cpu: "4"
memory: 16Gi
gpu: 1
gpuKind: nvidia
gpuCapabilities: [compute, utility, video]
Jobs and CronJobs run with the app's GPU request, like its CPU and memory limits. A job counts as the same app, so on a dedicated card it shares the card the app holds.
Importing a Docker Compose file keeps GPU reservations
(deploy.resources.reservations.devices with driver: nvidia, or gpus:). See
Stacks.
At deploy, Miabi resolves the request to concrete enabled devices on the app's node and attaches
them. Inside the container nvidia-smi lists exactly the granted device(s).
Miabi spreads apps across cards: it picks the cards held by the fewest other apps, so on a node with four GPUs, four 1-GPU apps each get their own card. Among equally loaded cards it prefers the ones the app already holds, so a canary or redeploy stays on the same card.
Choosing a node. In a multi-node Swarm location, a new GPU app is placed only on nodes that have
at least that many enabled cards of the requested kind, picking the least loaded among them. If no
node qualifies, creating the app fails with 409. This checks capacity only. Whether a dedicated card
is free is decided at deploy. The node is chosen when the app is created; raising the GPU count later
does not move the app.
Starting a stopped GPU app redeploys its current release instead of restarting the old container, so its cards are picked again and a dedicated card handed to another app in the meantime is not reused.
Constraints & enforcement
GPU access means raw device passthrough, which is privileged, so it is gated hard and refused where it would be unsafe:
- Plan capability, twice. A workspace whose plan lacks Allow GPU access cannot even save an app
that requests a GPU (the API returns
403), and the request is re-checked at deploy. - Quota at deploy. GPU units are counted against the plan's GPUs limit across the workspace's running apps. Deploying an app that would exceed the limit is rejected with the quota reason; stopping another GPU app frees units.
- Not with the restricted security profile. A workload with raw device access is not
"restricted", so a workspace under the restricted profile
cannot save an app that requests a GPU (
403), and a GPU app whose workspace became restricted later is refused at deploy rather than silently downgraded. - Single container only (v1). A GPU app must run as a single container, not a replicated (cluster/Swarm) service. Set the app's runtime to container.
- Node must be GPU-capable. If too few enabled, present devices match the requested kind, or the node lacks the toolkit, the deploy fails with a message naming the node and the requested kind, and how many matching dedicated cards are held by other apps.
With MIABI_PLAN_ENFORCEMENT=false (single-tenant/homelab), the capability and quota checks are
no-ops, but device attachment still works — so a homelab can use GPUs freely.
Configuration
| Variable | Default | Description |
|---|---|---|
MIABI_GPU_ENABLED | false | Master switch. When off, the control plane never probes nodes for GPUs and the UI hides all GPU controls (a no-GPU fleet pays nothing) |
MIABI_NVIDIA_RUNTIME | nvidia | The container runtime name that signals the NVIDIA Container Toolkit is installed |
MIABI_GPU_PROBE_IMAGE | nvidia/cuda:12.4.1-base-ubuntu22.04 | The one-shot image the inventory probe runs nvidia-smi in. Point at a mirror for air-gapped/registry-pinned fleets |
MIABI_GPU_INVENTORY_MINUTES | 30 | How often nodes are re-inventoried for GPUs |
Metrics
When MIABI_METRICS_ENABLED=true, the Prometheus /metrics endpoint exposes:
miabi_gpu_devices_total— physical GPU devices discovered across all nodes.miabi_gpu_devices_enabled— devices enabled and present (offered to workloads).miabi_gpu_allocated— GPU units currently held by running apps.
Limitations
Version 1 is deliberately scoped to the common case:
- Whole devices only — no fractional GPUs (MIG, time-slicing, MPS).
- No VRAM quota — the limit counts whole devices, not GPU memory.
- NVIDIA only — AMD ROCm is not supported.
- Node chosen at create — GPU-aware node selection happens when the app is created. Changing the GPU request later does not move the app, and clustered (Swarm service) GPU apps are not supported yet.
- Containers started outside Miabi are not counted. A container given a GPU with
docker run --gpus, or a GPU app deployed before Miabi recorded theio.miabi.gpuslabel, does not hold its card for scheduling until it is redeployed.
Related
- Scaling & Resources — CPU and memory limits and replicas.
- Plans & Quotas — capability gates and per-workspace quotas.
- Nodes Overview — how nodes and placement work.