cuda.pathfinder.find_nvidia_binary_utility#
- cuda.pathfinder.find_nvidia_binary_utility(utility_name: str) str | None#
Locate a CUDA binary utility executable.
- Parameters:
utility_name (str) – The name of the binary utility to find (e.g.,
"nvdisasm","cuobjdump"). On Windows, the.exeextension will be automatically appended if not present. The function also recognizes.batand.cmdfiles on Windows.- Returns:
Absolute path to the discovered executable, or
Noneif the utility cannot be found. The returned path is normalized (absolute and with resolved separators).- Return type:
str or None
- Raises:
RuntimeError – If
utility_nameis not in the supported set (seeSUPPORTED_BINARY_UTILITIES).
- Search order:
NVIDIA Python wheels
Scan installed distributions (
site-packages) for binary layouts shipped in NVIDIA wheels (e.g.,cuda-nvcc).
Conda environments
Check Conda-style installation prefixes via
CONDA_PREFIXenvironment variable, which use platform-specific bin directory layouts (Library/binon Windows,binon Linux).
CUDA Toolkit environment variables
Use
CUDA_HOMEorCUDA_PATH(in that order), searchingbin/x64,bin/x86_64, andbinsubdirectories on Windows, or justbinon Linux.
Note
Results are cached using
@functools.cachefor performance. The cache persists for the lifetime of the process.On Windows, executables are identified by their file extensions (
.exe,.bat,.cmd). On Unix-like systems, executables are identified by theX_OK(execute) permission bit.Example
>>> from cuda.pathfinder import find_nvidia_binary_utility >>> nvdisasm = find_nvidia_binary_utility("nvdisasm") >>> if nvdisasm: ... print(f"Found nvdisasm at: {nvdisasm}")