add support for collecting GPU info (via nvidia-smi), and include it in --show-system-info and test report#3851
Merged
boegel merged 7 commits intoeasybuilders:developfrom Sep 29, 2021
Merged
Conversation
This comment has been minimized.
This comment has been minimized.
boegel
requested changes
Sep 28, 2021
| gpu_info['NVIDIA'][line] += 1 | ||
| else: | ||
| gpu_info['NVIDIA'] = {} | ||
| gpu_info['NVIDIA'][line] = 1 |
Member
There was a problem hiding this comment.
setdefault is your friend here, no need for the if/else:
for line in out.strip().split('\n'):
nvidia_gpu_info = gpu_info.setdefault('NVIDIA', {})
nvidia_gpu_info.setdefault(line, 0)
nvidia_gpu_info[line] += 1| gpu_info['NVIDIA'] = {} | ||
| gpu_info['NVIDIA'][line] = 1 | ||
| except Exception: | ||
| _log.debug("No NVIDIA GPUs detected") |
Member
There was a problem hiding this comment.
Log which exception was hit?
except Exception as err:
_log.debug("Exception was raised when running nvidia-smi: %s", err)
_log.info("No NVIDIA GPUs detected")| except Exception: | ||
| _log.debug("No NVIDIA GPUs detected") | ||
| else: | ||
| _log.debug("Only know how to get GPU info on Linux") |
Member
There was a problem hiding this comment.
_log.info("Only know how to get GPU info on Linux, assuming no GPUs are present")
Member
Author
|
Example PR test message at easybuilders/easybuild-easyconfigs#14069 (comment) |
Co-authored-by: SebastianAchilles <[email protected]>
boegel
requested changes
Sep 29, 2021
Member
boegel
left a comment
There was a problem hiding this comment.
Some minor additional suggested changes in branfosj#4
With that included, this is good to imho.
Unless we want to go through the effort of extending the framework tests with a fake nvidia-smi command that produces output to be processed by get_gpu_info?
tweak GPU part of output produced by --show-system-info
boegel
approved these changes
Sep 29, 2021
Member
|
Thanks a lot @branfosj! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
closes #3825
Add GPU info to
eb --show-system-infoOnly supports NVIDIA GPUs on linux as that is all I have.