Skip to content

Commit 3e0d883

Browse files
cpcloudleofang
andauthored
chore: add pixi for cuda-core and cuda-bindings (#1226)
Co-authored-by: Leo Fang <[email protected]>
1 parent a87f937 commit 3e0d883

File tree

11 files changed

+10300
-20
lines changed

11 files changed

+10300
-20
lines changed

.gitattributes

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,3 +7,5 @@ cuda/_version.py export-subst
77
*.hpp binary
88
# git should not convert line endings in PNG files
99
*.png binary
10+
# SCM syntax highlighting & preventing 3-way merges
11+
pixi.lock merge=binary linguist-language=YAML linguist-generated=true

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -182,3 +182,6 @@ cython_debug/
182182

183183
# Dont ignore
184184
!.github/actions/build/
185+
# pixi environments
186+
.pixi/*
187+
!.pixi/config.toml

.pre-commit-config.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ repos:
2929
language: python
3030
additional_dependencies:
3131
- https://files.pythonhosted.org/packages/cc/20/ff623b09d963f88bfde16306a54e12ee5ea43e9b597108672ff3a408aad6/pathspec-0.12.1-py3-none-any.whl
32+
exclude: '.*pixi\.lock'
3233

3334
- id: no-markdown-in-docs-source
3435
name: Prevent markdown files in docs/source directories

cuda_bindings/benchmarks/pytest.ini

Lines changed: 0 additions & 6 deletions
This file was deleted.

cuda_bindings/pixi.lock

Lines changed: 6141 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

cuda_bindings/pixi.toml

Lines changed: 130 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,130 @@
1+
# SPDX-FileCopyrightText: Copyright (c) 2025 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
2+
#
3+
# SPDX-License-Identifier: Apache-2.0
4+
5+
[workspace]
6+
channels = ["conda-forge"]
7+
platforms = ["linux-64", "linux-aarch64", "win-64"]
8+
preview = ["pixi-build"]
9+
10+
[workspace.build-variants]
11+
python = ["3.10.*", "3.11.*", "3.12.*", "3.13.*", "3.14.*"]
12+
13+
[dependencies]
14+
cuda-bindings = { path = "." }
15+
pip = "*" # installed to the workspace for convenience
16+
17+
[feature.test.dependencies]
18+
pytest = ">=6.2.4"
19+
pytest-benchmark = ">=3.4.1"
20+
pyglet = ">=2.1.9"
21+
numpy = "*"
22+
23+
[feature.cython-tests.dependencies]
24+
cython = "*" # for tests that exercise APIs from cython
25+
setuptools = "*" # for distutils
26+
gxx = "*" # to compile the generated code
27+
# These are necessary because running the Cython tests requires compiling
28+
# *after* the package is built, and the Cython tests depend on CUDA headers
29+
# transitively (through cuda-bindings)
30+
cuda-cudart-dev = "*"
31+
cuda-profiler-api = "*"
32+
33+
[feature.cython-tests.target.linux-64.dependencies]
34+
cuda-crt-dev_linux-64 = "*"
35+
36+
[feature.cython-tests.target.linux-aarch64.dependencies]
37+
cuda-crt-dev_linux-aarch64 = "*"
38+
39+
[feature.cython-tests.target.win-64.dependencies]
40+
cuda-crt-dev_win-64 = "*"
41+
42+
# For finding headers when building the Cython tests
43+
[feature.cython-tests.target.linux-64.activation.env]
44+
CUDA_HOME = "$CONDA_PREFIX/targets/x86_64-linux"
45+
46+
[feature.cython-tests.target.linux-aarch64.activation.env]
47+
CUDA_HOME = "$CONDA_PREFIX/targets/sbsa-linux"
48+
49+
[feature.cython-tests.target.win-64.activation.env]
50+
CUDA_HOME = '%CONDA_PREFIX%\Library'
51+
52+
[feature.cu13.system-requirements]
53+
cuda = "13"
54+
55+
[feature.cu13.dependencies]
56+
# TODO: make cuda-version a build-variant
57+
cuda-version = "13.*"
58+
59+
[environments]
60+
cu13 = { features = ["cu13", "test", "cython-tests"], solve-group = "cu13" }
61+
62+
# TODO: check if these can be extracted from pyproject.toml
63+
[package]
64+
name = "cuda-bindings"
65+
version = "13.0.2"
66+
67+
[package.build]
68+
backend = { name = "pixi-build-python", version = "*" }
69+
70+
[package.build.config]
71+
env = { CUDA_PYTHON_PARSER_CACHING = "1", CUDA_PYTHON_PARALLEL_LEVEL = "$(nproc)" }
72+
noarch = false
73+
compilers = ["c", "cxx"]
74+
75+
[package.build.target.linux-64.config.env]
76+
CUDA_HOME = "$PREFIX/targets/x86_64-linux"
77+
78+
[package.build.target.linux-aarch64.config.env]
79+
CUDA_HOME = "$PREFIX/targets/sbsa-linux"
80+
81+
[package.build.target.win-64.config.env]
82+
CUDA_HOME = '%PREFIX%\Library'
83+
84+
# TODO: revisit this
85+
# [package.build-dependencies]
86+
# ccache = "*"
87+
88+
[package.host-dependencies]
89+
python = "*"
90+
pip = "*"
91+
setuptools = ">=77"
92+
cython = ">=3.1,<3.2"
93+
pyclibrary = ">=0.1.7"
94+
cuda-cudart-static = "*"
95+
cuda-nvrtc-dev = "*"
96+
cuda-profiler-api = "*"
97+
cuda-nvvm = "*"
98+
99+
[package.target.linux-64.host-dependencies]
100+
cuda-crt-dev_linux-64 = "*"
101+
libcufile-dev = "*"
102+
103+
[package.target.linux-aarch64.host-dependencies]
104+
cuda-crt-dev_linux-aarch64 = "*"
105+
libcufile-dev = "*"
106+
107+
[package.target.win-64.host-dependencies]
108+
cuda-crt-dev_win-64 = "*"
109+
110+
[package.run-dependencies]
111+
python = "*"
112+
cuda-pathfinder = ">=1.1,<2"
113+
cuda-bindings = { path = "." }
114+
libnvjitlink = "*"
115+
cuda-nvrtc = "*"
116+
cuda-nvvm = "*"
117+
118+
[package.target.linux.run-dependencies]
119+
libcufile = "*"
120+
121+
[target.linux.tasks.build-cython-tests]
122+
cmd = ["$PIXI_PROJECT_ROOT/tests/cython/build_tests.sh"]
123+
124+
[target.linux.tasks.run-cython-tests]
125+
cmd = ["pytest", "$PIXI_PROJECT_ROOT/tests/cython/"]
126+
depends-on = [{ task = "build-cython-tests" }]
127+
128+
[target.linux.tasks.test]
129+
cmd = ["pytest", "$PIXI_PROJECT_ROOT"]
130+
depends-on = [{ task = "run-cython-tests" }]

cuda_bindings/pyproject.toml

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,9 @@ build-backend = "setuptools.build_meta"
77
[project]
88
name = "cuda-bindings"
99
description = "Python bindings for CUDA"
10-
authors = [{name = "NVIDIA Corporation", email = "[email protected]"},]
10+
authors = [
11+
{ name = "NVIDIA Corporation", email = "[email protected]" },
12+
]
1113
license = "LicenseRef-NVIDIA-SOFTWARE-LICENSE"
1214
requires-python = ">=3.10"
1315
classifiers = [
@@ -22,13 +24,8 @@ classifiers = [
2224
"Programming Language :: Python :: 3.14",
2325
"Environment :: GPU :: NVIDIA CUDA",
2426
]
25-
dynamic = [
26-
"version",
27-
"readme",
28-
]
29-
dependencies = [
30-
"cuda-pathfinder ~=1.1",
31-
]
27+
dynamic = ["version", "readme"]
28+
dependencies = ["cuda-pathfinder ~=1.1"]
3229

3330
[project.optional-dependencies]
3431
all = [
@@ -43,7 +40,7 @@ test = [
4340
"numpy>=1.21.1",
4441
"pytest>=6.2.4",
4542
"pytest-benchmark>=3.4.1",
46-
"pyglet>=2.1.9"
43+
"pyglet>=2.1.9",
4744
]
4845

4946
[project.urls]
@@ -69,3 +66,8 @@ archs = "native"
6966
archs = "AMD64"
7067
before-build = "pip install delvewheel"
7168
repair-wheel-command = "delvewheel repair --namespace-pkg cuda -w {dest_dir} {wheel}"
69+
70+
[tool.pytest.ini_options]
71+
required_plugins = "pytest-benchmark"
72+
addopts = "--benchmark-disable"
73+
norecursedirs = ["tests/cython", "examples"]

cuda_bindings/tests/pytest.ini

Lines changed: 0 additions & 5 deletions
This file was deleted.

0 commit comments

Comments
 (0)