fix(cdi): include 32-bit libraries in discovery - #1968
Open
elibosley wants to merge 2 commits into
Open
Conversation
Signed-off-by: Eli Bosley <eli@bosley.dev>
Signed-off-by: Eli Bosley <eli@bosley.dev>
elibosley
marked this pull request as ready for review
August 2, 2026 02:02
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
CDI generation omitted the host's 32-bit NVIDIA driver stack on multilib systems; this combines predefined-path and linker-cache discovery so generated specs include both native and compat32 libraries.
Why This Exists
ldcache.List()returns separate 32-bit and 64-bit library sets, but the CDI lookup path discarded the 32-bit set. The default library locator also stopped after finding libraries in a predefined native path, which prevented the linker cache from contributing libraries installed in a separate compat32 directory.The resulting CDI spec could expose the 64-bit NVIDIA stack while leaving a 32-bit Vulkan application such as a Steam or Proton title without the matching vendor libraries. In that state, the application can select software rendering even though compatible ELF32 NVIDIA libraries are installed on the host.
This is related to #563, which tracks broader graphics-library coverage.
Resolution
The default library locator now merges predefined-path and linker-cache results and deduplicates the combined list. Linker-cache discovery consumes both architecture lists, with native libraries first so existing version-inference precedence remains stable.
This keeps architecture discovery in the host linker cache rather than adding distribution-specific compat32 paths to CDI generation.
Reviewer Considerations
lookup.Mergecombinator is the preferred shape for combining locator results; it mirrors the existing exportedlookup.Firstbehavior while retaining successful matches when another locator fails.Behavior Changes
Implementation Summary
ldcache.List().Verification
make testpassed.go run github.com/golangci/golangci-lint/v2/cmd/golangci-lint@latest run --timeout 5m ./...passed with 0 issues.go vet ./pkg/lookuppassed.git diff --checkpassed./usr/lib64library mounts and 0/usr/liblibrary mounts;maingenerated 41/usr/lib64library mounts and 25/usr/liblibrary mounts;/usr/libentries were verified as ELF32 and includedlibcuda,libnvidia-ml, andlibGLX_nvidia.Risk
Low to moderate. The discovery set intentionally grows on multilib hosts, and the primary compatibility risk is a caller assuming only one architecture is returned. Native-first ordering, deduplication, package tests, the full upstream test suite, and real-host CDI generation cover that behavior.