Fix and modernize the dormant GPU/cuSolver build#1416
Open
Prasanna163 wants to merge 1 commit into
Open
Conversation
foxtran
reviewed
Jun 24, 2026
The optional GPU code path (WITH_GPU / cuSolver) had bit-rotted and could not be configured or compiled. This restores it without affecting the default CPU build: - src/mctc/lapack/eigensolve.F90: fix the invalid local `real(dp) :: dummy(:)` declaration used for the cuSolver bufferSize query (-> `dummy(1)`), which is not valid Fortran and broke the USE_CUSOLVER build. - meson/meson.build: modernize deprecated NVIDIA flags for current nvfortran -- `-ta=tesla:ccNN` -> `-gpu=ccNN -acc`, `-Mcudalib` -> `-cudalib`. - CMakeLists.txt: add the WITH_GPU / GPU_ARCH / WITH_CUSOLVER options (CMake had no GPU support at all), mirroring meson; Fortran-scoped flags; define XTB_GPU / USE_CUSOLVER / USE_CUBLAS. The default CPU build is unchanged (all GPU bits are guarded). Signed-off-by: Prasanna163 <prasannakulkarni163@gmail.com>
b919624 to
ff3a37f
Compare
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.
What
The optional GPU code path (
WITH_GPU/ cuSolver, originally added in 2020) hadbit-rotted and no longer configures or compiles. This PR restores the build
plumbing without touching the default CPU build — all GPU bits stay guarded.
Changes
src/mctc/lapack/eigensolve.F90— fix an invalid local declarationreal(dp) :: dummy(:)used for the cuSolverbufferSizequery (a localassumed-shape array without
allocatable/dummy status is not valid Fortran andbroke the
USE_CUSOLVERbuild). Replaced withdummy(1), a valid placeholderfor a size-only query.
meson/meson.build— modernize deprecated NVIDIA HPC SDK flags for currentnvfortran:-ta=tesla:ccNN→-gpu=ccNN -acc,-Mcudalib→-cudalib.CMakeLists.txt— addWITH_GPU/GPU_ARCH/WITH_CUSOLVERoptions(CMake had no GPU support at all), mirroring the meson logic; Fortran-scoped
flags; defines
XTB_GPU/USE_CUSOLVER/USE_CUBLAS.Testing
every change is behind the (off-by-default) GPU options.
RTX 3050:
cusolverDnDsygvdvs LAPACKdsygvdagree to ~1e-14 eV on realGFN0 H/S matrices.