Docker
Give Docker Desktop's containers the GPU: docker run --gpus all, with the images you already use.
Turn it on
- Install Docker Desktop for Mac, if you haven't.
- In Jacket's Apps pane, turn on GPU in containers.
- Restart Docker when Jacket asks. Docker looks for GPUs when it starts.
Use it
$ docker run --rm --gpus all nvidia/cuda:13.0.0-base-ubuntu24.04 nvidia-smi
Any container started with --gpus all gets the GPU. Docker Compose works too:
services:
train:
image: pytorch/pytorch
deploy:
resources:
reservations:
devices:
- capabilities: [gpu]
Good to know
- Containers keep using Docker Desktop as usual: your images, volumes, networks and ports.
- Images for ARM64 Linux are the best fit. x86-64 images work too.
- Containers started without
--gpusrun as before, without the GPU.