Skip to content

[cmake] Skip unrequested CUDA compiler detection - #23903

Open
jmcarcell wants to merge 1 commit into
root-project:masterfrom
jmcarcell:cmake-skip-unrequested-cuda-detection
Open

jmcarcell wants to merge 1 commit into
root-project:masterfrom
jmcarcell:cmake-skip-unrequested-cuda-detection

Conversation

@jmcarcell

@jmcarcell jmcarcell commented Oct 30, 2026 •

Copy link
Copy Markdown
Contributor

This Pull request:

Avoids CUDA compiler discovery and language initialization when no CUDA features are requested.

Changes or fixes:

ROOT currently calls check_language(CUDA) on every configure, even when cuda and tmva-gpu are disabled. The probe starts a separate CMake configuration and accesses compiler and toolkit files. Looking for CUDA can therefore be an expensive operation in slow I/O environments and on NFS-backed filesystems, adding avoidable configuration time.

Only probe when cuda or tmva-gpu is explicitly enabled, or when all could enable an unspecified CUDA option. Preserve explicit OFF settings and the defaults selected by gminimal.

Add 13 regression cases covering default and explicit settings, cached compiler information, all, minimal configurations, and unavailable CUDA. Compiler discovery is mocked so these tests do not require a CUDA installation.

AI assistance: Codex (GPT-6) reviewed the change, ran validation, and prepared the commit and PR description.

Checklist:

  • tested changes locally
  • updated the docs (if necessary)

No documentation changes are needed. No associated issue.

@jmcarcell
jmcarcell requested a review from bellenot as a code owner October 30, 2026 07:33
CUDA compiler discovery starts a separate CMake configuration even when
neither CUDA feature is requested. This can add substantial overhead on
slow I/O and NFS-backed filesystems.

Only discover CUDA for explicit requests or when all needs availability
information to select defaults. Preserve explicit OFF settings and
gminimal defaults, and cover these combinations with regression tests.

Assisted-by: Codex:GPT-6
@dpiparo

dpiparo commented Oct 30, 2026

Copy link
Copy Markdown
Member

@guitargeek btw, with the plan of externalising SOFIE, do we still need the tmva-gpu option?

@guitargeek

Copy link
Copy Markdown
Contributor

The tmva-cpu and tmva-gpu options are for the TMVA deep learning methods that were written ~10 years ago to compete with the Python ML libraries, before the strategy was changed to not compete but embrace. This functionality is unrelated to SOFIE, and currently not deprecated. However, I think it would be good to have a conversation on the future of that functionality soon, in this development cycle!

@github-actions

Copy link
Copy Markdown

Test Results

    24 files      24 suites   3d 22h 57m 24s ⏱️
 3 895 tests  3 895 ✅ 0 💤 0 ❌
83 925 runs  83 925 ✅ 0 💤 0 ❌

Results for commit 5c67c72.

@dpiparo

dpiparo commented Oct 31, 2026

Copy link
Copy Markdown
Member

Thanks. Agreed then!

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.

4 participants