Skip to content

Commit

Permalink
Add compat-lib hook to CDI spec generation
Browse files Browse the repository at this point in the history
Signed-off-by: Evan Lezar <[email protected]>
  • Loading branch information
elezar committed Feb 6, 2025
1 parent e3361c4 commit f21f7a6
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 0 deletions.
7 changes: 7 additions & 0 deletions cmd/nvidia-ctk/cdi/generate/generate_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,13 @@ containerEdits:
- libcuda.so.1::/lib/x86_64-linux-gnu/libcuda.so
hookName: createContainer
path: /usr/bin/nvidia-cdi-hook
- args:
- nvidia-cdi-hook
- compat-libs
- --driver-version
- 999.88.77
hookName: createContainer
path: /usr/bin/nvidia-cdi-hook
- args:
- nvidia-cdi-hook
- update-ldcache
Expand Down
3 changes: 3 additions & 0 deletions pkg/nvcdi/driver-nvml.go
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,8 @@ func NewDriverLibraryDiscoverer(logger logger.Interface, driver *root.Driver, nv
libraryPaths,
)

// TODO: The following should use the version directly.
compatLibHookDiscoverer := discover.NewCUDACompatLibsDiscoverer(logger, nvidiaCDIHookPath, driver)
updateLDCache, _ := discover.NewLDCacheUpdateHook(logger, libraries, nvidiaCDIHookPath, ldconfigPath)

d := discover.Merge(
Expand All @@ -105,6 +107,7 @@ func NewDriverLibraryDiscoverer(logger logger.Interface, driver *root.Driver, nv
version,
nvidiaCDIHookPath,
),
compatLibHookDiscoverer,
updateLDCache,
)

Expand Down

0 comments on commit f21f7a6

Please sign in to comment.