Skip to content

add log verbosity configuration to plugin components#1667

Open
armourstill wants to merge 2 commits into
NVIDIA:mainfrom
armourstill:log-verbosity
Open

add log verbosity configuration to plugin components#1667
armourstill wants to merge 2 commits into
NVIDIA:mainfrom
armourstill:log-verbosity

Conversation

@armourstill

Copy link
Copy Markdown

Sometimes we need to inspect logs from nvinfo, but its logging interface is not compatible with klog. To address this, I brought back the logger package and added a logging adapter for nvinfo. A fixed verbosity level of 1 is used to make debug logging as easy to enable as possible.

@copy-pr-bot

copy-pr-bot Bot commented Mar 19, 2026

Copy link
Copy Markdown

This pull request requires additional validation before any workflows can run on NVIDIA's runners.

Pull request vetters can view their responsibilities here.

Contributors can view more details about this message here.

gdsEnabled: null
mofedEnabled: null
deviceDiscoveryStrategy: null
logVerbosity: null

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Do you want this to be set to 0? To let the default be visible, as set here?

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

I’d prefer to keep it as null, which means the Helm chart does not set LOG_VERBOSITY, so the binary uses its built-in default of 0. Setting it to 0 would be functionally equivalent, but it would make the chart explicitly override the application default rather than inherit it.

Comment thread internal/logger/adapter.go Outdated
Comment thread cmd/nvidia-device-plugin/main.go Outdated
nvinfo.WithRoot(string(driverRoot)),
nvinfo.WithNvmlLib(nvmllib),
nvinfo.WithDeviceLib(devicelib),
nvinfo.WithLogger(&logger.NvInfoAdapter{DebugV: 1}),

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

hardcoded to 1?

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

This was intentional. DebugV: 1 only maps nvinfo's Debugf messages to klog verbosity level 1; it does not enable them by default. The default global log-verbosity is still 0, so these messages are only shown when users explicitly increase verbosity.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

Also, the verbosity setting is now encapsulated in NewNvInfoAdapter(), so the call sites no longer need to hardcode it.

Signed-off-by: Armourstill <armourstill@hotmail.com>
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