Skip to content

Commit f5ecbbe

Browse files
committed
fix(xunix): also mount shared object files with .so.N
Signed-off-by: Cian Johnston <[email protected]>
1 parent 2b091cf commit f5ecbbe

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

xunix/gpu.go

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,9 +17,10 @@ import (
1717
)
1818

1919
var (
20-
gpuMountRegex = regexp.MustCompile("(?i)(nvidia|vulkan|cuda)")
21-
gpuExtraRegex = regexp.MustCompile("(?i)(libgl|nvidia|vulkan|cuda)")
22-
gpuEnvRegex = regexp.MustCompile("(?i)nvidia")
20+
gpuMountRegex = regexp.MustCompile("(?i)(nvidia|vulkan|cuda)")
21+
gpuExtraRegex = regexp.MustCompile("(?i)(libgl|nvidia|vulkan|cuda)")
22+
gpuEnvRegex = regexp.MustCompile("(?i)nvidia")
23+
sharedObjectRegex = regexp.MustCompile(`\.so(\.[0-9\.]+)?$`)
2324
)
2425

2526
func GPUEnvs(ctx context.Context) []string {
@@ -103,7 +104,7 @@ func usrLibGPUs(ctx context.Context, log slog.Logger, usrLibDir string) ([]mount
103104
return nil
104105
}
105106

106-
if filepath.Ext(path) != ".so" || !gpuExtraRegex.MatchString(path) {
107+
if !sharedObjectRegex.MatchString(path) || !gpuExtraRegex.MatchString(path) {
107108
return nil
108109
}
109110

0 commit comments

Comments
 (0)