Conversation
for testing vision3d across torch / torchvision versions
- flake.nix declares only inputs, imports and systems - nix/cuda.nix holds the CUDA toolkit options and the torch builds they pair with - nix/devshells.nix holds the per-variant dev shells and the wheel shell - nix/cuda-home.nix builds the joined toolkit prefix with callPackage, renamed cuda-merged after the nixpkgs derivations that build the same symlinkJoin
- Pair each torch release with the CUDA build PyPI publishes for it, moving 2.11 and 2.13 to cudaPackages_13_0 and dropping the cu132 lane. The three PyTorch wheel indexes and `index-strategy` go with them, and the lock now carries a hash for every wheel it names. - Build the dev environments from `uv.lock` with uv2nix, one editable virtual environment per variant. There is no `.venv`, no `uv sync`, and no `UV_NO_GROUP`: entering a shell selects the variant. - Put the GPU driver on the library path in the dev shells, after https://github.com/NVlabs/cutile-rs, so torch finds `libcuda.so.1` on distributions that keep it outside the store. - Run the CPU suite of every variant, pyrefly, clang-tidy, and the git hooks as flake checks. Each test check's output is that variant's HTML coverage report. - Name the GCC and libc headers clang-tidy analyses against, rather than letting clang scan the machine for a toolchain it may not find. - Move what `just tidy` and `just compile-db` run into `scripts/`, so the checks of those names run the same thing. - Build the release sdist and wheel as the `dist` package, against torch 2.10, CUDA 12.8, and the manylinux_2_28 toolchain. `nix build --rebuild` reproduces them byte for byte. - Keep the store out of the wheel: the wrapped linker no longer writes an rpath or the toolchain's loader into the extension, `auditwheel repair` strips the debug info naming the build machine, and `scripts/check-wheel.sh` fails the build if a run path survives. - Drive CI with `nix build` and `nix flake check` instead of dev shells, which retires the uv cache. The docs job stays a shell, since the gallery downloads the dataset samples it renders. - Drop the instructions for developing without nix, and name the release pair rather than describing it.
- Build the release artifacts with `nix build` in the `build` job, which no longer enters a shell and so has no `just`. - Realise the source the manylinux toolchain imports before checking the flake. Evaluating the release artifacts pulls in a pinned nixpkgs through import-from-derivation, which `--no-build` refuses to fetch. - Ignore the `typing_extensions.ReadOnly` cross-reference in the docs. It reaches the annotations on Python 3.12, and its own inventory documents it as data rather than a class, so nitpicky mode has nothing to resolve.
…nments on python 3.14
yeetypete
force-pushed
the
feat/torch-cuda-matrix
branch
from
August 16, 2026 23:29
9ca070f to
f75fe41
Compare
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
NOTE: This PR is a PoC of using Nix in
vision3dand may not be merged.To test using the vision3d flake first install nix (can be done on any system): https://nixos.org/download/
What
uv.lockwith uv2nix instead ofuv syncdoing it at runtime. The test suite, pyrefly, clang-tidy, the git hooks and the release artifacts become flake outputs. In CI we can just runnix build .#checks.x86_64-linux.<name>.Why Nix
Building this project needs a CUDA toolkit, a host gcc its nvcc accepts, clang 22 for clang-tidy, and a torch built against that same toolkit. Installing these dependencies can be tricky and until now was only documented in the vision3d README. CI had to use containers (slow) to guarantee the right versions.
Reasons to move to a flake:
vision3dcan be more easily tested across different CUDA toolkit versions on a single host.nix build .#distproduces the sdist and the wheel on any host.Testing
Experience with Nix
The Good:
The Bad:
/usr/lib, and each one needs its own workaround to function outside of that.uvalready provides a pretty good development environment in most cases.vision3dalso uses the torch stable ABI which erases some of the benefits of needing multiple different build variants with different CUDA toolkits (they are mostly just for runtime testing).uv2nix.uvinstall the environment itself is simpler, but then it is resolved at runtime and outside the store, so the reproducibility and the Cachix speedup mostly go away. The dev environment likely won't work on NixOS in that case because the wheelsuvinstalls are prebuilt binaries linked against an FHS layout. Here we have to patch them withautoPatchelfHookto make them work.