Skip to content

Fix nvcc dryrun parsing for CUDA 13.3#2722

Open
mbrobbel wants to merge 2 commits into
mozilla:mainfrom
mbrobbel:codex/nvcc-13.3-simt-only
Open

Fix nvcc dryrun parsing for CUDA 13.3#2722
mbrobbel wants to merge 2 commits into
mozilla:mainfrom
mbrobbel:codex/nvcc-13.3-simt-only

Conversation

@mbrobbel
Copy link
Copy Markdown

sccache assumed nvcc-generated cicc and ptxas inputs were always at a fixed offset near the end of the command line. With CUDA 13.3.33, cicc dryrun output can place --simt-only after the input file, which makes the old positional parser treat --simt-only as the input instead of kernel.cpp1.ii.

That can prevent sccache from grouping the cicc and ptxas device compilation steps correctly. Later, fatbinary fails because the expected .cubin files were never produced.

Changes

  • Find cicc inputs by .cpp1.ii extension instead of fixed position.
  • Find ptxas inputs by .ptx extension instead of fixed position.
  • Keep the old positional fallback for unexpected command shapes.
  • Add regression coverage for cicc input before --simt-only.
  • Add regression coverage for ptxas input detection by .ptx.
  • Add nvcc dryrun grouping coverage for CUDA 13.3-style --simt-only.

Comment thread src/compiler/cicc.rs Outdated
let input_loc = match language {
Language::Ptx => arguments
.iter()
.position(|arg| arg.to_string_lossy().ends_with(".cpp1.ii")),
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

is it reasonable to hardcode .cpp1.ii ?

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

I think so:

// If the output file ends with...
// * .cpp1.ii - cicc/ptxas input
// * .cpp4.ii - cudafe++ input
if out_name.ends_with(".cpp1.ii") {

But maybe we should move this into some helpers to make it more obvious?

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

sounds good

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