File tree Expand file tree Collapse file tree 1 file changed +17
-1
lines changed Expand file tree Collapse file tree 1 file changed +17
-1
lines changed Original file line number Diff line number Diff line change 1717package cuda
1818
1919import (
20+ "path/filepath"
21+
2022 "github.com/NVIDIA/nvidia-container-toolkit/internal/lookup"
2123)
2224
@@ -35,5 +37,19 @@ func New(libraries lookup.Locator) lookup.Locator {
3537// Locate returns the path to the libcuda.so.RMVERSION file.
3638// libcuda.so is prefixed to the specified pattern.
3739func (l * cudaLocator ) Locate (pattern string ) ([]string , error ) {
38- return l .Locator .Locate ("libcuda.so" + pattern )
40+ candidates , err := l .Locator .Locate ("libcuda.so.1" )
41+ if err != nil {
42+ return nil , err
43+ }
44+
45+ var matched []string
46+ for _ , candidate := range candidates {
47+ matches , err := filepath .Match ("libcuda.so" + pattern , filepath .Base (candidate ))
48+ if err != nil || ! matches {
49+ continue
50+ }
51+ matched = append (matched , candidate )
52+ }
53+
54+ return matched , nil
3955}
You can’t perform that action at this time.
0 commit comments