cuda.pathfinder.find_nvidia_header_directory#
- cuda.pathfinder.find_nvidia_header_directory(libname: str) str | None#
Locate the header directory for a supported NVIDIA library.
- Parameters:
libname (str) – The short name of the library whose headers are needed (e.g.,
"nvrtc","cusolver","nvshmem").- Returns:
Absolute path to the discovered header directory, or
Noneif the headers cannot be found.- Return type:
str or None
- Raises:
RuntimeError – If
libnameis not in the supported set.
- Search order:
NVIDIA Python wheels
Scan installed distributions (
site-packages) for header layouts shipped in NVIDIA wheels (e.g.,cuda-toolkit[nvrtc]).
Conda environments
Check Conda-style installation prefixes, which use platform-specific include directory layouts.
CUDA Toolkit environment variables
Use
CUDA_HOMEorCUDA_PATH(in that order).
Notes
The
SUPPORTED_HEADERS_CTKdictionary maps each supported CUDA Toolkit (CTK) library to the name of its canonical header (e.g.,"cublas" → "cublas.h"). This is used to verify that the located directory is valid.The only supported non-CTK library at present is
nvshmem.