Skip to content

Fix cufftMp soname priority: tabulate linux_sonames oldest-first - #2499

Open
LeSingh1 wants to merge 1 commit into
NVIDIA:mainfrom
LeSingh1:pathfinder-cufftmp-soname-order
Open

Fix cufftMp soname priority: tabulate linux_sonames oldest-first#2499
LeSingh1 wants to merge 1 commit into
NVIDIA:mainfrom
LeSingh1:pathfinder-cufftmp-soname-order

Conversation

@LeSingh1

@LeSingh1 LeSingh1 commented Aug 4, 2026

Copy link
Copy Markdown

load_dl_linux._candidate_sonames() reverses desc.linux_sonames "to achieve new -> old search order", so the catalog has to tabulate oldest version first.

cufftMp is the only one of the 49 catalog entries that lists them newest-first:

linux_sonames=("libcufftMp.so.12", "libcufftMp.so.11"),

After the reversal that becomes .so.11 then .so.12, so on a system where both are reachable, load_nvidia_dynamic_lib("cufftMp") picks the older one — both in check_if_already_loaded_from_elsewhere() and in the system search. Every other library prefers the newest.

The entry started as ("libcufftMp.so.11",) and .so.12 was prepended rather than appended in #1194.

This swaps the two, documents the convention on the DescriptorSpec.linux_sonames field, and adds a parametrized catalog invariant so a future entry can't regress the same way silently. The invariant fails on cufftMp alone before the swap.

Not addressed here: cupti.windows_dlls is also tabulated newest-first. It looked like the same mistake, but correcting the data would also change check_if_already_loaded_from_elsewhere(), which — unlike its Linux counterpart and unlike load_with_system_search — does not reverse the tuple. I have no way to test that path, so I left it for someone who can.

NOTE: developed with the assistance of an AI coding agent. The new test carries @pytest.mark.agent_authored per AGENTS.md. I reviewed and verified the change before submitting.

`load_dl_linux._candidate_sonames()` reverses `desc.linux_sonames` "to achieve
new -> old search order", so the catalog must list the oldest version first.
`cufftMp` is the only entry that lists them newest-first
(`libcufftMp.so.12`, `libcufftMp.so.11`), which inverts the intent: when both
versions are reachable, the already-loaded check and the system search both
pick `libcufftMp.so.11` over `libcufftMp.so.12`.

The entry started as `("libcufftMp.so.11",)` and `.so.12` was prepended rather
than appended in NVIDIA#1194. Swap the two and add a catalog invariant test so the
next entry cannot regress the same way.
@copy-pr-bot

copy-pr-bot Bot commented Aug 4, 2026

Copy link
Copy Markdown
Contributor

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.

@github-actions github-actions Bot added the cuda.pathfinder Everything related to the cuda.pathfinder module label Aug 4, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

cuda.pathfinder Everything related to the cuda.pathfinder module

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant