nvcc: accept the --diag-error/--diag-suppress/--diag-warn family - #2816
Open
Kataglyphis wants to merge 2 commits into
Open
nvcc: accept the --diag-error/--diag-suppress/--diag-warn family#2816Kataglyphis wants to merge 2 commits into
Kataglyphis wants to merge 2 commits into
Conversation
nvcc's diagnostic-control options take an error-number list and accept the
SEPARATED form (--diag-suppress 1394,1388). None of the family was in the
argument table, so the separated value parsed as a bare token, was taken
for a second input file, and the whole compile was rejected as
CannotCache(multiple input files). Measured on OpenCV 5.0.0 with CUDA:
every one of its 155 .cu compiles carries exactly this flag pair (via
-Xcudafe --display_error_number --diag-suppress 1394,1388) and was
forwarded uncached; with the entries added the same command is cached.
Adds double- and single-dash forms, CanBeSeparated('='), PassThrough, plus
a regression test for the separated shape.
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #2816 +/- ##
==========================================
+ Coverage 73.64% 73.65% +0.01%
==========================================
Files 72 72
Lines 37814 37831 +17
==========================================
+ Hits 27849 27866 +17
Misses 9965 9965 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
Kataglyphis
marked this pull request as ready for review
August 19, 2026 13:00
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.
While trying to get OpenCV's CUDA build cached on Windows I noticed that none of its .cu files ever got cache hits. The server log shows every single compile being rejected with:
OpenCV passes
-Xcudafe --display_error_number --diag-suppress 1394,1388on every CUDA file. The problem:--diag-suppress(and its siblings--diag-error/--diag-warn) are missing from the nvcc argument table. nvcc accepts the value either attached (--diag-suppress=1394,1388) or as a separate argument, and CMake/OpenCV happen to emit the separated form - so sccache parses1394,1388as a bare token, takes it for a second input file and refuses the compile.Easy to reproduce with any single nvcc compile: add
--diag-suppress 1394,1388and the request is forwarded uncached (requests executed 0in the stats), switch to--diag-suppress=1394,1388and the same compile caches fine.This adds the three flags in both their single- and double-dash forms (
CanBeSeparated,PassThrough) plus a regression test for the separated form. With the patch applied, OpenCV's CUDA compiles (155 files in our build) all cache. Same kind of table gap #2708 filled for--dependency-output.Possibly related: #2726 hits the same
multiple input filesrejection, but from the MSVC-side parsing of nvcc's host sub-compile - I reproduced it on current main and verified this PR does not change it.