Skip to content

Fix discovery of nvidia-fs devices in non-privileged containers #1150

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

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
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
5 changes: 3 additions & 2 deletions internal/discover/gds.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,10 +29,11 @@ type gdsDeviceDiscoverer struct {
}

// NewGDSDiscoverer creates a discoverer for GPUDirect Storage devices and mounts.
func NewGDSDiscoverer(logger logger.Interface, driverRoot string, devRoot string) (Discover, error) {
func NewGDSDiscoverer(logger logger.Interface, driverRoot string) (Discover, error) {
devices := NewCharDeviceDiscoverer(
logger,
devRoot,
// The /dev/nvidia-fs* devices are always created at /
"/",
[]string{"/dev/nvidia-fs*"},
)

Expand Down
2 changes: 1 addition & 1 deletion internal/modifier/gated.go
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ func NewFeatureGatedModifier(logger logger.Interface, cfg *config.Config, image
devRoot := cfg.NVIDIAContainerCLIConfig.Root

if image.Getenv("NVIDIA_GDS") == "enabled" {
d, err := discover.NewGDSDiscoverer(logger, driverRoot, devRoot)
d, err := discover.NewGDSDiscoverer(logger, driverRoot)
if err != nil {
return nil, fmt.Errorf("failed to construct discoverer for GDS devices: %w", err)
}
Expand Down
2 changes: 1 addition & 1 deletion pkg/nvcdi/gds.go
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ var _ Interface = (*gdslib)(nil)

// GetAllDeviceSpecs returns the device specs for all available devices.
func (l *gdslib) GetAllDeviceSpecs() ([]specs.Device, error) {
discoverer, err := discover.NewGDSDiscoverer(l.logger, l.driverRoot, l.devRoot)
discoverer, err := discover.NewGDSDiscoverer(l.logger, l.driverRoot)
if err != nil {
return nil, fmt.Errorf("failed to create GPUDirect Storage discoverer: %v", err)
}
Expand Down