Skip to content

[FIX]: pathfinder: Add missing static-lib CUDA 12 path for Windows conda layouts.#2015

Open
rwgk wants to merge 1 commit intomainfrom
rwgk/stacked/pathfinder/static_lib_conda_fix
Open

[FIX]: pathfinder: Add missing static-lib CUDA 12 path for Windows conda layouts.#2015
rwgk wants to merge 1 commit intomainfrom
rwgk/stacked/pathfinder/static_lib_conda_fix

Conversation

@rwgk
Copy link
Copy Markdown
Contributor

@rwgk rwgk commented May 4, 2026

Latent bug discovered while testing PR #1977 (xref issue #1038) with Windows Conda.

Source change — find_static_lib.py

  • The _StaticLibInfo schema had a single conda lookup directory per library (conda_rel_path: str). On Windows that was hard-coded to Library/lib/x64, but only CUDA 13 conda environments lay cudadevrt.lib out that way; CUDA 12 conda environments put it in Library/lib. So on a Windows + CUDA 12 conda setup, pathfinder skipped the conda anchor entirely and fell through to CUDA_PATH, often producing a misleading "not found" error pointing at the wrong location.
  • The fix changes the schema to a tuple of lookup paths (conda_rel_paths: tuple[str, ...]) so each lib can declare every layout it knows about. For cudadevrt:
    • Windows: ("lib/x64", "lib") — try the CUDA 13 layout first, fall back to the CUDA 12 layout.
    • Linux: ("lib",) — unchanged, single entry.
  • _FindStaticLib.try_with_conda_prefix now loops through self.conda_rel_paths and returns the first hit instead of probing one fixed subdirectory.

Test change — test_find_static_lib.py

  • Existing search-order test (test_locate_static_lib_search_order) is updated mechanically: CUDADEVRT_INFO["conda_rel_path"]CUDADEVRT_INFO["conda_rel_paths"][0].
  • New test test_locate_static_lib_conda_rel_path_fallback:
    • Asserts the fallback semantic by injecting a deliberately-missing first entry ("missing-first") when the platform only ships a single path. On Windows, where the tuple already has two entries, it uses them as-is.
    • Drops the file at the second listed path under the conda anchor and verifies locate_static_lib("cudadevrt") finds it with found_via="conda".
    • Real coverage: confirms the loop tries entries in order and a missing first entry doesn't abort the search.

Real (not mock-based) testing was reported here:

Look for cudadevrt under both Library/lib/x64 and Library/lib so CUDA 12 conda environments resolve the real static library instead of falling through to a misleading CUDA_PATH error.

Made-with: Cursor
@rwgk rwgk added this to the cuda.pathfinder next milestone May 4, 2026
@rwgk rwgk self-assigned this May 4, 2026
@rwgk rwgk added bug Something isn't working P0 High priority - Must do! cuda.pathfinder Everything related to the cuda.pathfinder module labels May 4, 2026
@copy-pr-bot
Copy link
Copy Markdown
Contributor

copy-pr-bot Bot commented May 4, 2026

Auto-sync is disabled for draft pull requests in this repository. Workflows must be run manually.

Contributors can view more details about this message here.

@rwgk
Copy link
Copy Markdown
Contributor Author

rwgk commented May 4, 2026

/ok to test

@github-actions
Copy link
Copy Markdown

github-actions Bot commented May 4, 2026

@rwgk rwgk marked this pull request as ready for review May 4, 2026 20:32
@rwgk rwgk requested a review from rparolin May 4, 2026 22:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working cuda.pathfinder Everything related to the cuda.pathfinder module P0 High priority - Must do!

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant