mirror of
https://github.com/NVIDIA/nvidia-container-toolkit
synced 2025-06-26 18:18:24 +00:00
Add disabled-device-node-modification hook to CDI spec
Some checks failed
Some checks failed
This hook is not added to management specs. Signed-off-by: Evan Lezar <elezar@nvidia.com>
This commit is contained in:
@@ -46,6 +46,11 @@ const (
|
||||
|
||||
// A CreateSymlinksHook is used to create symlinks in the container.
|
||||
CreateSymlinksHook = discover.CreateSymlinksHook
|
||||
// DisableDeviceNodeModificationHook refers to the hook used to ensure that
|
||||
// device nodes are not created by libnvidia-ml.so or nvidia-smi in a
|
||||
// container.
|
||||
// Added in v1.17.8
|
||||
DisableDeviceNodeModificationHook = discover.DisableDeviceNodeModificationHook
|
||||
// An EnableCudaCompatHook is used to enabled CUDA Forward Compatibility.
|
||||
// Added in v1.17.5
|
||||
EnableCudaCompatHook = discover.EnableCudaCompatHook
|
||||
|
||||
@@ -113,6 +113,9 @@ func (l *nvcdilib) NewDriverLibraryDiscoverer(version string) (discover.Discover
|
||||
updateLDCache, _ := discover.NewLDCacheUpdateHook(l.logger, libraries, l.hookCreator, l.ldconfigPath)
|
||||
discoverers = append(discoverers, updateLDCache)
|
||||
|
||||
disableDeviceNodeModification := l.hookCreator.Create(DisableDeviceNodeModificationHook)
|
||||
discoverers = append(discoverers, disableDeviceNodeModification)
|
||||
|
||||
d := discover.Merge(discoverers...)
|
||||
|
||||
return d, nil
|
||||
|
||||
@@ -130,7 +130,7 @@ func New(opts ...Option) (Interface, error) {
|
||||
l.vendor = "management.nvidia.com"
|
||||
}
|
||||
// Management containers in general do not require CUDA Forward compatibility.
|
||||
l.disabledHooks = append(l.disabledHooks, HookEnableCudaCompat)
|
||||
l.disabledHooks = append(l.disabledHooks, HookEnableCudaCompat, DisableDeviceNodeModificationHook)
|
||||
lib = (*managementlib)(l)
|
||||
case ModeNvml:
|
||||
lib = (*nvmllib)(l)
|
||||
|
||||
Reference in New Issue
Block a user