Skip to content

fix: Use system search path when locate driver library#1820

Open
reddevillg wants to merge 1 commit into
NVIDIA:mainfrom
reddevillg:fix_lib_locate
Open

fix: Use system search path when locate driver library#1820
reddevillg wants to merge 1 commit into
NVIDIA:mainfrom
reddevillg:fix_lib_locate

Conversation

@reddevillg
Copy link
Copy Markdown

@reddevillg reddevillg commented May 12, 2026

on Debian driver library may installed on both /usr/lib/<archtriplet> and /usr/lib/<archtriplet>/nvidia/current

fix #1559

@copy-pr-bot
Copy link
Copy Markdown

copy-pr-bot Bot commented May 12, 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.

"/lib/aarch64-linux-gnu/nvidia/current",
libcudasoParentDirPath,
}
for _, dir := range additionalDirs {
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

We already search these paths for libcuda.so.RM_VERSION and now we're specifying them again. I agree that we can make this more robust, but I would rather use a specific set of directories here than broadening the set again.

As a follow-up question: Could we plumb through the other directories through additionalDirs instead of hardcoding them here?

@elezar
Copy link
Copy Markdown
Member

elezar commented May 12, 2026

@reddevillg I have added a commit on top that should allow multiple driver library paths to be supported. Could you confirm that this works in your environment?

@reddevillg
Copy link
Copy Markdown
Author

@reddevillg I have added a commit on top that should allow multiple driver library paths to be supported. Could you confirm that this works in your environment?

It works perfectly.

@elezar
Copy link
Copy Markdown
Member

elezar commented May 12, 2026

@reddevillg I have added a commit on top that should allow multiple driver library paths to be supported. Could you confirm that this works in your environment?

It works perfectly.

That's great! Did you want to squash the two commits and then we could get @cdesiniotis or @tariq1890 to also review this?

@reddevillg
Copy link
Copy Markdown
Author

@reddevillg I have added a commit on top that should allow multiple driver library paths to be supported. Could you confirm that this works in your environment?

It works perfectly.

That's great! Did you want to squash the two commits and then we could get @cdesiniotis or @tariq1890 to also review this?

it's ok, you can edit it directly, or tell me what I need to do

On some systems (e.g. Debian), the driver libraries may be located in
multiple paths on the system. This change allows these driver libraries
to be found by locating all libraries with the expected version suffix.

Signed-off-by: Evan Lezar <elezar@nvidia.com>
Co-authored--by: Guo Lv <reddevillg@gmail.com>
@elezar
Copy link
Copy Markdown
Member

elezar commented May 13, 2026

@reddevillg I have added a commit on top that should allow multiple driver library paths to be supported. Could you confirm that this works in your environment?

It works perfectly.

That's great! Did you want to squash the two commits and then we could get @cdesiniotis or @tariq1890 to also review this?

it's ok, you can edit it directly, or tell me what I need to do

I have squashed the commits.

@elezar elezar requested review from cdesiniotis and tariq1890 May 13, 2026 08:56
@elezar elezar added this to the next-minor milestone May 13, 2026

// buildXOrgSearchPaths returns the ordered list of search paths for XOrg files.
func buildXOrgSearchPaths(libRoot string) []string {
func buildXOrgSearchPathsForSingle(libRoot string) []string {
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.

Can we update the comment so it matches the new method name?

return match
}

func buildXOrgSearchPaths(roots ...string) []string {
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.

This comment needs to be moved above this method?

// buildXOrgSearchPaths returns the ordered list of search paths for XOrg files.

driverLibPaths, err := r.Libraries().Locate(driverLib + versionSuffix)
if err != nil {
errs = errors.Join(errs, fmt.Errorf("failed to locate libcuda.so: %w", err))
errs = errors.Join(errs, fmt.Errorf("failed to locate %v: %w", driverLib, 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.

Suggested change
errs = errors.Join(errs, fmt.Errorf("failed to locate %v: %w", driverLib, err))
errs = errors.Join(errs, fmt.Errorf("failed to locate %q: %w", driverLib, err))

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.

Vuklan not recognized with nvidia-toolkit 1.18, Debian 13 Trixie

3 participants