I thing that Docker for MacOS work over a virtual machine:
With Docker for Mac, you have a new, native virtualization system running (HyperKit) which takes the place of the VirtualBox system https://docs.docker.com/docker-for-mac/install/#what-to-know-before-you-install
then you need some method for _PCI_ _passthrough_ the GPU card from host OS to VM OS client. However, the only way to make this is use _Nvidia VirtualGPU_ vGPU
https://www.nvidia.com/en-us/design-visualization/technologies/virtual-gpu/ and that your GPU support this technology; an CPU Intel that have virtualization capabilities.
Nvidia-Docker work for passthrough on linux containers
Nvidia-vGPU work for passthrough on Virtual Machines over linux host
For now the HyperKit work over a personalized hypervisor based on xhyve and in its roadmap NO show future work in this.
Maybe Another approach:
However, the only way to make this is use Nvidia VirtualGPU vGPU
Not quite, you can do a regular PCIe passthrough with Tesla GPUs.
But xhyve/HyperKit doesn't support PCIe passthrough.
I think it's just easier if you use the docker CLI on Mac, but connect to a remote docker daemon running on a Linux machine with a GPU.
Most helpful comment
Not quite, you can do a regular PCIe passthrough with Tesla GPUs.
But xhyve/HyperKit doesn't support PCIe passthrough.
I think it's just easier if you use the docker CLI on Mac, but connect to a remote docker daemon running on a Linux machine with a GPU.