How to specify nvidia runtime from docker-compose.yml?

I can start the tensorflow w / access container for the GPU from the w / command prompt with the following command

$ sudo docker run --runtime=nvidia --rm gcr.io/tensorflow/tensorflow:latest-gpu

I would like to be able to run this container from docker-compose. Can I specify the --runtime flag from docker-compose.yml ?

+5
source share
1 answer

You must edit /etc/docker/daemon.json by adding the first level key "default-runtime": "nvidia" , restart the docker daemon (for example, "sudo service docker restart" ), and then all containers on this host will run with nvidia runtime.

More information about daemon.json here

+4
source

Source: https://habr.com/ru/post/1273621/


All Articles