Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

ERROR: The Compose file './docker-compose.yaml' is invalid because: Unsupported config option for services.nvidia-smi-test: 'runtime'

this is my docker-compose.yaml:

version: '2.3'

services:
 nvidia-smi-test:
  runtime: nvidia
  image: nvidia/cuda:9.0-base
  environment:
      - NVIDIA_VISIBLE_DEVICES=all

when I run docker-compose up it will appear:

ERROR: The Compose file './docker-compose.yaml' is invalid because:
Unsupported config option for services.nvidia-smi-test: 'runtime'

but if I don't use docker-compose just use command docker run --runtime=nvidia nvidia/cuda:9.0-base nvidia-smi there is no error , I don't know exactly what went wrong。Below is version of docker and docker-compose:

Docker version 19.03.5, build 633a0ea838
docker-compose version 1.17.0, build ac53b73

I would be very grateful if everyone could make some comments!

like image 444
shaoyi Avatar asked Dec 07 '19 03:12

shaoyi


1 Answers

I found the problem, this is because the docker-compose version is not right, Docker Compose must be version 1.19.0 or higher.

I just uninstall the docker-compose (version 1.17.0) and install docker-compose(version 1.21.2) everything goes well!

like image 85
shaoyi Avatar answered Sep 20 '22 10:09

shaoyi