Fix CUDA crash in GTO compute_rho when gradients not needed#78
Merged
Conversation
Add missing `if (need_grad)` guards before two val1g/val2g zero-initialization loops in the single-precision GTO `compute_rho()`. When called without density gradients (drho=NULL, e.g. HF), these arrays are NULL, causing CUDA_ERROR_ILLEGAL_ADDRESS on the GPU. Matches the pattern already used in the double-precision `compute_rhodg()`. Fixes ZimmermanGroup/ZEST#62 Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Member
Author
|
@Vaibhav-Chemistry most of the context is in the linked Zest issue Samantha posted, but does this make sense / seem like the right way to address it to you? |
Member
Author
|
Discussed this with Paul in person and he gave the go-ahead to merge. |
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.
Summary
if (need_grad)guards before twoval1g/val2gzero-initialization loops in the single-precision GTOcompute_rho(bool, ...)drho=NULL, e.g. for HF), these arrays are NULL, causingCUDA_ERROR_ILLEGAL_ADDRESSon the GPUcompute_rhodg()Test plan
pixi run test-gaussianin ZEST (local path dependency pointing to unfixed SlaterGPU main)integrated total density: 4.00000006(no crash)Related to ZimmermanGroup/ZEST#62 (issue will be closed from the ZEST side once the updated SlaterGPU version is pulled in)
🤖 Generated with Claude Code