[cuda.pathfinder] Add support for finding CUDA binary utilities#1528
[cuda.pathfinder] Add support for finding CUDA binary utilities#1528cpcloud merged 7 commits intoNVIDIA:mainfrom
Conversation
|
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. |
|
/ok to test |
1 similar comment
|
/ok to test |
This comment has been minimized.
This comment has been minimized.
|
/ok to test |
|
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. |
|
Why can't we use existing standard library functionality ( import shutil
import os
shutil.which(name_of_binary, path=os.pathsep.join(list_of_paths_in_order_of_preference)) |
|
/ok to test |
53f1700 to
0566749
Compare
|
/ok to test |
3065269 to
39ad4e2
Compare
|
/ok to test |
2 similar comments
|
/ok to test |
|
/ok to test |
cef62bf to
aa6cece
Compare
|
/ok to test |
aa6cece to
d292d3f
Compare
|
/ok to test |
d292d3f to
b5e0e46
Compare
|
/ok to test |
1 similar comment
|
/ok to test |
|
/ok to test |
2 similar comments
|
/ok to test |
|
/ok to test |
| # 2. Search in Conda environment | ||
| if (conda_prefix := os.environ.get("CONDA_PREFIX")) is not None: | ||
| if IS_WINDOWS: | ||
| dirs.append(os.path.join(conda_prefix, "Library", "bin")) |
There was a problem hiding this comment.
Is there an else: (and indentation for the append "bin") missing here? (Maybe a copy-paste mishap, because below it's correct without the else?)
Or is the docstring above inconsistent with the implementation here?
There was a problem hiding this comment.
Docstring might be out of date, this was the original implementation that @rparolin had.
Happy to adjust. Should windows search bin as well as Library/bin or just the latter?
|
|
||
| SUPPORTED_BINARIES_ALL = SUPPORTED_BINARIES = tuple(SITE_PACKAGES_BINDIRS.keys()) | ||
|
|
||
| del CUDA_NVCC_BIN, NSIGHT_SYSTEMS_BIN, NSIGHT_COMPUTE_BIN, os |
There was a problem hiding this comment.
This is very likely to get out of sync over time, b/o oversights. If you want to "hide" these symbols, prefixing with an underscore will make that more clear and self-maintaining. Another trick would be to introduce a helper function, but I think underscores will be just fine.
I seems very unusual to remove stdlib symbols (os), especially because this is not even a public module.
There was a problem hiding this comment.
Not sure I follow the bit about removing stdlib symbols, it's no different from removing any other symbol you don't want to expose.
In any event I will adjust this to just use underscores.
ba0d075 to
68b470f
Compare
|
/ok to test |
|
Summary
Adds a new API to locate CUDA binary utilities (e.g., nvdisasm, cuobjdump, nvcc) following the same search strategy as the existing library and header finders.
Motivation
Numba-CUDA and other projects need to locate CUDA binary utilities like nvdisasm for disassembly and debugging. This change enables using cuda.pathfinder for all CUDA resource discovery, providing a consistent interface across libraries, headers, and binaries.
Closes #762