Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
25 commits
Select commit Hold shift + click to select a range
bf052a7
chore: exclude pixi.lock from license checks as well as whitespace cl…
cpcloud Oct 2, 2025
3fbabda
chore: add pixi gitattributes and gitignore modifications
cpcloud Oct 2, 2025
88fa7c6
chore: rename groups and consolidate
cpcloud Oct 2, 2025
aeb6e0e
chore: add pixi setup to cuda_pathfinder
cpcloud Oct 2, 2025
1022634
chore: update pixi lock
cpcloud Oct 2, 2025
d8ac193
chore: make pixi task script robust to invocation directory
cpcloud Oct 6, 2025
89117b5
chore: remove nvidia channel
cpcloud Oct 6, 2025
548c4dc
chore: fix up GHA and toolshed to use dependency groups
cpcloud Oct 6, 2025
0bd64b8
ci: move to using ext groups
cpcloud Oct 7, 2025
40cffd9
chore: ignore pixi envs recursively
cpcloud Oct 7, 2025
b42eeef
chore: update pixi lockfile
cpcloud Oct 7, 2025
ec8d79c
chore: cudss to non-ext group
cpcloud Oct 7, 2025
0e132de
Simplify `pip install` command to require just one of `--group test-c…
rwgk Oct 7, 2025
eadbeee
Merge branch 'main' into cpcloud→pixi
rwgk Oct 9, 2025
27d9963
Change naming of [dependency-groups] and provide hooks for pixi, so t…
rwgk Oct 9, 2025
03b3e63
pixi.lock snapshot
rwgk Oct 9, 2025
369142e
Systematic pixi environments: cu12-linux-64, cu12-linux-aarch64, cu12…
rwgk Oct 9, 2025
88a3a62
Move "cuda-toolkit[nvvm]==13.*" into cu13-common, it works there, too…
rwgk Oct 9, 2025
9ac1364
Make pixi run -e cu13-linux-64 -- pytest -v tests/ work for real.
rwgk Oct 9, 2025
fa384e3
Avoid use of cuda-toolkit meta-package also in cu12-common, similar t…
rwgk Oct 9, 2025
2715310
Also avoid use of cuda-toolkit[...] meta-package in cu12-linux and cu…
rwgk Oct 9, 2025
893c5b8
Remove CUDA_HOME from pixi section; it is not needed because all CUDA…
rwgk Oct 9, 2025
c3c2720
Merge branch 'main' into cpcloud→pixi
rwgk Oct 9, 2025
7dd4a7d
fully-qualified: "$CONDA_PREFIX/bin/pytest
rwgk Oct 9, 2025
052d20c
Change `[tool.pixi.feature.test.tasks]` back to plain `"pytest"` (`$C…
rwgk Oct 10, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,5 @@ cuda/_version.py export-subst
*.hpp binary
# git should not convert line endings in PNG files
*.png binary
# SCM syntax highlighting & preventing 3-way merges
pixi.lock merge=binary linguist-language=YAML linguist-generated=true
2 changes: 1 addition & 1 deletion .github/workflows/test-wheel-linux.yml
Original file line number Diff line number Diff line change
Expand Up @@ -283,7 +283,7 @@ jobs:
run: |
set -euo pipefail
pushd cuda_pathfinder
pip install --only-binary=:all: -v . --group "test_nvidia_wheels_cu${TEST_CUDA_MAJOR}" --group test_nvidia_wheels_host
pip install --only-binary=:all: -v . --group "test-cu${TEST_CUDA_MAJOR}"
pip list
popd

Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/test-wheel-windows.yml
Original file line number Diff line number Diff line change
Expand Up @@ -256,7 +256,7 @@ jobs:
shell: bash --noprofile --norc -xeuo pipefail {0}
run: |
pushd cuda_pathfinder
pip install --only-binary=:all: -v . --group "test_nvidia_wheels_cu${TEST_CUDA_MAJOR}" --group test_nvidia_wheels_host
pip install --only-binary=:all: -v . --group "test-cu${TEST_CUDA_MAJOR}"
pip list
popd

Expand Down
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -182,3 +182,7 @@ cython_debug/

# Dont ignore
!.github/actions/build/
# pixi environments
.pixi/
!.pixi/config.toml
.gdb_history
3 changes: 2 additions & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ repos:
- repo: local
hooks:
- id: check-spdx
exclude: 'pixi\.lock$'
name: Check SPDX Headers
entry: python ./toolshed/check_spdx.py
language: python
Expand Down Expand Up @@ -52,7 +53,7 @@ repos:
- id: check-yaml
- id: debug-statements
- id: end-of-file-fixer
exclude: &gen_exclude '^(?:cuda_bindings/cuda/bindings/.*\.in?|cuda_bindings/docs/source/module/.*\.rst?)$'
exclude: &gen_exclude '^(?:cuda_bindings/cuda/bindings/.*\.in?|cuda_bindings/docs/source/module/.*\.rst?|pixi\.lock)$'
- id: mixed-line-ending
- id: trailing-whitespace
exclude: *gen_exclude
Expand Down
2,097 changes: 2,097 additions & 0 deletions cuda_pathfinder/pixi.lock

