Docker

Give Docker Desktop's containers the GPU: docker run --gpus all, with the images you already use.

Turn it on

  1. Install Docker Desktop for Mac, if you haven't.
  2. In Jacket's Apps pane, turn on GPU in containers.
  3. 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