Hello,
thank you. I have been doing a lot of testing lately I realize this has nothing to see with MIG device. I try with a server with two GPUs and still got issues to schedule properly the containers on proper GPU (one per service).
here is what I did so far :
the new daemon.json look like :
{
"default-runtime": "nvidia",
"default-shm-size": "1G",
"default-ulimits": {
"memlock": {
"hard": -1,
"name": "memlock",
"soft": -1
},
"stack": {
"hard": 67108864,
"name": "stack",
"soft": 67108864
}
},
"node-generic-resources": [
"NVIDIA-GPU=GPU-f2ba9cd4-6f6b-860f-3c78-4a6639e4b5db",
"NVIDIA-GPU=GPU-f12d79c4-d485-2fd1-ca2d-cd5eef76fe40"
],
"runtimes": {
"nvidia": {
"args": [],
"path": "nvidia-container-runtime"
}
}
}
- starting a service with swarm :
worker-service:
image: image:tag
deploy:
replicas: 2
resources:
reservations:
generic_resources:
- discrete_resource_spec:
kind: 'NVIDIA-GPU'
value: 1
command: >
bash -c "
python3 -m launch_bare_metal
"
After deploying it I can see swarm schedule two containers as requested, but both service are started on GPU id 0 which fails because of memory constraints :
Wed Jan 21 15:45:11 2026
+-----------------------------------------------------------------------------------------+
| NVIDIA-SMI 570.195.03 Driver Version: 570.195.03 CUDA Version: 12.8 |
|-----------------------------------------+------------------------+----------------------+
| GPU Name Persistence-M | Bus-Id Disp.A | Volatile Uncorr. ECC |
| Fan Temp Perf Pwr:Usage/Cap | Memory-Usage | GPU-Util Compute M. |
| | | MIG M. |
|=========================================+========================+======================|
| 0 NVIDIA H100 80GB HBM3 Off | 00000000:01:00.0 Off | 0 |
| N/A 30C P0 116W / 700W | 52037MiB / 81559MiB | 0% Default |
| | | Disabled |
+-----------------------------------------+------------------------+----------------------+
| 1 NVIDIA H100 80GB HBM3 Off | 00000000:02:00.0 Off | 0 |
| N/A 33C P0 71W / 700W | 4MiB / 81559MiB | 0% Default |
| | | Disabled |
+-----------------------------------------+------------------------+----------------------+
+-----------------------------------------------------------------------------------------+
| Processes: |
| GPU GI CI PID Type Process name GPU Memory |
| ID ID Usage |
|=========================================================================================|
| 0 N/A N/A 24783 C python3 26010MiB |
| 0 N/A N/A 25442 C python3 26012MiB |
+-----------------------------------------------------------------------------------------+
Looking at what swarm did I inspect both containers. Container 1 is started with the following env var :
"DOCKER_RESOURCE_NVIDIA-GPU=GPU-f2ba9cd4-6f6b-860f-3c78-4a6639e4b5db",
container2 has the following env var :
"DOCKER_RESOURCE_NVIDIA-GPU=GPU-f12d79c4-d485-2fd1-ca2d-cd5eef76fe40",
So this looks good to me on that side, but I don’t get why both containers are started on same GPU after all.
If soemone came accross this would be helpfull 
Thanks for reading