my docker compose file is as follows:
version: "3"
services:
app:
build:
context: .
dockerfile: Dockerfile
ports:
- "5000:5000"
deploy:
resources:
reservations:
devices:
- driver: nvidia
count: 1
capabilities: [gpu]
I am trying to allow my container to have GPU access. The same thing can happen with docker run --gpus all but I want it with docker compose. The yml above produces this error:
ERROR: The Compose file './docker-compose.yml' is invalid because:
services.app.deploy.resources.reservations value Additional properties are not allowed ('devices' was unexpected)
I don't understand how can this be a problem since what I used is what the official docs have (link).
Any ideas?