OpenCL* for CPU
Ask questions and share information on Intel® SDK for OpenCL™ Applications and OpenCL™ implementations for Intel® CPU.
Announcements
This forum covers OpenCL* for CPU only. OpenCL* for GPU questions can be asked in the GPU Compute Software forum. Intel® FPGA SDK for OpenCL™ questions can be ask in the FPGA Intel® High Level Design forum.
1718 Discussions

Memory issue with HD4000 GPU

Mohamed_Amine_BERGAC
264 Views

I have a memory issue with the HD4000 GPU: I use a simple kernel that performs 2 simple operations, I run it over hundred of times (in a host  loop), before each call I release all device and host buffers like this:

ret = clReleaseMemObject(bufin1_mem_obj);
ret = clReleaseMemObject(bufin2_mem_obj);
ret = clReleaseMemObject(bufout1_mem_obj);
ret = clReleaseMemObject(bufout2_mem_obj);
ret = clReleaseMemObject(debugbuf_mem_obj);
ret = clReleaseKernel(kernel);
ret = clReleaseProgram(program);
ret = clReleaseEvent(ev);
ret = clFlush(command_queue);
ret = clFinish(command_queue);
ret = clReleaseCommandQueue(command_queue);
ret = clReleaseContext(context);

free(bufin1);
free(bufin2);
free(buf_out_1);
free(buf_out_2);
free(debug_buf);
free(perfs);
free(times);
free(logTitle);
free(logline);

the problem is, when I use the same code with an AMD GPU, I have no memory problem, but when I run it on the HD4000, I have a memory leakage after 22 kernel calls, it seems that the GPU doesn't freed memory.

is it a known issue ?

THX,

Mohamed

0 Kudos
1 Reply
Mohamed_Amine_BERGAC
264 Views

Sorry, I finally found what's went wrong with my program:

I'm using events to profile the exucution time of the kernel (in a loop) and I release the event object just one time=>a memory leakage occurs, to avoid this issue I must release the event object each time I call  clEnqueueNDRangeKernel(...........,ev);

thx,

Mohamed

0 Kudos
Reply