I met a problem when I copy CUDA memory to physical memory using ‘cudaMemcpy()’.
For instance,
There is float* result;
And the size of it is about 20000.
So if float size is 4bytes, then copied memory size will be 80,000 bytes, right? I don’t think it is big.
However, after I copied memory, the copied values are 0 or some big strange value. But no error message.
If the size of the pointer is about 1000, then there is no problem occurs.
So, I would like to set if the size of copying memory is out of possible memory on the system, errors are shown.
Besides, I would like to know current free memory space at both CUDA and physical memory.
then you should debug your code. I would start with using proper CUDA error checking (just google that, take first hit, apply to your code), and use compute-sanitizer.
cudaMemGetInfo can tell you the cuda situation, programmatically. There are many linux tools that can tell you free space for host code usage.