[FEA]: Explore pathfinder "scoped search" feature
@rwgk y travaille déjà.
Depuis le 26/9/2025.
Évaluation
Cette issue n'a pas encore été évaluée.
Description
Problem to solve
The searches implemented in load_nvidia_dynamic_lib() and find_nvidia_header_directory() are completely independent from each other. For example, load_nvidia_dynamic_lib("nvrtc") might resolve to a site-packages path, while load_nvidia_dynamic_lib("nvJitLink") finds a Conda path, and find_nvidia_header_directory("nvvm") locates headers under /usr/local/cuda. This can lead to surprising inconsistencies and confusing behavior deep in the call stack.
Potential approach (with low maintenance as a goal in mind)
Core idea: Introduce the concept of a pivot library that defines the scope for all subsequent searches.
Here, package system means, for example:
/usr/local/cuda(or another "standard" CTK installation)- Conda (including pixi)
- site-packages (wheels, PyPI)
How it would work in practice:
-
A client code author decides which library is most pivotal and loads it first.
-
search_scope = cuda.pathfinder.determine_search_scope(pivot_libname="nvrtc")— Loads the pivot library and returns it in a wrapper object. -
loaded_dl = search_scope.load_nvidia_dynamic_lib("nvJitLink")— Only succeeds if the target library exists in the same package system, otherwise fails with a helpful error. -
hdr_dir = search_scope.find_nvidia_header_directory("nvvm")— Similarly constrained to the same package system.
This design shifts responsibility for consistency to package managers, which already provide version alignment via pinning. We avoid duplicating those mechanisms and instead ensure our tooling surfaces clear, consistent results.
- Langage dominant
- Cython
- Étoiles
- 3.4k
- Forks
- 329
- Merge moyen
- 1 j 21 h
- PR mergées (30 j)
- 113
Guide de contribution
Ouvrir le guide de contribution
Par où commencer
- Lisez l'issue en entier, puis le guide de contribution du projet.
- Signalez en commentaire que vous la prenez — cela évite que deux personnes fassent le même travail.
- Forkez le dépôt et travaillez sur une branche.
- Ouvrez une pull request qui référence le numéro de l'issue.
Autres issues de NVIDIA/cuda-python
-
bug cuda.core
Difficulté 2/5 1-3 heures Accessibilité débutants 76/100
NVIDIA/cuda-python#2886 · 1 commentaire ·
-
triage
Difficulté 1/5 Moins d'une heure Accessibilité débutants 88/100
NVIDIA/cuda-python#2717 ·
-
triage
Difficulté 1/5 1-3 heures Accessibilité débutants 90/100
NVIDIA/cuda-python#2712 ·
-
[BUG]: LocatedHeaderDir is mutable, so callers can poison the cached header-directory lookup Ouvertetriage
Difficulté 2/5 1-3 heures Accessibilité débutants 82/100
NVIDIA/cuda-python#2646 · 1 réaction ·
-
cuda.core triage
Difficulté 2/5 1-3 heures Accessibilité débutants 62/100
NVIDIA/cuda-python#2435 · 1 commentaire ·