Large diffs are not rendered by default.

100 changes: 87 additions & 13 deletions cuda_pathfinder/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -11,31 +11,78 @@ dynamic = ["version", "readme"]
dependencies = []

[dependency-groups]
test = [
"pytest>=6.2.4",
]
test_nvidia_wheels_cu12 = [
"cuda-toolkit[nvcc,cublas,nvrtc,cudart,cufft,curand,cusolver,cusparse,npp,nvfatbin,nvjitlink,nvjpeg,cccl]==12.*",
"cuda-toolkit[cufile]==12.*; sys_platform != 'win32'",
"nvidia-cublasmp-cu12; sys_platform != 'win32'",
# Internal organization of test dependencies.
# Note that pixi does not currently support PEP 508 environment markers,
# therefore we are forced to break out subgroups by markers.
test = ["pytest>=6.2.4"]
cu12-common = [
# Cannot use "cuda-toolkit[...]==12.* here, it confuses pixi (observed with pixi 0.56.0)
"nvidia-cublas-cu12",
"nvidia-cuda-cccl-cu12",
"nvidia-cuda-nvcc-cu12",
"nvidia-cuda-nvrtc-cu12",
"nvidia-cuda-runtime-cu12",
"nvidia-cufft-cu12",
"nvidia-curand-cu12",
"nvidia-cusolver-cu12",
"nvidia-cusparse-cu12",
"nvidia-npp-cu12",
"nvidia-nvfatbin-cu12",
"nvidia-nvjitlink-cu12",
"nvidia-nvjpeg-cu12",
"nvidia-cudss-cu12",
"nvidia-cufftmp-cu12; sys_platform != 'win32'",
"nvidia-libmathdx-cu12",
Comment on lines +20 to 34
Copy link
Collaborator

Choose a reason for hiding this comment

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

This has the potential to now end up with different minor versions of these libraries whereas using cuda-toolkit[...]=12.* would guaranteed that the minor version of cuda-toolkit that was resolved would control the minor versions of all of the libraries.

Copy link
Collaborator

Choose a reason for hiding this comment

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

Ooof ... this is a tough one.

pixi just doesn't work with the cuda-toolkit meta-package.

Telling exactly what works and what doesn't is tricky, to a significant degree because I observed many times that the pixi behavior isn't fully deterministic, even after pixi clean && rm -f pixi.lock. I'm sure cu13-linux-64 never passed testing before commit 9ac1364, even though I tried repeatedly from scratch (some subtests passed, but not all, because some libraries were missing). The cu12-* environments worked on some platforms with the cuda-toolkit meta-package, but not all. I didn't try everything repeatedly from scratch, there is a small possibility that all cu12-* environments work with the meta-package when trying repeatedly, but it surely isn't stable.

Even with this PR as-is (i.e. no use of the meta-package at all), occasionally I have to combine pixi clean and running commands repeatedly until it works again.

Copy link
Collaborator

Choose a reason for hiding this comment

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

I forgot to add:

This has the potential to now end up with different minor versions of these libraries

I don't think this will ever matter for the purpose of test_load_nvidia_dynamic_libs.py.

I'm not saying it's a good situation, but I think there is very little to no tangible reward for making it perfect.

]
cu12-linux = [
"nvidia-cufile-cu12; sys_platform != 'win32'",
"nvidia-cufftmp-cu12; sys_platform != 'win32'",
"nvidia-nccl-cu12; sys_platform != 'win32'",
"nvidia-nvshmem-cu12; sys_platform != 'win32'",
"nvidia-cublasmp-cu12; sys_platform != 'win32'",
]
test_nvidia_wheels_cu13 = [
"cuda-toolkit[nvcc,cublas,nvrtc,cudart,cufft,curand,cusolver,cusparse,npp,nvfatbin,nvjitlink,nvjpeg,cccl,nvvm]==13.*",
"cuda-toolkit[cufile]==13.*; sys_platform != 'win32'",
"nvidia-cublasmp-cu13; sys_platform != 'win32'",
cu13-common = [
# Cannot use "cuda-toolkit[...]==13.* here, it confuses pixi (observed with pixi 0.56.0)
"nvidia-cublas",
"nvidia-cuda-cccl",
"nvidia-cuda-crt",
"nvidia-cuda-nvcc",
"nvidia-cuda-nvrtc",
"nvidia-cuda-runtime",
"nvidia-cufft",
"nvidia-curand",
"nvidia-cusolver",
"nvidia-cusparse",
"nvidia-npp",
"nvidia-nvfatbin",
"nvidia-nvjitlink",
"nvidia-nvjpeg",
"nvidia-nvvm",
"nvidia-cudss-cu13",
]
cu13-linux = [
"nvidia-cufile; sys_platform != 'win32'",
"nvidia-cublasmp-cu13; sys_platform != 'win32'",
"nvidia-nccl-cu13; sys_platform != 'win32'",
"nvidia-nvshmem-cu13; sys_platform != 'win32'",
]
test_nvidia_wheels_host = [
host-linux-aarch64 = [
"nvpl-fft; platform_system == 'Linux' and platform_machine == 'aarch64'",
]

# User-facing dependencies, e.g. pip install --group test-cu13
test-cu12 = [
{ include-group = "test" },
{ include-group = "cu12-common" },
{ include-group = "cu12-linux" },
{ include-group = "host-linux-aarch64" },
]
test-cu13 = [
{ include-group = "test" },
{ include-group = "cu13-common" },
{ include-group = "cu13-linux" },
{ include-group = "host-linux-aarch64" },
]

[project.urls]
Repository = "https://github.com/NVIDIA/cuda-python"
Documentation = "https://nvidia.github.io/cuda-python/"
Expand Down Expand Up @@ -124,3 +171,30 @@ disallow_untyped_defs = true
module = "tests.*"
disallow_untyped_defs = false
ignore_errors = true

[tool.pixi.workspace]
channels = ["conda-forge"]
platforms = ["linux-64", "linux-aarch64", "win-64"]

[tool.pixi.pypi-dependencies]
cuda-pathfinder = { path = ".", editable = true }

[tool.pixi.environments]
cu12-linux-64 = { features = ["test", "cu12-common", "cu12-linux"], solve-group = "cu12-linux-64" }
cu13-linux-64 = { features = ["test", "cu13-common", "cu13-linux"], solve-group = "cu13-linux-64" }
cu12-linux-aarch64 = { features = ["test", "cu12-common", "cu12-linux", "host-linux-aarch64"], solve-group = "cu12-linux-aarch64" }
cu13-linux-aarch64 = { features = ["test", "cu13-common", "cu13-linux", "host-linux-aarch64"], solve-group = "cu13-linux-aarch64" }
cu12-win-64 = { features = ["test", "cu12-common"], solve-group = "cu12-win-64" }
cu13-win-64 = { features = ["test", "cu13-common"], solve-group = "cu13-win-64" }

[tool.pixi.feature.cu12-linux]
platforms = ["linux-64", "linux-aarch64"]

[tool.pixi.feature.cu13-linux]
platforms = ["linux-64", "linux-aarch64"]

[tool.pixi.feature.host-linux-aarch64]
platforms = ["linux-aarch64"]

[tool.pixi.feature.test.tasks]
test = { cmd = ["pytest", "$PIXI_PROJECT_ROOT/tests"] }
4 changes: 2 additions & 2 deletions toolshed/collect_site_packages_dll_files.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -23,11 +23,11 @@ function Fresh-Venv {
Set-Location -Path 'cuda_pathfinder'

Fresh-Venv -Path '..\TmpCp12Venv'
pip install --only-binary=:all: -e '.[test,test_nvidia_wheels_cu12,test_nvidia_wheels_host]'
pip install --only-binary=:all: -e . --group test-cu12
deactivate

Fresh-Venv -Path '..\TmpCp13Venv'
pip install --only-binary=:all: -e '.[test,test_nvidia_wheels_cu13,test_nvidia_wheels_host]'
pip install --only-binary=:all: -e . --group test-cu13
deactivate

Set-Location -Path '..'
Expand Down
4 changes: 2 additions & 2 deletions toolshed/collect_site_packages_so_files.sh
Original file line number Diff line number Diff line change
Expand Up @@ -17,12 +17,12 @@ fresh_venv() {
cd cuda_pathfinder/
fresh_venv ../TmpCp12Venv
set -x
pip install --only-binary=:all: -e . --group test --group test_nvidia_wheels_cu12 --group test_nvidia_wheels_host
pip install --only-binary=:all: -e . --group test-cu12
set +x
deactivate
fresh_venv ../TmpCp13Venv
set -x
pip install --only-binary=:all: -e . --group test --group test_nvidia_wheels_cu13 --group test_nvidia_wheels_host
pip install --only-binary=:all: -e . --group test-cu13
set +x
deactivate
cd ..
Expand Down