Skip to content

Conversation

@dzzz2001
Copy link
Collaborator

Description

Fix a GPU memory leak in Forces<double, base_device::DEVICE_GPU>::deriv_drhoc_scc function.

Changes

  • Added delmem_var_op() call to properly free GPU memory (aux_d, gx_arr_d, drhocg_d) inside the GPU-specific conditional block.

Issue

The GPU memory (aux_d, gx_arr_d, drhocg_d) was allocated inside an if (this->device == base_device::GpuDevice) block but never freed, causing memory leaks.

Testing

Verified using compute-sanitizer that the memory leak is resolved.

@mohanchen mohanchen added Bugs Bugs that only solvable with sufficient knowledge of DFT Refactor Refactor ABACUS codes GPU & DCU & HPC GPU and DCU and HPC related any issues labels Dec 28, 2025
@mohanchen mohanchen merged commit 7769708 into deepmodeling:develop Dec 28, 2025
14 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Bugs Bugs that only solvable with sufficient knowledge of DFT GPU & DCU & HPC GPU and DCU and HPC related any issues Refactor Refactor ABACUS codes

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants