GPU memory not getting free using cudaMalloc3DArray

南笙酒味 提交于 2020-07-09 05:21:36

问题


I am using C++, GTX1070

I am allocating a cuda array as described:

//variables: Vdepth = 200, Vheight = 100, Vwidth = 100, device = 0 VolumeId = 0
cudaExtent volumeSize = make_cudaExtent(Vdepth, Vheight, Vwidth);
cudaArray *d_volumeArray = NULL;
cudaChannelFormatDesc channelDesc = cudaCreateChannelDesc<texture_type>();
VERIFY_CALL( cudaMalloc3DArray(&d_volumeArray, &channelDesc, volumeSize) );
cu_VolArray[device][VolumeId] = d_volumeArray;

Then I try to free it like this:

    VERIFY_CALL(cudaFreeArray(cu_VolArray[device][VolumeId]));
    cu_VolArray[device][VolumeId] = NULL;

using GPUz, allocating will increase GPU memory by 100MB and free will decrease by 10MB - how to clear the extened memory?

this whole code is run through mex in MATLAB (2012a). these "stuck" memory blocks are causing my MATLAB to get stuck (stuck at 'busy') when trying to clear mex_name

来源:https://stackoverflow.com/questions/55438352/gpu-memory-not-getting-free-using-cudamalloc3darray

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!