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

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
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
11 changes: 10 additions & 1 deletion sos/report/plugins/nvidia.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ class Nvidia(Plugin, IndependentPlugin):

short_desc = 'Nvidia GPU information'
plugin_name = 'nvidia'
commands = ('nvidia-smi',)
commands = ('nvidia-smi', 'nvidia-ctk',)

def setup(self):
subcmds = [
Expand All @@ -30,8 +30,17 @@ def setup(self):
'nvlink -e'
]

ctk_subcmds = [
'cdi list',
'--version',
]

self.add_copy_spec("/etc/cdi/nvidia.yaml")
self.add_service_status("nvidia-persistenced")
self.add_service_status("nvidia-fabricmanager")
self.add_service_status("nvidia-toolkit-firstboot")
Copy link
Member

Choose a reason for hiding this comment

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

curious, would it good to add journal for all these too. i.e. if one only wants to enable the nvidia plugin and nothing else?

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 idea. I'll addthe journals as well

Copy link
Member

Choose a reason for hiding this comment

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

If these are added to the services tuple, it can be used for plugin enablement as well as automatically getting the journal and service status.

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 idea. Shall I add the three services to the plugin enablement? We have its journal capture a bit different:

self.add_journal(boot=0, identifier='nvidia-persistenced')

But a quick test I did in a RHEL AI image showed that the nvidia-persistenced service is captured correctly. My only doubt is the 'boot=0' option.

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 Down
Loading