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

Convert nvidiamon enc/dec metrics from int to string #167

Merged
merged 1 commit into from
Sep 4, 2020

Conversation

amete
Copy link
Collaborator

@amete amete commented Sep 4, 2020

This probably depends on a combination of the hardware/software/firmware but it looks like an output from nvidia-smi pmon [...] of the form:

# gpu        pid  type    sm   mem   enc   dec   command
# Idx          #   C/G     %     %     %     %   name
    0      14294     C    34     0     -     -   177   burner

is just as valid as:

# gpu        pid  type    sm   mem   enc   dec   command
# Idx          #   C/G     %     %     %     %   name
    0      14294     C    34     0     0     0   177   burner

Presumably not all metrics, especially enc and dec, are always available.

The main problem this creates is that the current implementation of the output parsing doesn't handle the first case well, resulting in all zero values for the gpu related metrics. In any case, we currently don't really track enc and dec explicitly. Therefore, I converted their types from unsigned int to std::string so that the parsing succeeds.

This should fix the problem that we've encountered in ADC (gpu related metrics being all zeros).

-s

@amete amete added the bug Something isn't working label Sep 4, 2020
@graeme-a-stewart
Copy link
Member

Great - so glad you caught this! It's always a worry when parsing text output that needs to conform to a very specific format.

@graeme-a-stewart graeme-a-stewart merged commit 049db24 into master Sep 4, 2020
@graeme-a-stewart graeme-a-stewart deleted the nvidiamon-bugfix branch September 4, 2020 13:02
@amete
Copy link
Collaborator Author

amete commented Sep 4, 2020

Thanks a lot @graeme-a-stewart.

@amete amete mentioned this pull request Sep 7, 2020
@graeme-a-stewart graeme-a-stewart added this to the v2.1 milestone Sep 8, 2020
@amete amete restored the nvidiamon-bugfix branch January 27, 2022 15:51
@amete amete deleted the nvidiamon-bugfix branch January 27, 2022 15:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants