Is there a limit in the available GPU memory in mex files using cuda code?

I've write a code to perform 3d linear interpolation in the GPU using the texture feature. The code runs correctly for images of about 128x128x120, but for images of greater size the mex function returns an image filled with zeros, and no error message appears. I allocate GPU memory using cudaMalloc(), in total 9 times the size of the initial image size. So for an image of 128x128x121 the total amount of memory I would allocate in the GPU (float elements) is 128*128*121*9*4 ~ 72MB which is way below the memory size of my GPU (2GB). So I was wondering if Matlab limits somehow the amount of memory I can use ina mex function using CUDA. Otherwise I would like to know if you could help me in finding the error. Thanks

댓글 수: 1

The error is already solved. I changed the size of one of my thread blocks from 32 to 64 and now bigger image sizes are correctly handled. However I don't understand what is the problem since, using a block size of 32, my grid size is way below the limit of the grid size (2^31-1).

댓글을 달려면 로그인하십시오.

답변 (0개)

카테고리

도움말 센터File Exchange에서 GPU Computing에 대해 자세히 알아보기

태그

질문:

2018년 5월 30일

댓글:

2018년 5월 31일

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by