[Rtk-users] reconstruction by cuda occur problem: ITK ERROR: CUDA ERROR: out of memory

Simon Rit simon.rit at creatis.insa-lyon.fr
Fri Apr 12 16:02:52 CEST 2024


Please stay on the mailing list! I don't answer emails if they are not on
the mailing list.
Let me correct my two mistakes:
- wrong calculation. Your projections are 360*3008*2048 with type uint16
(2B) is 4.2 GB. with type float (what is sent to the GPU), it's 8.4 GB
- projections.GetCudaDataManager().GetGPUBufferPointer() should work, wrong
copy pasting. Doing this transfers the data to the GPU (and you should see
this 8.5 GB increase in GPU memory used)
Simon

On Fri, Apr 12, 2024 at 11:05 AM ...... <1533168486 at qq.com> wrote:

>
> Hi,
> Thank you for your reply. My projections data size is about 5.03GB not
> 16.5GB, and the capcity of my data like below:
>   PixelContainer:
>     ImportImageContainer (0000023CBC7899E0)
>       RTTI typeinfo:   class itk::ImportImageContainer<unsigned
> __int64,unsigned short>
>       Reference Count: 1
>       Modified Time: 4091
>       Debug: Off
>       Object Name:
>       Observers:
>         none
>       Pointer: 0000023CBDC95040
>       Container manages memory: true
>       Size: 2702868480
>       Capacity: 2702868480
> When I run the code
> print(projections.GetOutput().GetCudaDataManager().GetGPUBufferPointer())
> there apear the error: AttributeError: 'itkCudaImageF3' object has no
> attribute 'GetOutput'
> I annotated this line of code to observe the usage of GPU, it seems seems
> that the GPU is not being used very much.
>
>
>
>
> ------------------------------
> ......
> 1533168486 at qq.com
>
> <https://wx.mail.qq.com/home/index?t=readmail_businesscard_midpage&nocheck=true&name=......&icon=http%3A%2F%2Fthirdqq.qlogo.cn%2Fg%3Fb%3Doidb%26k%3DaU2UicjBCZHhOuTg0I8eaAQ%26kti%3DZNG2GAAAAAI%26s%3D640%26t%3D1557079014&mail=1533168486%40qq.com&code=MxmxlJaC2QgJPGkeK0WWGn27E_Hxxdg4z_yHE18lRA4Xk7gMOGcWVLQlSeT63-65rHTBwEDtE8Q5X12n2MGehA>
>
>
>
> ------------------ 原始邮件 ------------------
> *发件人:* "Simon Rit" <simon.rit at creatis.insa-lyon.fr>;
> *发送时间:* 2024年4月12日(星期五) 下午3:26
> *收件人:* "......"<1533168486 at qq.com>;
> *抄送:* "rtk-users"<rtk-users at openrtk.org>;
> *主题:* Re: [Rtk-users] reconstruction by cuda occur problem: ITK ERROR:
> CUDA ERROR: out of memory
>
> Hi,
> Your projections alone are 16.5 GB on the GPU and the volume 2.6 GB before
> doing any calculation. Since your GPU has 24 GB memory, you're flirting
> with the limit, hence the issue I guess. I would suggest to add these lines
> before "# Field-of-view masking":
>   os.system('nvidia-smi')
>   print(projections.GetOutput().GetCudaDataManager().GetGPUBufferPointer())
>   os.system('nvidia-smi')
>   feldkamp.Update()
>   os.system('nvidia-smi')
> You'll most likely not reach the third nvidia-smi but you'll have a better
> understanding of the issue.
> Simon
>
>
> On Fri, Apr 12, 2024 at 8:59 AM ...... <1533168486 at qq.com> wrote:
>
>> Hello all,
>> I tried reconstruction my projection data by cudaFDK, and my data is
>> 360*3008*2048 with type uint16. I set my output volumn size as 752*752*624.
>> When I run my code with GPU(GeForce RTX 4090), there appear the error:
>>
>>
>> I checked the code execution process and during this period, the GPU's
>> memory was still very sufficient. I reduce the size of my data to
>> 360*1504*1024 and other items remain unchanged. This  code can run
>> without error.
>> The attachment is my code. Any help will be appreciated.
>> Sincerely,
>> ------------------------------
>> ......
>> 1533168486 at qq.com
>>
>> <https://wx.mail.qq.com/home/index?t=readmail_businesscard_midpage&nocheck=true&name=......&icon=http%3A%2F%2Fthirdqq.qlogo.cn%2Fg%3Fb%3Doidb%26k%3DaU2UicjBCZHhOuTg0I8eaAQ%26kti%3DZNG2GAAAAAI%26s%3D640%26t%3D1557079014&mail=1533168486%40qq.com&code=MxmxlJaC2QgJPGkeK0WWGn27E_Hxxdg4z_yHE18lRA4Xk7gMOGcWVLQlSeT63-65rHTBwEDtE8Q5X12n2MGehA>
>>
>> _______________________________________________
>> Rtk-users mailing list
>> rtk-users at openrtk.org
>> https://www.creatis.insa-lyon.fr/mailman/listinfo/rtk-users
>>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.creatis.insa-lyon.fr/pipermail/rtk-users/attachments/20240412/45403502/attachment-0001.htm>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D5EF58E6 at 2039F000.E3F71866.jpg
Type: image/jpeg
Size: 75635 bytes
Desc: not available
URL: <http://www.creatis.insa-lyon.fr/pipermail/rtk-users/attachments/20240412/45403502/attachment-0001.jpg>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 62BD5D91 at F92C6D21.E3F71866.PNG
Type: image/png
Size: 39445 bytes
Desc: not available
URL: <http://www.creatis.insa-lyon.fr/pipermail/rtk-users/attachments/20240412/45403502/attachment-0002.png>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D235B839 at F6D3232B.E3F71866.PNG
Type: image/png
Size: 45788 bytes
Desc: not available
URL: <http://www.creatis.insa-lyon.fr/pipermail/rtk-users/attachments/20240412/45403502/attachment-0003.png>


More information about the Rtk-users mailing list