Determine memory request size and availability?

I’m having some issues getting CUDA FORTRAN code to run. I’ve got it running successfully on a different machine, but when I try and run it on my laptop it fails saying
0: ALLOCATE: 12927522344 bytes requested; not enough memory

That struck me as too high. However I can’t figure out how to check how much memory the version on the other machine (the one that is running successfully) is requesting to compare. So I don’t know where the problem may be. Is there an easy way to determine how much memory is being requested? And similarly how much memory I can actually request successfully. I understand this is a little bit broad of a question, and I apologise.

That struck me as too high

Why exactly? We don’t know what your code is doing and based on what configuration parameters it is sizing GPU memory allocations. In your example output it looks like it wants to allocate 12.5 GB of GPU memory, which may have been entirely reasonable on the system on which it was originally run, but exceeds what the GPU in your laptop can provide.

GPUs with up to 48 GB of onboard memory (Quadro RTX A6000) are available at this time.

That’s fair. I guess I’m assuming that’s a little high since the code doesn’t handle massive arrays, just a few dozen floats. And that strikes me as a lot of space to allocate over what is at most ~50 odd floats and 3 arrays of size 50. That said I’m not an expert on how much the memory footprint of these things are so I couldn’t really tell you for sure, especially since I don’t easily know how to check that amount.

I have no way of knowing what is happening in this code. Maybe show the actual code that makes the GPU allocation and prints the above error message. A self-contained minimal example that reproduces the issue would be best.

I’ll try and produce one. There are a few moving parts though so it may take me until tomorrow though to actually have one up and running. I apologize for that, but I’ll try my best to get one within tonight, your help is greatly appreciated.

Well, I did some looking and I found A.) What’s causing it but more importantly B.) Taking it out shows me that something else more important also isn’t working. So I guess I’ve got to work on that first.

This is often my experience with the advice about creating a minimal reproducer code. Very often you discover yourself what is wrong, and also learn and improve your skills in the process. It’s really a lot better than asking for help on a forum in 90+% of the cases, in my experience.

Well for what it’s worth I still don’t know why writing to file seems to be the cause of the huge memory requirement. But I certainly do now know I’ve got larger problems, so that’s good*

*as good as having non-functional code is anyway