Skip to content

[FEA]: Pathfinder: get include directory for where nvcc is hosted #954

@capybara-club

Description

@capybara-club

Is this a duplicate?

Area

cuda.pathfinder

Is your feature request related to a problem? Please describe.

My library uses cuda-python to compile custom cute kernels. I have a user that is reporting that my current get_include_dir_cuda() fails for him for some reason. I saw pathfinder is just now being worked on and I was wondering what I could use for now that would be robust to different user setups. My current code is:

def get_include_dir_cuda() -> Path:
    """Best-effort guess of the Toolkit’s <cuda>/include directory."""
    import os, shutil
    if os.getenv("CUDA_HOME"):
        return Path(os.environ["CUDA_HOME"]) / "include"
    # fall back to the directory that owns nvcc (works for most local installs)
    nvcc = shutil.which("nvcc")
    if nvcc:
        return Path(nvcc).parent.parent / "include"
    raise RuntimeError("Cannot find CUDA include directory")

I there anything I can replace this with that should work better? Will I eventually just replace this with a pathfinder function call?

Describe the solution you'd like

Something robust that will handoff finding cuda headers to Nvidia's package. The internals of cute/cutlass require a few of these headers.

Describe alternatives you've considered

No response

Additional context

Thanks!

Metadata

Metadata

Assignees

Labels

cuda.pathfinderEverything related to the cuda.pathfinder moduletriageNeeds the team's attention

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions