Skip to content

fix(cargo-oxide): take the scaffold's host crates from cuda-host's git source - #1488

Open
alejandro-soto-franco wants to merge 1 commit into
NVIDIA:mainfrom
alejandro-soto-franco:fix/scaffold-single-cuda-core
Open

alejandro-soto-franco wants to merge 1 commit into
NVIDIA:mainfrom
alejandro-soto-franco:fix/scaffold-single-cuda-core

Conversation

@alejandro-soto-franco

Copy link
Copy Markdown
Contributor

A project from cargo oxide new does not compile on main. The template takes cuda-device and cuda-host from git, then cuda-core = "0.4.0" (and with --async, cuda-async = "0.4.0") from crates.io. Since #1466, cuda-host depends on cuda-core by path at tip of tree. The git checkout supplies its own cuda-core and the lockfile has two:

name = "cuda-core"  source = "registry+https://github.com/rust-lang/crates.io-index"
name = "cuda-core"  source = "git+https://github.com/NVIDIA/cuda-rust.git#91a0066…"

The #[cuda_module] expansion then fails to type-check: 7 errors in the sync template and 13 in the async one, all of this form:

error[E0308]: mismatched types
 5 | #[cuda_module]
   | expected `cuda_core::simt::context::CudaContext`, found `CudaContext`

check-shared-crate-pin.sh already names this failure for the example workspaces ("a crates.io copy there would resolve a second cuda_core and break type unification with path cuda-host"), and its section 3 required the scaffold to keep the crates.io pin.

  • The templates take cuda-core and cuda-async from GIT_REPO, the source cuda-host comes from. SHARED_HOST_CRATES_VERSION goes away.
  • check-shared-crate-pin.sh section 3 requires every host-crate line in the templates to use GIT_REPO. Reintroducing cuda-core = "0.4.0" fails it.
  • New test scaffold_takes_every_cuda_crate_from_one_git_source asserts every cuda-* line in both templates names the same git source as cuda-device.

This touches the scaffold constant that #1466 planned to derive from the root manifests under #1459. Taking the host crates from git removes the constant and with it the scaffold's need for that step.

Test: cargo test -p cargo-oxide (244 passed), clippy -D warnings, check-shared-crate-pin.sh passes and rejects the old pin. cargo oxide new then cargo oxide run, for both the sync and --async templates, on an RTX 5060 Laptop (sm_120, CUDA 13.3): PASSED: all 1024 elements correct, one cuda-core in each lockfile.

…t source

`cargo oxide new` named cuda-core (and, with --async, cuda-async) from
crates.io at 0.4.0 next to a git cuda-host. cuda-host depends on those crates
by path at tip of tree. The lockfile therefore carried two cuda-core packages
and the expansion of #[cuda_module] failed to type-check: 7 errors in the
sync template, 13 in the async one, all CudaContext/CudaModule mismatches.

The templates now take cuda-core and cuda-async from GIT_REPO, the source
cuda-host already comes from, and SHARED_HOST_CRATES_VERSION goes away.
check-shared-crate-pin.sh section 3 now requires every host-crate line in
the templates to use GIT_REPO and rejects a crates.io requirement there. A
new test asserts the same invariant over both templates.

Signed-off-by: Alejandro Soto Franco <sotofranco.eng@gmail.com>
@copy-pr-bot

copy-pr-bot Bot commented Oct 11, 2026

Copy link
Copy Markdown

This pull request requires additional validation before any workflows can run on NVIDIA's runners.

Pull request vetters can view their responsibilities here.

Contributors can view more details about this message here.

This branch has not been deployed

No deployments
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.

1 participant