mirror of
https://github.com/NVIDIA/nvidia-container-toolkit
synced 2025-06-26 18:18:24 +00:00
Add update-nvidia-params hook to CDI spec
Some checks failed
Some checks failed
Signed-off-by: Evan Lezar <elezar@nvidia.com>
This commit is contained in:
@@ -44,4 +44,7 @@ const (
|
||||
// HookEnableCudaCompat refers to the hook used to enable CUDA Forward Compatibility.
|
||||
// This was added with v1.17.5 of the NVIDIA Container Toolkit.
|
||||
HookEnableCudaCompat = HookName("enable-cuda-compat")
|
||||
// HookUpdateNvidiaParams refers to the hook used to ensure that device nodes
|
||||
// are not created by nvidia-smi in a container.
|
||||
HookUpdateNvidiaParams = HookName("update-nvidia-params")
|
||||
)
|
||||
|
||||
@@ -115,6 +115,14 @@ func (l *nvcdilib) NewDriverLibraryDiscoverer(version string) (discover.Discover
|
||||
updateLDCache, _ := discover.NewLDCacheUpdateHook(l.logger, libraries, l.nvidiaCDIHookPath, l.ldconfigPath)
|
||||
discoverers = append(discoverers, updateLDCache)
|
||||
|
||||
if l.HookIsSupported(HookUpdateNvidiaParams) {
|
||||
updateNvidiaParams := discover.CreateNvidiaCDIHook(
|
||||
l.nvidiaCDIHookPath,
|
||||
"update-nvidia-params",
|
||||
)
|
||||
discoverers = append(discoverers, updateNvidiaParams)
|
||||
}
|
||||
|
||||
d := discover.Merge(discoverers...)
|
||||
|
||||
return d, nil
|
||||
|
||||
Reference in New Issue
Block a user