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

[nvidia] Capture more nvidia commands #3777

Merged
merged 1 commit into from
Oct 8, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 10 additions & 4 deletions sos/report/plugins/nvidia.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,13 @@ class Nvidia(Plugin, IndependentPlugin):

short_desc = 'Nvidia GPU information'
plugin_name = 'nvidia'
commands = ('nvidia-smi',)
commands = ('nvidia-smi', 'nvidia-ctk',)
services = ('nvidia-persistenced', 'nvidia-fabricmanager',
'nvidia-toolkit-firstboot')

def setup(self):
self.add_copy_spec("/etc/cdi/nvidia.yaml")

subcmds = [
'--list-gpus',
'-q -d PERFORMANCE',
Expand All @@ -29,9 +33,12 @@ def setup(self):
'nvlink -s',
'nvlink -e'
]

self.add_service_status("nvidia-persistenced")
ctk_subcmds = [
'cdi list',
'--version',
]
self.add_cmd_output([f"nvidia-smi {cmd}" for cmd in subcmds])
self.add_cmd_output([f"nvidia-ctk {cmd}" for cmd in ctk_subcmds])

query = ('gpu_name,gpu_bus_id,vbios_version,temperature.gpu,'
'utilization.gpu,memory.total,memory.free,memory.used,'
Expand All @@ -42,6 +49,5 @@ def setup(self):
self.add_cmd_output(
f"nvidia-smi --query-retired-pages={querypages} --format=csv"
)
self.add_journal(boot=0, identifier='nvidia-persistenced')

Copy link
Member

Choose a reason for hiding this comment

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

nit, do we need the extra line here? not overly precious about it though

Copy link
Member Author

Choose a reason for hiding this comment

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

Good point, I think we can remove it.
My only doubt then is what to do with this add_journal() call before it. The service is now in the services tuple, but the boot=0 is what makes me doubt if it's safe or not to remove it. Any thoughts on this?

# vim: set et ts=4 sw=4 :
Loading