-
Notifications
You must be signed in to change notification settings - Fork 5.2k
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
Enable GPU access with DeviceRequests #7929
Conversation
Wonderful and significant features, expect to be compiled! |
abc93d0
to
a48171e
Compare
a48171e
to
d554c57
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
One minor change but LGTM
compose/service.py
Outdated
@@ -179,6 +180,7 @@ def __init__( | |||
ipc_mode=None, | |||
pid_mode=None, | |||
default_platform=None, | |||
device_requests=None, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Careful of changing function parameter ordering. It's possible that users are calling this function with positional parameters so it's best to add new parameters to the end of the list (i.e.: after extra_labels
).
Signed-off-by: aiordache <[email protected]>
d554c57
to
a3e7d51
Compare
Summary: Updating gpu access from docker-compose, pointed by this comment: https://github.com/facebookresearch/detectron2/blob/45a8bfb64053d71d9d7f136fb25a6abe841dc91f/docker/docker-compose.yml#L9 The solution comes from this [pull request](docker/compose#6691), and working since 1.28.0 [release](https://github.com/docker/compose/releases). It's the [official](docker/compose#7929) replace of `runtime: nvidia` In this way, we don't need to install nvidia-docker (less prerequisites 🎉), but nvidia-container-toolkit seems to be needed yet. Pull Request resolved: #2584 Reviewed By: theschnitz Differential Revision: D26318490 Pulled By: ppwwyyxx fbshipit-source-id: f732a8d05dbd42cd72d228719507ac45caa86ea4
Convert compose-spec
devices
mapping toDeviceRequest
to enable GPU access to containers.Tested on a GPU host:
Sample compose files:
or
Tested on a multi-GPU host:
Enable access only to GPU-0 and GPU-3 devices
Requires compose-spec/compose-spec#109
Closes #6691