File tree 2 files changed +24
-1
lines changed
cmd/nvidia-ctk/cdi/generate
2 files changed +24
-1
lines changed Original file line number Diff line number Diff line change @@ -287,7 +287,15 @@ func (m command) generateSpec(opts *options) (spec.Interface, error) {
287
287
288
288
if len (opts .disableHooks .Value ()) > 0 {
289
289
for _ , hook := range opts .disableHooks .Value () {
290
- initOpts = append (initOpts , nvcdi .WithDisabledHook (nvcdi .HookName (hook )))
290
+ if hook == "all" {
291
+ initOpts = append (initOpts , nvcdi .WithDisabledHook (nvcdi .HookEnableCudaCompat ))
292
+ initOpts = append (initOpts , nvcdi .WithDisabledHook (nvcdi .HookCreateSymlinks ))
293
+ initOpts = append (initOpts , nvcdi .WithDisabledHook (nvcdi .HookUpdateLDCache ))
294
+ break
295
+ }
296
+ if nvcdi .IsValidHook (hook ) {
297
+ initOpts = append (initOpts , nvcdi .WithDisabledHook (nvcdi .HookName (hook )))
298
+ }
291
299
}
292
300
}
293
301
Original file line number Diff line number Diff line change @@ -44,4 +44,19 @@ const (
44
44
// HookEnableCudaCompat refers to the hook used to enable CUDA Forward Compatibility.
45
45
// This was added with v1.17.5 of the NVIDIA Container Toolkit.
46
46
HookEnableCudaCompat = HookName ("enable-cuda-compat" )
47
+ // HookCreateSymlinks refers to the hook used create symlinks inside the
48
+ // directory path to be mounted into a container.
49
+ HookCreateSymlinks = HookName ("create-symlinks" )
50
+ // HookUpdateLDCache refers to the hook used to Update the dynamic linker
51
+ // cache inside the directory path to be mounted into a container.
52
+ HookUpdateLDCache = HookName ("update-ldcache" )
47
53
)
54
+
55
+ func IsValidHook (hook string ) bool {
56
+ switch HookName (hook ) {
57
+ case HookEnableCudaCompat , HookCreateSymlinks , HookUpdateLDCache :
58
+ return true
59
+ default :
60
+ return false
61
+ }
62
+ }
You can’t perform that action at this time.
0 commit comments