Skip to content

Make cuda-bindings buildable against CTK wheels? #692

Open

Description

@leofang

The meaning of the title is that pip install . from source can work without a local CTK environment (no need to set CUDA_PATH and all that). Everything is purely pip-wheel based.

This is actually doable, I just don't believe there is a serious use case because we really want users to not build from source, nor do I want to spend my time on enabling it, but I can be convinced. Anyway it's worth writing this up somewhere in the public.

The whole thing relies on the fact that building bindings just need a host compiler; no NVCC is needed. The steps is as follows:

  • We list needed CTK wheels in the [build-system.requires] session. They will provide the needed headers.
  • Since setuptools does not provide a way for us to programmatically query the path to the isolated build environment at build time, we search the potential paths based on the assumption that sys.path must be updated for setuptools to find the build env.
  • We pass <build env path> to setuptools so that the CUDA headers can be found by gcc/msvc.

I enabled this for nvmath-python and it did worked like a charm, but the situation was a lot simpler than driver/runtime modules that we have here.

Activity

  1. added
    triageNeeds the team's attention
    packagingAnything related to wheels or Conda packages
    cuda.bindingsEverything related to the cuda.bindings module
    on Jun 7, 2025
  2. kkraus14 commented on Jun 7, 2025

    @kkraus14
    Collaborator

    Sounds like a job for path_finder if we split it off from cuda.bindings 😆

  3. leofang commented on Jun 7, 2025

    @leofang
    MemberAuthor

    Oh, so you meant if we install path_finder in the isolated build env, it knows the self location and can infer other build dependencies from this knowledge without guessing. Interesting!

  4. removed this from the cuda.bindings backlog milestone on Apr 2, 2026
  5. rparolin commented on Jun 11, 2026

    @rparolin
    Collaborator

    I'm going to close this issue due to inactivity. If we want to ultimately do this work please re-open the ticket.

  6. moved this from Todo to Done in CCCLon Jun 11, 2026
  7. leofang commented on Aug 28, 2026

    @leofang
    MemberAuthor

    Took me a while to find this. Let's not close this. Keith and I discussed last week and we actually want this to happen.

  8. leofang commented on Aug 28, 2026

    @leofang
    MemberAuthor

    Closely related: #2060

  9. added
    P1Medium priority - Should do
    on Aug 28, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    P1Medium priority - Should docuda.bindingsEverything related to the cuda.bindings modulepackagingAnything related to wheels or Conda packages

    Type

    No type

    Projects

    • Status
      Done

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions