Skip to content

Conversation

cpcloud
Copy link
Contributor

@cpcloud cpcloud commented Oct 8, 2025

This PR adds a pixi environment for cuda-bindings

Copy link
Contributor

copy-pr-bot bot commented Oct 8, 2025

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 cpcloud force-pushed the pixi-for-cuda-bindings branch 2 times, most recently from dc5b784 to 0583683 Compare October 8, 2025 20:05
Copy link
Collaborator

@kkraus14 kkraus14 left a comment

Choose a reason for hiding this comment

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

Requesting changes to ensure we don't merge before 0.4.0 release again 😆

cu13 = { features = ["all", "test"], solve-group = "cu13" }

[tool.pixi.build-dependencies]
cuda-toolkit = ">=13,<14"
Copy link
Collaborator

Choose a reason for hiding this comment

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

This pulls in a bunch of stuff we don't want. Can you reference the libraries in the all optional dependency group?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I can't reference them in any sort automatic way, but does it matter since this is build-dependencies?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

The other thing is that including cuda-toolkit appears to set CUDA_HOME at build time, which I need to build cuda-bindings as part of environment activation.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

If there's a way to do that without including the kitchen sink, that'd be great!

Copy link
Collaborator

Choose a reason for hiding this comment

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

It matters for at least the cuda runtime library since we statically link that in

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Ah, ok. Then I'll have to figure out what's happening with CUDA_HOME and how that magically works with cuda-toolkit.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Ok, I figured out the minimum set to build.

@cpcloud cpcloud force-pushed the pixi-for-cuda-bindings branch from 0583683 to 39c8ff6 Compare October 8, 2025 20:23
cuda-bindings = { path = ".", editable = true }

[tool.pixi.environments]
cu13 = { features = ["all", "test"], solve-group = "cu13" }
Copy link
Collaborator

Choose a reason for hiding this comment

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

Does the all feature end up grabbing wheels or does it map to the proper conda packages as defined in build-dependencies below?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

All of the pyproject.toml integration maps to pypi-dependencies: https://pixi.sh/dev/python/pyproject_toml/#dependency-section

Copy link
Collaborator

Choose a reason for hiding this comment

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

We can do it in a follow up, but we should ideally use https://pixi.sh/dev/reference/pixi_manifest/#conda-pypi-map-optional to map the pip wheels to the relevant conda packages in some kind of environment so we can support both wheel package based and conda package based environments.

cu13 = { features = ["all", "test"], solve-group = "cu13" }

[tool.pixi.build-dependencies]
cuda-cudart-dev = ">=13,<14"
Copy link
Collaborator

Choose a reason for hiding this comment

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

In hindsight I think we need cuda-driver-dev since we look for cuda.h at build time as well

@cpcloud cpcloud force-pushed the pixi-for-cuda-bindings branch 3 times, most recently from a175181 to b6eeebb Compare October 9, 2025 16:17
@cpcloud cpcloud force-pushed the pixi-for-cuda-bindings branch from b6eeebb to df654df Compare October 9, 2025 16:26
[tool.pixi.feature.all.dependencies]
libnvjitlink = "*"

[tool.pixi.build-dependencies]
Copy link
Collaborator

Choose a reason for hiding this comment

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

We need to comprehensively capture these if we're adding conda package dependencies: https://github.com/conda-forge/cuda-python-feedstock/blob/69231e7f5de1c5a1314376f34308f82141f6112e/recipe/meta.yaml#L120-L131

In general we can't mix and match conda and pypi packages where it's kinda an all-or-nothing

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.

2 participants