Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 24 additions & 0 deletions pkg/nvcdi/driver-nvml.go
Original file line number Diff line number Diff line change
Expand Up @@ -81,13 +81,18 @@ func (l *nvcdilib) NewDriverLibraryDiscoverer(version string) (discover.Discover
if err != nil {
return nil, err
}
legacyNVVMLibraryMounts, err := l.getLegacyNVVMLibraryMounts()
if err != nil {
return nil, err

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: can you wrap the error here?

}
explicitLibraryMounts, err := l.getExplicitDriverLibraryMounts()
if err != nil {
return nil, err
}

libraries := discover.Merge(
versionSuffixLibraryMounts,
legacyNVVMLibraryMounts,

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I initially added libnvidia-nvvm70.so to getExplicitDriverLibraryMounts() (which was a one line change), but I noticed that the explicit driver libraries only get added if one opts-in to the enable-explicit-driver-libraries feature flag (this behavior was introduced in 5a3dcbe).

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@elezar in the commit message for 5a3dcbe you mention:

Instead of always injecting the list of explict libraries, we
switch these to opt-in instead. This means that they can be
generated in use cases such as GKE where they are expected,
but don't affect other use cases where they are not.

Do you recall what use cases were affected by having the explicit driver libraries mounted by default? I am curious as to why this was made an opt-in to begin with.

explicitLibraryMounts,
)

Expand Down Expand Up @@ -183,6 +188,25 @@ func (l *nvcdilib) getExplicitDriverLibraryMounts() (discover.Discover, error) {

}

func (l *nvcdilib) getLegacyNVVMLibraryMounts() (discover.Discover, error) {
legacyNVMMLibrary := []string{
"libnvidia-nvvm70.so.*",
}

driverLibraryLocator, err := l.driver.DriverLibraryLocator()
if err != nil {
return nil, fmt.Errorf("failed to get driver library locator: %w", err)
}
mounts := discover.NewMounts(
l.logger,
driverLibraryLocator,
l.driver.Root,
legacyNVMMLibrary,
)

return mounts, nil
}

func getUTSRelease() (string, error) {
utsname := &unix.Utsname{}
if err := unix.Uname(utsname); err != nil {
Expand Down
Loading