RTKConsortium / RTK

Reconstruction Toolkit
Apache License 2.0
241 stars 142 forks source link

reconstruction by cuda occur problem: ITK ERROR: CUDA ERROR: out of memory #587

Closed Ming100 closed 4 months ago

Ming100 commented 4 months ago

My projection data size is about 5.03GB, and my GPU is GeForce RTX 4090 where the memory is about 24GB. But when I run my code(like FirstCudaReconstruction.py) to reconstruction, there appear the error:

Traceback (most recent call last):
  File "C:\Users\zhangming\Desktop\reconstructionSoft\preProcess\cudaReconstruction.py", line 144, in <module>
    GPUrec(newImg, 0.1, 183.61, 686.68, 360, -4.38, -0.18, 752, 752, 624, 0, 360)
  File "C:\Users\zhangming\Desktop\reconstructionSoft\preProcess\cudaReconstruction.py", line 107, in GPUrec
    vtk_img = itk.vtk_image_from_image(fieldofview.GetOutput())
  File "D:\anaconda\envs\CTr\lib\site-packages\itk\support\extras.py", line 689, in vtk_image_from_image
    array = itk.array_view_from_image(l_image)
  File "D:\anaconda\envs\CTr\lib\site-packages\itk\support\extras.py", line 356, in GetArrayViewFromImage
    return _GetArrayFromImage(
  File "D:\anaconda\envs\CTr\lib\site-packages\itk\support\extras.py", line 317, in _GetArrayFromImage
    return templatedFunction(img, keep_axes, update)
  File "D:\anaconda\envs\CTr\lib\site-packages\itk\itkPyBufferPython.py", line 3806, in GetArrayViewFromImage
    source.UpdateLargestPossibleRegion()
RuntimeError: C:\runner\_work\im\src\rtkCudaFFTProjectionsConvolutionImageFilter.cu:83:
ITK ERROR: CUDA ERROR: out of memory

I checked the code execution process and during this period, the GPU's memory was still very sufficient.

SimonRit commented 4 months ago

Please use the mailing list and share your code and information on the projection data (number of pixels, pixel type) and the reconstructed volume and we'll explain.