Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use the host memory instead of device memory inside VisMF::Write() #3900

Closed
pkufourier opened this issue Apr 20, 2024 · 1 comment
Closed

Comments

@pkufourier
Copy link

Recently I have used AMReX to develop some programs running on GPU with cuda, and the mesh size are given as large as possible (>95% of the GPU memory). Everything goes perfect. However, when the program called the VisMF::Write() function to write checkpoint (in fact it is the AmrCoreAdv::WriteCheckpointFile() copied from the tutorial), the program crashed and said memory out. Obviously the VisMF::Write() function should have allocated additional memory from GPU and caused this problem.

My temporal solution is to use the MultiFab's clear() function to free some MF arrays before calling the WriteCheckpointFile(). After the writing has finished, re-define these MF arrays. However it seems to be somehow a little silly. Is it possible to force the VisMF::Write() use purely the host memory instead of allocating memory from GPU, since host memory is usually much larger? And the copy data to host memory is unavoidable before writing data to hard disk, I think this improvement is worth doing.

@WeiqunZhang
Copy link
Member

VisMF::Write does not allocate additional device memory.

The_Pinned_Arena());

Maybe it's just the memory usage is so close to the maximum that it will run out of memory even if VisMF::Write is not called.

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

No branches or pull requests

2 participants