Skip to content

Commit eeef750

Browse files
committed
Add cuda-compat hook to CDI spec generation
Signed-off-by: Evan Lezar <[email protected]>
1 parent d0bd321 commit eeef750

File tree

3 files changed

+15
-0
lines changed

3 files changed

+15
-0
lines changed

Diff for: cmd/nvidia-ctk-installer/container/toolkit/toolkit_test.go

+6
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,12 @@ containerEdits:
8080
- libcuda.so.1::/lib/x86_64-linux-gnu/libcuda.so
8181
hookName: createContainer
8282
path: {{ .toolkitRoot }}/nvidia-cdi-hook
83+
- args:
84+
- nvidia-cdi-hook
85+
- cuda-compat
86+
- --host-driver-version=999.88.77
87+
hookName: createContainer
88+
path: {{ .toolkitRoot }}/nvidia-cdi-hook
8389
- args:
8490
- nvidia-cdi-hook
8591
- update-ldcache

Diff for: cmd/nvidia-ctk/cdi/generate/generate_test.go

+6
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,12 @@ containerEdits:
7979
- libcuda.so.1::/lib/x86_64-linux-gnu/libcuda.so
8080
hookName: createContainer
8181
path: /usr/bin/nvidia-cdi-hook
82+
- args:
83+
- nvidia-cdi-hook
84+
- cuda-compat
85+
- --host-driver-version=999.88.77
86+
hookName: createContainer
87+
path: /usr/bin/nvidia-cdi-hook
8288
- args:
8389
- nvidia-cdi-hook
8490
- update-ldcache

Diff for: pkg/nvcdi/driver-nvml.go

+3
Original file line numberDiff line numberDiff line change
@@ -97,6 +97,8 @@ func NewDriverLibraryDiscoverer(logger logger.Interface, driver *root.Driver, nv
9797
libraryPaths,
9898
)
9999

100+
// TODO: The following should use the version directly.
101+
cudaCompatLibHookDiscoverer := discover.NewCUDACompatHookDiscoverer(logger, nvidiaCDIHookPath, driver)
100102
updateLDCache, _ := discover.NewLDCacheUpdateHook(logger, libraries, nvidiaCDIHookPath, ldconfigPath)
101103

102104
d := discover.Merge(
@@ -105,6 +107,7 @@ func NewDriverLibraryDiscoverer(logger logger.Interface, driver *root.Driver, nv
105107
version,
106108
nvidiaCDIHookPath,
107109
),
110+
cudaCompatLibHookDiscoverer,
108111
updateLDCache,
109112
)
110113

0 commit comments

Comments
 (0)