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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

JSON output #10

Closed
wookayin opened this issue Mar 18, 2017 · 13 comments
Closed

JSON output #10

wookayin opened this issue Mar 18, 2017 · 13 comments
Milestone

Comments

@wookayin
Copy link
Owner

No description provided.

wookayin added a commit that referenced this issue Mar 18, 2017
With the '--json' option, all the necessary information can be
exported in a JSON format.
@wookayin
Copy link
Owner Author

Partly included in v0.3.0

@Stonesjtu
Copy link
Collaborator

When the json output is stable, maybe we can detach the data collecting module and display module. Then we can request GPU usages from different remote data collecting nodes via HTTP or something else.

@wookayin
Copy link
Owner Author

wookayin commented May 5, 2017

Exactly, I am hoping to decouple them so that we can collect and display GPU usages from different machines. Working on these, so stay tuned :-)

@rubenvereecken
Copy link

Any news on this? Wouldn't mind giving a helping hand.

@Stonesjtu
Copy link
Collaborator

I'd like to recommend an NVML binding for Python to collect GPU information rather than nvidia-smi. This library would significantly simplify the code base for information gathering.

https://github.com/jonsafari/nvidia-ml-py

@wookayin
Copy link
Owner Author

@Stonesjtu Quite agree with you. It provides more information, and we could turn gpustat into a human-friendly wrapper with cleaner abstraction, providing monitoring functionalities as well. For JSON output formats, I plan to make it fully compatible with a XML format from nvidia-smi -q -x.

@Stonesjtu
Copy link
Collaborator

Stonesjtu commented Aug 13, 2017

I'm trying to move the nvidia-smi API to nvidia-ml-py

Update: you may like to review my PR #17

@gyscos
Copy link

gyscos commented Aug 28, 2017

JSON output is a great feature!

A few notes on the current implementation:

  • Fields with a dot (like utilization.gpu) make them harder to use in many JSON clients (like jq).
  • Numeric fields could use numeric values instead of strings

@Stonesjtu
Copy link
Collaborator

@gyscos I think fileds with dot can be naturally organized into sub-dict. e.g.

{
'utilization': 
  {
  'gpu': 40,
  'memory': 30,
  }
}

@wookayin wookayin added this to the 1.0 milestone Jul 23, 2019
@wookayin
Copy link
Owner Author

wookayin commented Jul 23, 2019

I plan to make a few of breaking changes towards 1.0, such as units and use of numerical values.

wookayin added a commit that referenced this issue Apr 4, 2020
The `processes' field of GPUStat as json is changed to be `null`
instead of a string (NOT_SUPPORTED) when process information is not
available.

Refs: #45, #10
wookayin added a commit that referenced this issue Apr 4, 2020
The `processes` field of GPUStat as json is changed to be `null`
instead of a string (NOT_SUPPORTED) when process information is not
available.

Refs: #45, #10
@cceyda
Copy link

cceyda commented Sep 25, 2020

would it be possible to get driver_version and cuda_version (if available) in the json output?

@wookayin
Copy link
Owner Author

wookayin commented Aug 11, 2022

@cceyda driver version has been added into the JSON output.

However, cuda version isn't something gpustat cannot retrieve from querying nvidia driver. The cuda runtime may vary by applications and dynamic libraries being loaded. Please refer to https://stackoverflow.com/questions/9727688/how-to-get-the-cuda-version for how to get the cuda version.

@wookayin
Copy link
Owner Author

wookayin commented Sep 4, 2022

There won't be breaking changes in the units (e.g. MB vs bytes) but later we will add a flag/option to specify the units or to customize the JSON schema.

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

No branches or pull requests

5 participants