I’m referring to this doc to work with GPU container.
https://docs.docker.com/compose/gpu-support/#access-specific-devices
If I add privileged
option, nvidia-smi
gives me full 8 GPUs rather than two(0
and 3
).
The reason why I’m using privileged
is I want to use Docker in docker (dind) feature.
How can I restrict specific GPUs inside privileged
container?
services:
test:
image: tensorflow/tensorflow:latest-gpu
privileged: true # <== This point!
deploy:
resources:
reservations:
devices:
- driver: nvidia
device_ids: ['0', '3']
capabilities: [gpu]