[Request] Add --gpus GPU passthrough support to container run/create
- Dominant language
- Swift
- Stars
- 49.9k
- Forks
- 1.8k
- Avg merge
- 1d 20h
- Merged PRs (30d)
- 22
Description
### Feature request
Please add a `--gpus` flag to `container run` and `container create` for GPU passthrough from the host into Linux containers.
### Compose compatibility
Docker Compose exposes GPU requests through `service.gpus` and `deploy.resources.reservations.devices` (for example `gpus: all` or requests with count/device IDs/capabilities). Container-Compose can parse those fields, but it must currently warn-skip them because apple/container has no equivalent runtime flag.
### Expected CLI shape
- `container run --gpus all IMAGE ...`
- `container run --gpus count=1,device=0 IMAGE ...`
- matching support on `container create`
Exact device selection semantics can follow what the virtualization stack can safely expose, but a first-class CLI/API surface would let compose translators fail explicitly or pass through supported GPU requests instead of silently degrading GPU-bound workloads to CPU.
Contributor guide
Research direction
Start with the `container run` and `container create` command entry points and trace how their options reach the container runtime. Compare the requested `all`, count, device, and capability forms with what the virtualization stack can safely expose. Done means supported GPU requests are represented by a first-class CLI/API surface and Compose translators no longer silently degrade them.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- swift
- Domain
- cli, operating-systems
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 42/100