Skip to content

Add option to enable CDI via NVIDIA-CTK#319

Merged
ArangoGutierrez merged 1 commit intoNVIDIA:mainfrom
ArangoGutierrez:quick_cdi_enablement
Mar 20, 2025
Merged

Add option to enable CDI via NVIDIA-CTK#319
ArangoGutierrez merged 1 commit intoNVIDIA:mainfrom
ArangoGutierrez:quick_cdi_enablement

Conversation

@ArangoGutierrez
Copy link
Collaborator

@ArangoGutierrez ArangoGutierrez commented Mar 20, 2025

This pull request introduces changes to enable the Container Device Interface (CDI) plugin in the NVIDIA Container Toolkit. The key changes involve adding a new configuration option for CDI in the NVIDIAContainerToolkit struct and updating the container runtime configuration script to support this option.

Configuration enhancements:

Runtime configuration updates:

Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR adds the option to enable the Container Device Interface (CDI) for NVIDIA-CTK by introducing a new boolean parameter and updating the command-line configuration as well as the API types.

  • Updated container-toolkit template to include the "--cdi.enable" flag.
  • Added a new boolean field "EnableCDI" in both the provisioner and API types.
  • Modified the constructor logic for ContainerToolkit to conditionally set EnableCDI based on the environment.

Reviewed Changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.

File Description
pkg/provisioner/templates/container-toolkit.go Updated the runtime configuration command and added EnableCDI field; updated initialization logic with a TODO regarding the default value.
api/holodeck/v1alpha1/types.go Added the EnableCDI boolean field to the NVIDIAContainerToolkit type.
Comments suppressed due to low confidence (1)

pkg/provisioner/templates/container-toolkit.go:40

  • Verify that the boolean value passed via '{{.EnableCDI}}' correctly translates to the expected string value required by NVIDIA-CTK. Consider explicitly converting the boolean to the proper flag format if needed.
sudo nvidia-ctk runtime configure --runtime={{.ContainerRuntime}} --set-as-default --cdi.enable={{.EnableCDI}}

@ArangoGutierrez ArangoGutierrez requested a review from Copilot March 20, 2025 14:25
@ArangoGutierrez ArangoGutierrez added this to the v0.2.7 milestone Mar 20, 2025
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR adds an option to enable the Container Device Interface (CDI) via NVIDIA-CTK.

  • Updates the container runtime configuration command to include the new --cdi.enable flag.
  • Introduces an EnableCDI field in both the provisioner template and the NVIDIAContainerToolkit CRD.

Reviewed Changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.

File Description
pkg/provisioner/templates/container-toolkit.go Adds the EnableCDI field and updates the CLI command with the new flag.
api/holodeck/v1alpha1/types.go Updates the CRD definition by adding an optional EnableCDI boolean field.
Comments suppressed due to low confidence (2)

pkg/provisioner/templates/container-toolkit.go:40

  • Verify that the addition of the '--cdi.enable' flag is intentional, and double-check that the template execution in the Execute function is not duplicated unintentionally, as duplicate execution may lead to unexpected behavior.
sudo nvidia-ctk runtime configure --runtime={{.ContainerRuntime}} --set-as-default --cdi.enable={{.EnableCDI}}

pkg/provisioner/templates/container-toolkit.go:62

  • Consider adding test cases to ensure that the EnableCDI flag is correctly set and reflected in the container toolkit configuration when specified in the environment.
if env.Spec.NVIDIAContainerToolkit.EnableCDI {

Signed-off-by: Carlos Eduardo Arango Gutierrez <eduardoa@nvidia.com>
@ArangoGutierrez ArangoGutierrez merged commit 168a61c into NVIDIA:main Mar 20, 2025
13 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