Skip to content
Draft
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
22 changes: 21 additions & 1 deletion pkg/nvcdi/lib-csv.go
Original file line number Diff line number Diff line change
Expand Up @@ -82,5 +82,25 @@ func (l *csvlib) GetDeviceSpecs() ([]specs.Device, error) {

// GetCommonEdits generates a CDI specification that can be used for ANY devices
func (l *csvlib) GetCommonEdits() (*cdi.ContainerEdits, error) {
return edits.FromDiscoverer(discover.None{})
if l.featureFlags["disable-openrm-drivers-in-csv"] {
Copy link
Collaborator

Choose a reason for hiding this comment

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

Question: Where is this FeatureFlag documented?

Copy link
Member Author

Choose a reason for hiding this comment

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

It isn't yet. This is something that I need to follow-up on if this PR moves out of draft.

return edits.FromDiscoverer(discover.None{})
}

d, err := (*nvcdilib)(l).newDriverVersionDiscoverer()
if err != nil {
return nil, fmt.Errorf("failed to create discoverer for driver files: %v", err)
}

metaDevices := discover.NewCharDeviceDiscoverer(
l.logger,
l.devRoot,
[]string{
"/dev/nvidia-modeset",
"/dev/nvidia-uvm-tools",
"/dev/nvidia-uvm",
"/dev/nvidiactl",
},
)

return edits.FromDiscoverer(discover.Merge(d, metaDevices))
}