No. Docker on macOS does not support GPU passthrough, including access to Apple's Metal API or MPS backend inside containers.
This is because Docker runs inside a lightweight Linux virtual machine (via HyperKit or Apple Virtualization Framework), and GPU access is not exposed to that VM.
No. There are currently no supported Docker settings, flags, or experimental features that allow a container to access the host's Metal/MPS capabilities.
Even with all dependencies and PyTorch correctly installed inside the container, torch.backends.mps.is_available()
will return False
.