Skip to content

Create device nodes #976

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

Open
wants to merge 8 commits into
base: main
Choose a base branch
from
Open

Create device nodes #976

wants to merge 8 commits into from

Conversation

elezar
Copy link
Member

@elezar elezar commented Mar 9, 2025

No description provided.

elezar added 4 commits March 10, 2025 10:55
This change attempts to load the nvidia, nvidia-uvm, and nvidia-modeset
kernel modules before generating the automatic (jit) CDI specification.

The kernel modules can be controlled by the

nvidia-container-runtime.modes.jit-cdi.load-kernel-modules

config option. If this is set to the empty list, then no kernel modules
are loaded.

Errors in loading the kernel modules are logged, but ignored.

Signed-off-by: Evan Lezar <[email protected]>
@elezar elezar force-pushed the create-device-nodes branch 2 times, most recently from f15db29 to 00ddf82 Compare March 10, 2025 14:12
@elezar elezar force-pushed the create-device-nodes branch from 00ddf82 to 7426080 Compare March 10, 2025 14:16
@elezar elezar force-pushed the create-device-nodes branch from 7426080 to 1cfaef4 Compare March 10, 2025 14:19
@elezar elezar added this to the Disable legacy code path by default milestone Mar 10, 2025
Copy link
Collaborator

@ArangoGutierrez ArangoGutierrez left a comment

Choose a reason for hiding this comment

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

just 2 minor comments, I'll run a manual test now

@@ -125,3 +128,20 @@ func xdgDataDirs() []string {

return []string{"/usr/local/share", "/usr/share"}
}

// LoadKmods loads the specified kernel modules in the driver root.
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
// LoadKmods loads the specified kernel modules in the driver root.
// LoadKernelModules loads the specified kernel modules in the driver root.


// MigCap represents the path to a MIG cap file
// MigMinor represents the minor number of a MIG device
Copy link
Collaborator

Choose a reason for hiding this comment

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

Should we have consistency on the // doc I see for Index we have // A VarName but for the rest we use the regular // VarName

@ArangoGutierrez
Copy link
Collaborator

Note
From https://download.nvidia.com/XFree86/Linux-x86_64/396.54/README/README.txt

Q. How and when are the NVIDIA device files created?

A. When a user-space NVIDIA driver component needs to communicate with the
   NVIDIA kernel module, and the NVIDIA character device files do not yet
   exist, the user-space component will first attempt to load the kernel
   module and create the device files itself.

   Device file creation and kernel module loading generally require root
   privileges. The X driver, running within a setuid root X server, will have
   these privileges, but not, e.g., the CUDA driver within the environment of
   a normal user.

   If the user-space NVIDIA driver component cannot load the kernel module or
   create the device files itself, it will attempt to invoke the setuid root
   nvidia-modprobe utility, which will perform these operations on behalf of
   the non-privileged driver.

We have found that with the current nvidia-ctk , calling nvidia-ctk cdi generate causes the device nodes to be created.

@ArangoGutierrez ArangoGutierrez mentioned this pull request May 9, 2025
@elezar elezar modified the milestones: Disable legacy code path by default, v1.18.0 May 9, 2025
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