Skip to content

Conversation

@han0110
Copy link
Collaborator

@han0110 han0110 commented Feb 10, 2026

  • Rename env CUDA_ARCH to CUDA_ARCHS to accept comma-separated numeric part of CUDA compute capabilites e.g. CUDA_ARCHS=89,120, if the zkVM supports multiple CUDA compute capabilites it'll be forwarded (Airbender, OpenVM, Risc0), if not the largest will be used (ZisK)
  • Update dockerfiles to use the env var that the zkVM recognizes, and translate CUDA_ARCHS to that when building image
  • Update CI
    • For each PR, it additionally tests building CUDA enabled images using CUDA_ARCHS=89,120 (L40S, RTX 40 series, RTX 50 series), this works fine for most zkVMs but takes a bit long for Risc0 (~1hr), but it'd be cached in future PR if the dockerfile is untouched.
    • For push to master it builds and pushs images with git sha tag (without and with CUDA enabled if supported), also builds and pushs cluster image if supported. After build and push succeeds, the test zkVM workflow will be triggered to run same test as PR but using the published images.
    • For push to tag, it add the semver tag on the git sha tag for all images pushed.

@han0110 han0110 force-pushed the han/feature/cuda-enabled-docker-image branch from 27715ca to c5cb7ee Compare February 10, 2026 13:01
@han0110 han0110 force-pushed the han/feature/cuda-enabled-docker-image branch from c934a73 to c4fcd31 Compare February 11, 2026 01:50
@han0110 han0110 force-pushed the han/feature/cuda-enabled-docker-image branch from c4fcd31 to 39cd4e2 Compare February 11, 2026 05:28
@han0110 han0110 marked this pull request as ready for review February 11, 2026 12:00
@han0110 han0110 requested a review from jsign February 11, 2026 14:06
Copy link
Collaborator

@jsign jsign left a comment

Choose a reason for hiding this comment

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

LGMT, left some comments for your consideration


pub use error::Error;

/// Applies per-zkVM CUDA architecture build args to a Docker build command.
Copy link
Collaborator

Choose a reason for hiding this comment

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

Maybe obvious question to understand the intention of the PR: if a machine signals support for 89 and 120, why would they care about 89 and not always select the highest? (as Zisk does apparently)
I was thinking of multi-GPU machines with different kinds of GPUs, but that would mean Zisk would work there.

Comment on lines +62 to +64
.map(|arch| format!("--generate-code arch=compute_{arch},code=sm_{arch} "))
.collect::<String>();
cmd.build_arg("NVCC_APPEND_FLAGS", flags.trim_end())
Copy link
Collaborator

Choose a reason for hiding this comment

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

I think we could avoid the trailing space with trim_end(), by collecting to String and then join(" "). But NBD.

.split(',')
.filter_map(|s| s.parse::<u32>().ok())
.max()
.unwrap_or(120);
Copy link
Collaborator

Choose a reason for hiding this comment

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

Should we have this default in some constant and applied to the other zkVMs too? Or mabye there is a reason for this exception in Zisk? (or maybe error, since we might have non-empty expectation from the other method that parses ENV or detect GPU capabilities?)


# Per-zkVM CUDA architecture translation
if [ "$CUDA" = true ] && [ -n "$CUDA_ARCHS" ]; then
case "$ZKVM" in
Copy link
Collaborator

Choose a reason for hiding this comment

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

Should SP1 be here?

--registry ${{ needs.image_meta.outputs.registry }} \
--tag ${{ needs.image_meta.outputs.sha_tag }}-cuda \
--base \
--cuda-archs '89,120'
Copy link
Collaborator

Choose a reason for hiding this comment

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

We have these 89,120 in some places in this files, worth defining a const/env?

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