Skip to content

Add ability to disable CDI hooks in jit-cdi mode#1859

Merged
cdesiniotis merged 1 commit into
NVIDIA:mainfrom
cdesiniotis:jit-cdi-disabled-hooks
May 28, 2026
Merged

Add ability to disable CDI hooks in jit-cdi mode#1859
cdesiniotis merged 1 commit into
NVIDIA:mainfrom
cdesiniotis:jit-cdi-disabled-hooks

Conversation

@cdesiniotis
Copy link
Copy Markdown
Contributor

@cdesiniotis cdesiniotis commented May 28, 2026

The nvcdi package has a disabledHooks option for disabling CDI hooks. The nvidia-ctk cdi generate CLI exposes this option via a --disable-hooks flag.

This PR adds the ability to disable CDI hooks in the CDI spec that gets generated by nvidia-container-runtime when it runs in jit-cdi mode.

Testing

$ grep -A1 "nvidia-container-runtime.modes.jit-cdi" /etc/nvidia-container-runtime/config.toml
[nvidia-container-runtime.modes.jit-cdi]
nvcdi-disable-hooks = ["disable-device-node-modification"]

$ docker run -it --rm --runtime=nvidia -e NVIDIA_VISIBLE_DEVICES=all ubuntu /bin/bash -c "grep 'ModifyDeviceFile' /proc/driver/nvidia/params"
ModifyDeviceFiles: 1

$ sudo sed -i 's/nvcdi-disable-hooks/#nvcdi-disable-hooks/' /etc/nvidia-container-runtime/config.toml

$ docker run -it --rm --runtime=nvidia -e NVIDIA_VISIBLE_DEVICES=all ubuntu /bin/bash -c "grep 'ModifyDeviceFile' /proc/driver/nvidia/params"
ModifyDeviceFiles: 0

@coveralls
Copy link
Copy Markdown

Coverage Report for CI Build 26549762496

Coverage increased (+0.004%) to 43.5%

Details

  • Coverage increased (+0.004%) from the base build.
  • Patch coverage: 1 of 1 lines across 1 file are fully covered (100%).
  • No coverage regressions found.

Uncovered Changes

No uncovered changes found.

Coverage Regressions

No coverage regressions found.


Coverage Stats

Coverage Status
Relevant Lines: 14977
Covered Lines: 6515
Line Coverage: 43.5%
Coverage Strength: 0.48 hits per line

💛 - Coveralls

Comment thread api/config/v1/runtime.go Outdated
// NVCDIFeatureFlags sets a list of nvcdi features explicitly.
NVCDIFeatureFlags []nvcdi.FeatureFlag `toml:"nvcdi-feature-flags,omitempty"`
// NVCDIDisableHooks sets a list of nvcdi hooks to disable
NVCDIDisabledHooks []nvcdi.HookName `toml:"nvcdi-disabled-hooks,omitempty"`
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Or should this be nvcdi-disable-hooks?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

I have updated this to nvcdi-disable-hooks to align the name here with the --disable-hooks flag for the nvidia-ctk cdi generate command.

@cdesiniotis cdesiniotis marked this pull request as ready for review May 28, 2026 02:02
@cdesiniotis cdesiniotis requested a review from tariq1890 May 28, 2026 02:02
@cdesiniotis cdesiniotis self-assigned this May 28, 2026
@cdesiniotis cdesiniotis added this to the next-minor milestone May 28, 2026
Signed-off-by: Christopher Desiniotis <cdesiniotis@nvidia.com>
@cdesiniotis cdesiniotis force-pushed the jit-cdi-disabled-hooks branch from 5b33a55 to cc8ae13 Compare May 28, 2026 18:43
@cdesiniotis cdesiniotis enabled auto-merge May 28, 2026 19:06
@cdesiniotis cdesiniotis merged commit 97f42c1 into NVIDIA:main May 28, 2026
20 checks passed
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.

3 participants