diff --git a/CHANGELOG.md b/CHANGELOG.md index 76c8902b..060bbf05 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,8 @@ ## v1.13.0-rc.3 +* Prefer /run over /var/run when locating nvidia-persistenced and nvidia-fabricmanager sockets. + ## v1.13.0-rc.2 * Don't fail chmod hook if paths are not injected diff --git a/internal/discover/ipc.go b/internal/discover/ipc.go index 622c6aab..0604a522 100644 --- a/internal/discover/ipc.go +++ b/internal/discover/ipc.go @@ -25,21 +25,39 @@ type ipcMounts mounts // NewIPCDiscoverer creats a discoverer for NVIDIA IPC sockets. func NewIPCDiscoverer(logger *logrus.Logger, driverRoot string) (Discover, error) { - d := newMounts( + sockets := newMounts( logger, lookup.NewFileLocator( lookup.WithLogger(logger), lookup.WithRoot(driverRoot), + lookup.WithSearchPaths("/run", "/var/run"), + lookup.WithCount(1), + ), + driverRoot, + []string{ + "/nvidia-persistenced/socket", + "/nvidia-fabricmanager/socket", + }, + ) + + mps := newMounts( + logger, + lookup.NewFileLocator( + lookup.WithLogger(logger), + lookup.WithRoot(driverRoot), + lookup.WithCount(1), ), driverRoot, []string{ - "/var/run/nvidia-persistenced/socket", - "/var/run/nvidia-fabricmanager/socket", "/tmp/nvidia-mps", }, ) - return (*ipcMounts)(d), nil + d := Merge( + (*ipcMounts)(sockets), + (*ipcMounts)(mps), + ) + return d, nil } // Mounts returns the discovered mounts with "noexec" added to the mount options.