From df40fbe03e720254c5084bddf010fc0f3d734992 Mon Sep 17 00:00:00 2001 From: Evan Lezar Date: Thu, 16 Mar 2023 15:30:43 +0200 Subject: [PATCH] Locate persistenced and fabricmanager sockets at /run instead of /var/run This chagne prefers (non-symlink) sockets at /run over /var/run for nvidia-persistenced and nvidia-fabricmanager sockets. Signed-off-by: Evan Lezar --- CHANGELOG.md | 2 ++ internal/discover/ipc.go | 26 ++++++++++++++++++++++---- 2 files changed, 24 insertions(+), 4 deletions(-) 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.