How to specify GPU, CPU & Memory limit using docker compose?
For this case i have follow instructions at (https://nvidia.github.io/nvidia-container-runtime/).
Using :
$ apt-get install nvidia-container-runtime
I'm also check it with :
$ docker run -it --rm --gpus all ubuntu nvidia-smi
Examples docker-compose.yaml :
version: '2'
...
services:
...
my-service:
...
deploy:
resources:
reservations:
generic_resources:
- discrete_resource_spec:
kind: 'gpu'
value: 1
limits:
cpus: '4'
memory: 4096M
another-service:
...
deploy:
resources:
limits:
cpus: '0.001'
memory: 50M