Skip to content

Delegate all path discovery in cuda_paths.py to pathfinder#810

Open
cpcloud wants to merge 3 commits intoNVIDIA:mainfrom
cpcloud:refactor/delegate-cuda-paths-to-pathfinder
Open

Delegate all path discovery in cuda_paths.py to pathfinder#810
cpcloud wants to merge 3 commits intoNVIDIA:mainfrom
cpcloud:refactor/delegate-cuda-paths-to-pathfinder

Conversation

@cpcloud
Copy link
Contributor

@cpcloud cpcloud commented Feb 26, 2026

Summary

  • Delegate all path discovery in cuda_paths.py to cuda.pathfinder, removing ~360 lines of bespoke conda/wheel/CUDA_HOME/system search logic
  • Use pathfinder.locate_bitcode_lib("device") for libdevice and pathfinder.locate_static_lib("cudadevrt") for cudadevrt, replacing the cudalib_dir / static_cudalib_dir indirection layer
  • Simplify libs.py to a thin wrapper over get_cuda_paths() with no directory-scanning fallback

Requires cuda-pathfinder >= 1.4.0 for locate_bitcode_lib and locate_static_lib (NVIDIA/cuda-python#1690).

Closes NVIDIA/cuda-python#1036

xref NVIDIA/cuda-python#716

Replace the manual search-priority infrastructure (conda, wheel,
CUDA_HOME, system) with direct calls to cuda.pathfinder APIs:

- libdevice: pathfinder.locate_bitcode_lib("device")
- cudadevrt: pathfinder.locate_static_lib("cudadevrt")
- nvrtc/nvvm: pathfinder.load_nvidia_dynamic_lib (unchanged)
- include_dir: pathfinder.locate_nvidia_header_directory (unchanged)

Remove ~360 lines of bespoke path-scanning code including
get_system_ctk, get_conda_ctk_libdir, get_cuda_home, wheel
introspection helpers, and the cudalib_dir/static_cudalib_dir
indirection layer.

Requires cuda-pathfinder >= 1.4.0 (locate_bitcode_lib,
locate_static_lib).

Closes NVIDIA/cuda-python#1036

Made-with: Cursor
@greptile-apps
Copy link
Contributor

greptile-apps bot commented Feb 26, 2026

Automatic reviews are disabled for this repository.

@copy-pr-bot
Copy link

copy-pr-bot bot commented Feb 26, 2026

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

Contributors can view more details about this message here.

Required for locate_bitcode_lib and locate_static_lib APIs
used by the refactored cuda_paths.py.

Made-with: Cursor
Made-with: Cursor
@cpcloud
Copy link
Contributor Author

cpcloud commented Feb 26, 2026

Perhaps this should be in draft mode until the next release of cuda-pathfiner, since this PR requires being able to find libcudadevrt.a.

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.

[FEA]: Make pathfinder usable as a full replacement for cuda_paths.py in numba-cuda

1 participant