Hello!
I would like to ask if there is a way to manually release cuda memory in RTK. I get “ITK ERROR: CUDA ERROR: out of memony” after running function “Update()” repeatedly. I want to manually release cuda memory that is reconstruction each epoch.
I try following codes but it doesn’t work:
The CudaDataManager will release the Cuda memory as soon as it’s dirty, i.e., if the memory has been transferred to the CPU and might have been modified on the CPU side. One way to do this is to call fdk.GetOutput().GetBufferPointer() (as the data manager will then assume you’re likely to modify the buffer).
But the problem you describe is probably due to a memory leak fixed since v2.6.0 (here) so you should use one of the latest wheels from the CI (downloadable as artifacts from the GitHub action, the latest is here).