Skip to content

[cuda.pathfinder] Add support for finding CUDA binary utilities#1528

Merged
cpcloud merged 7 commits intoNVIDIA:mainfrom
rparolin:rparolin/pathfinder_find_binary_utils
Feb 4, 2026
Merged

[cuda.pathfinder] Add support for finding CUDA binary utilities#1528
cpcloud merged 7 commits intoNVIDIA:mainfrom
rparolin:rparolin/pathfinder_find_binary_utils

Conversation

@rparolin
Copy link
Collaborator

@rparolin rparolin commented Jan 23, 2026

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

@copy-pr-bot
Copy link
Contributor

copy-pr-bot bot commented Jan 23, 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.

@rparolin
Copy link
Collaborator Author

/ok to test

1 similar comment
@rparolin
Copy link
Collaborator Author

/ok to test

@github-actions

This comment has been minimized.

@rparolin rparolin changed the title initial commit [cuda.pathfinder] Add support for finding CUDA binary utilities (#762) Jan 23, 2026
@rparolin rparolin changed the title [cuda.pathfinder] Add support for finding CUDA binary utilities (#762) [cuda.pathfinder] Add support for finding CUDA binary utilities Jan 23, 2026
@rparolin
Copy link
Collaborator Author

/ok to test

@rparolin rparolin requested review from leofang and rwgk January 24, 2026 00:55
@rparolin rparolin marked this pull request as ready for review January 24, 2026 00:56
@copy-pr-bot
Copy link
Contributor

copy-pr-bot bot commented Jan 24, 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.

@cpcloud
Copy link
Contributor

cpcloud commented Feb 2, 2026

Why can't we use existing standard library functionality (shutil.which, it works on Windows too) for this?

import shutil
import os

shutil.which(name_of_binary, path=os.pathsep.join(list_of_paths_in_order_of_preference))

@cpcloud
Copy link
Contributor

cpcloud commented Feb 2, 2026

/ok to test

@cpcloud cpcloud force-pushed the rparolin/pathfinder_find_binary_utils branch 5 times, most recently from 53f1700 to 0566749 Compare February 2, 2026 18:53
@cpcloud
Copy link
Contributor

cpcloud commented Feb 2, 2026

/ok to test

@cpcloud cpcloud force-pushed the rparolin/pathfinder_find_binary_utils branch from 3065269 to 39ad4e2 Compare February 2, 2026 19:00
@cpcloud
Copy link
Contributor

cpcloud commented Feb 2, 2026

/ok to test

2 similar comments
@cpcloud
Copy link
Contributor

cpcloud commented Feb 2, 2026

/ok to test

@cpcloud
Copy link
Contributor

cpcloud commented Feb 2, 2026

/ok to test

@cpcloud cpcloud force-pushed the rparolin/pathfinder_find_binary_utils branch from cef62bf to aa6cece Compare February 3, 2026 13:24
@cpcloud
Copy link
Contributor

cpcloud commented Feb 3, 2026

/ok to test

@cpcloud cpcloud force-pushed the rparolin/pathfinder_find_binary_utils branch from aa6cece to d292d3f Compare February 3, 2026 13:28
@cpcloud
Copy link
Contributor

cpcloud commented Feb 3, 2026

/ok to test

@cpcloud cpcloud force-pushed the rparolin/pathfinder_find_binary_utils branch from d292d3f to b5e0e46 Compare February 3, 2026 13:49
@cpcloud
Copy link
Contributor

cpcloud commented Feb 3, 2026

/ok to test

1 similar comment
@cpcloud
Copy link
Contributor

cpcloud commented Feb 3, 2026

/ok to test

@cpcloud
Copy link
Contributor

cpcloud commented Feb 3, 2026

/ok to test

2 similar comments
@cpcloud
Copy link
Contributor

cpcloud commented Feb 3, 2026

/ok to test

@cpcloud
Copy link
Contributor

cpcloud commented Feb 3, 2026

/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"))
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

just the latter


SUPPORTED_BINARIES_ALL = SUPPORTED_BINARIES = tuple(SITE_PACKAGES_BINDIRS.keys())

del CUDA_NVCC_BIN, NSIGHT_SYSTEMS_BIN, NSIGHT_COMPUTE_BIN, os
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

@cpcloud cpcloud force-pushed the rparolin/pathfinder_find_binary_utils branch from ba0d075 to 68b470f Compare February 4, 2026 14:34
@cpcloud
Copy link
Contributor

cpcloud commented Feb 4, 2026

/ok to test

Copy link
Collaborator

@rwgk rwgk left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Awesome, thanks!

@cpcloud cpcloud merged commit bf42476 into NVIDIA:main Feb 4, 2026
86 checks passed
@github-actions
Copy link

github-actions bot commented Feb 4, 2026

Doc Preview CI
Preview removed because the pull request was closed or merged.

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]: Support for finding binary utilities like nvdisasm

4 participants