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

Add option to show power stats #28

Merged
merged 1 commit into from
Sep 21, 2017
Merged

Conversation

cjw85
Copy link
Contributor

@cjw85 cjw85 commented Sep 19, 2017

Adds ability to show optionally power usage and limit (grouped with temperature and utilisation).

Copy link
Owner

@wookayin wookayin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Generally it looks good. Thank you for your PR!
Please see blow (and squash welcomed).

gpustat.py Outdated
Returns the GPU power usage in Watts,
or None if the information is not available.
"""
v = self.entry['power.use']
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actually I think it should be "power.draw". A convention here is that I am using the same column name as shown in nvidia-smi --help-query-gpu.

@wookayin wookayin changed the title Resolves #19 Add option power stats Add option to show power stats Sep 19, 2017
@cjw85
Copy link
Contributor Author

cjw85 commented Sep 20, 2017

Changed: power.use -> power.draw, and power.limit -> enforced.power.limit as given by nvidia-smi --query. Changed API properties to be consistent (whilst not being verbose for the second case).

@wookayin
Copy link
Owner

Between power.limit and enforced.power.limit, what is the quantity you are seeking to print out? I thought it was power.limit, but you do enforced.power.limit, right?

@cjw85
Copy link
Contributor Author

cjw85 commented Sep 20, 2017

I'm calling N.nvmlDeviceGetEnforcedPowerLimit so enforced.power.limit is the correct form. This is described as "the minimum of various power limiters.", so seems to be the most relevant to display in the simple interface (and provide in the simple API).

@wookayin wookayin merged commit 79dd3db into wookayin:master Sep 21, 2017
@wookayin
Copy link
Owner

Merged, thanks!

wookayin added a commit that referenced this pull request Sep 25, 2017
Sometimes one might need to output power draw (usage) only,
not power limit. To support this kind of configuration, we
introduce an optional argument to '-P' or '--show-power' flag.

The option can be:

* -P (default) : prints everything.
* -Pdraw : prints only power draw (usage).
* -Plimit / -Pdraw,limit / -Plimit,draw : prints both
  (draw and limit).

Also, default color of power has been changed appropriately.

Follow-up of PR #28.
@wookayin wookayin added this to the 0.4 milestone Nov 2, 2017
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

Successfully merging this pull request may close these issues.

2 participants