Skip to content

Conversation

@Ronitsabhaya75
Copy link

Previous Behavior
The discovery logic used a generic . wildcard pattern to identify driver libraries. This was less precise and could potentially match unrelated files or incorrect versions.

pattern := strings.TrimSuffix(libraryName, ".") + ".*.*"

Current Behavior
The update modifies graphicsDriverLibraries to explicitly use the detected driver version when constructing the match pattern. This ensures that only libraries matching the active driver version are processed, preventing false positives and ensuring consistency.

pattern := strings.TrimSuffix(libraryName, ".") + "." + d.driverVersion

@copy-pr-bot
Copy link

copy-pr-bot bot commented Jan 14, 2026

This pull request requires additional validation before any workflows can run on NVIDIA's runners.

Pull request vetters can view their responsibilities here.

Contributors can view more details about this message here.

Signed-off-by: Ronit Sabhaya <ronitsabhaya75@gmail.com>
Comment on lines -112 to -113
logger logger.Interface
hookCreator HookCreator
Copy link
Member

Choose a reason for hiding this comment

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

Question: Why were these members removed?

Copy link
Author

Choose a reason for hiding this comment

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

Question: Why were these members removed?

@elezar I accidentally removed those members lemme revert those. I'm really sorry for this mistake

}
// We use the driver version as a pattern for matching libraries.
// This pattern is used to identify libraries that are part of the driver.
cudaVersionPattern := driverVersion
Copy link
Member

Choose a reason for hiding this comment

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

Let's just update the strings below to use driverVersion directly.

Copy link
Member

@elezar elezar left a comment

Choose a reason for hiding this comment

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

Thanks for the contribution addressing a long-outstanding TODO.

I think it looks fine in practice, but needs some minor cleanup.

Signed-off-by: Ronit Sabhaya <ronitsabhaya75@gmail.com>
@Ronitsabhaya75
Copy link
Author

Thanks for the contribution addressing a long-outstanding TODO.

I think it looks fine in practice, but needs some minor cleanup.

@elezar I'll work on those reviews and clean it up

…covery

Signed-off-by: Ronit Sabhaya <ronitsabhaya75@gmail.com>
@Ronitsabhaya75 Ronitsabhaya75 requested a review from elezar January 14, 2026 16:49
Copy link
Member

@elezar elezar left a comment

Choose a reason for hiding this comment

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

Thanks. I have some further suggestions.

Please also rebase and squash your changes into a single commit.

Comment on lines +112 to +115
// driverVersion is the version of the driver that is being used.
driverVersion string
logger logger.Interface
hookCreator HookCreator
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
// driverVersion is the version of the driver that is being used.
driverVersion string
logger logger.Interface
hookCreator HookCreator
logger logger.Interface
hookCreator HookCreator
// driverVersionSuffix is the version of the driver that is being used
// prefixed with a '.'
driverVersionSuffix string

Comment on lines +168 to +171
Discover: Merge(libraries, xorgLibraries),
logger: logger,
hookCreator: hookCreator,
driverVersion: driverVersion,
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
Discover: Merge(libraries, xorgLibraries),
logger: logger,
hookCreator: hookCreator,
driverVersion: driverVersion,
Discover: Merge(libraries, xorgLibraries),
logger: logger,
hookCreator: hookCreator,
driverVersionSuffix: "." + driverVersion,

func (d graphicsDriverLibraries) isDriverLibrary(filename string, libraryName string) bool {
// TODO: Instead of `.*.*` we could use the driver version.
pattern := strings.TrimSuffix(libraryName, ".") + ".*.*"
pattern := strings.TrimSuffix(libraryName, ".") + "." + d.driverVersion
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
pattern := strings.TrimSuffix(libraryName, ".") + "." + d.driverVersion
pattern := libraryName + d.driverVersionSuffix

Note that we never call this function with a libraryName ending in ., so we can remove the additional TrimSuffix to further simplify this.

Copy link
Author

Choose a reason for hiding this comment

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

@elezar thank you for the review I'll sure work on the commits and once im free from work

@elezar elezar added this to the v1.19.0 milestone Jan 22, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants