-
Notifications
You must be signed in to change notification settings - Fork 349
Add --disable-hook flag to cdi generate command #1077
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -99,21 +99,34 @@ func (l *nvcdilib) NewDriverLibraryDiscoverer(version string) (discover.Discover | |
|
||
var discoverers []discover.Discover | ||
|
||
driverDotSoSymlinksDiscoverer := discover.WithDriverDotSoSymlinks( | ||
libraries, | ||
version, | ||
l.nvidiaCDIHookPath, | ||
) | ||
discoverers = append(discoverers, driverDotSoSymlinksDiscoverer) | ||
if l.HookIsSupported(HookCreateSymlinks) { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. For this hook specifically (and the update-ldcache hook too), there are many places in the code where we are injecting this hook. As such this is not going to be sufficient to prevent their injection. This was why I suggested that handling these hooks is out of scope for this PR. |
||
driverDotSoSymlinksDiscoverer := discover.WithDriverDotSoSymlinks( | ||
libraries, | ||
version, | ||
l.nvidiaCDIHookPath, | ||
) | ||
discoverers = append(discoverers, driverDotSoSymlinksDiscoverer) | ||
} | ||
|
||
if l.HookIsSupported(HookEnableCudaCompat) { | ||
// TODO: The following should use the version directly. | ||
cudaCompatLibHookDiscoverer := discover.NewCUDACompatHookDiscoverer(l.logger, l.nvidiaCDIHookPath, l.driver) | ||
cudaCompatLibHookDiscoverer := discover.NewCUDACompatHookDiscoverer( | ||
l.logger, | ||
l.nvidiaCDIHookPath, | ||
l.driver, | ||
) | ||
discoverers = append(discoverers, cudaCompatLibHookDiscoverer) | ||
} | ||
|
||
updateLDCache, _ := discover.NewLDCacheUpdateHook(l.logger, libraries, l.nvidiaCDIHookPath, l.ldconfigPath) | ||
discoverers = append(discoverers, updateLDCache) | ||
if l.HookIsSupported(HookUpdateLDCache) { | ||
updateLDCache, _ := discover.NewLDCacheUpdateHook( | ||
l.logger, | ||
libraries, | ||
l.nvidiaCDIHookPath, | ||
l.ldconfigPath, | ||
) | ||
discoverers = append(discoverers, updateLDCache) | ||
} | ||
|
||
d := discover.Merge(discoverers...) | ||
|
||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should we also add a disable-all-hooks flag so people don't have to enumerate all of them to disable them.
Also, should we add a list-hooks command so people can discover what hooks are available for disabling
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@klueska my thoughts on how to handle the disabling of all hooks is to also accept
all
as a valid hook name. So that--disable-hook(s)=all
can be specified.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do you mean something like:
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have added an alias of
disable-hooks
and a better Usage description.