-
Notifications
You must be signed in to change notification settings - Fork 25.2k
Return device count using nvml #84879
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
Conversation
Fixes #83973 [ghstack-poisoned]
🔗 Helpful Links🧪 See artifacts and rendered test results at hud.pytorch.org/pr/84879
Note: Links to docs will display an error until the docs builds have been completed. ✅ No FailuresAs of commit a5ebf40: This comment was automatically generated by Dr. CI and updates every 15 minutes. |
Fixes #83973 [ghstack-poisoned]
Fixes #83973 [ghstack-poisoned]
return int(s[:idx]) if idx > 0 else -1 | ||
|
||
# CUDA_VISIBLE_DEVICES uses something like strtoul | ||
# which makes `1gpu2,2ampere` is equivalent to `1,2` |
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.
til
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.
This doesn't handle things like 0-2?
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.
Nope, at using 510 driver, ranges do not seem to be supported (prior to this change):
$ CUDA_VISIBLE_DEVICES=0-2 python -c "import torch;print(torch.cuda.device_count())"
1
$ CUDA_VISIBLE_DEVICES=0,1,2 python -c "import torch;print(torch.cuda.device_count())"
3
Fixes #83973 [ghstack-poisoned]
@pytorchbot merge -g |
@pytorchbot successfully started a merge job. Check the current status here. |
Fixes #83973 Pull Request resolved: #84879 Approved by: https://github.com/ngimel
Stack from ghstack (oldest at bottom):
torch.cuda.device_count
#84878_is_compiled()
function #84877Fixes #83973