Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Disable gpu support for some services #25

Closed
MrZoidberg opened this issue Nov 20, 2017 · 4 comments
Closed

Disable gpu support for some services #25

MrZoidberg opened this issue Nov 20, 2017 · 4 comments

Comments

@MrZoidberg
Copy link

How can I disable GPU support for some services in my docker-compose file while still having one service run with GPU support?

@eywalker
Copy link
Owner

eywalker commented Dec 12, 2017

Hi @MrZoidberg sorry I couldn't get back on this earlier. nvidia-docker-compose currently does not support disabling GPU support for some services, but this can be added rather straightforwardly - this has been on my todo list (#1) but haven't gotten around implementing it.

I am open for suggestion on how to best indicate to disable GPU on a service in the docker compose file.

@MrZoidberg
Copy link
Author

@eywalker cool, thanks! I think using labels to disable/enable GPU should be straightforward

@eywalker
Copy link
Owner

eywalker commented Dec 13, 2017

Thinking further about this, I'm thinking that it is probably most intuitive to simply accept a nvidia-docker-compose specific setting called enable_cuda. You can set this to false to turn off GPU support for the specific service: e.g.

version: '3'
services:
  my_non_gpu_service:
    build: .
    enable_cuda: false

To stay compatible with previous versions, enable_cuda defaults to true and thus will mount all availavle GPUs unless you limit using /dev/nvidiaX under devices.

I'll play around a bit with other implementations before committing to this solution though.

@eywalker
Copy link
Owner

eywalker commented Apr 9, 2018

@MrZoidberg enable_cuda feature is now implemented in "beta" state, but is made available in the latest version of nvidia-docker-compose. Once I have a chance to test it further and verify that it works fully, I will document this feature.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants