Results 1 to 3 of 3

Thread: Can enqueueNDRangeKernel leak memory even without events?

  1. #1
    Junior Member
    Join Date
    Feb 2013
    Posts
    2

    Can enqueueNDRangeKernel leak memory even without events?

    Hi,

    I have posted this https://devtalk.nvidia.com/default/t...calls-is-huge/ on nvidia forum but I still could not find a solution. I am facing a memory leak in OpenCL that only happens when I call the kernel a large number of times, around 10^8 times. I am aware that memory leaks are expected when events are used and not released, but can this happens when not using them? My code is a little big but I can post parts of it here if it helps. I am using the c++ wrapper and calling the kernel this way

    Code :
    a.global_size = {p.N_first_reduction};
    a.local_size = {p.local_size};
    p.queue.enqueueNDRangeKernel(p.E_int, a.kernel_offset, a.global_size, a.local_size);

    As I sad on nvidia forum I tried

    Code :
    a.global_size = {p.N_first_reduction};
    a.local_size = {p.local_size};
    p.queue.enqueueNDRangeKernel(p.E_int, a.kernel_offset, a.global_size, a.local_size, NULL, NULL);

    But nothing has changed. Is there a way to find what is goig wrong?

    Thanks in advance

  2. #2
    Senior Member
    Join Date
    Dec 2011
    Posts
    124

    Re: Can enqueueNDRangeKernel leak memory even without events

    I found issues with older drivers where they leaked small amounts of memory that could accumulate over very large numbers of kernel calls. Try to figure out about how many bytes per kernel you are losing (by dividing the leak size by the kernel count after running many kernels). Then try changing aspects of how you are calling the kernel to see if you can get the number to change. See if it is the same or different between vendors (e.g., AMD and NVIDIA).

  3. #3
    Junior Member
    Join Date
    Feb 2013
    Posts
    2

    Re: Can enqueueNDRangeKernel leak memory even without events

    Hi,

    I will look into that but I don't know if such calculation will be possible... As far as top can tell the used memory remains the same almost the whole time(around 2 hours)... When suddenly it explodes. In a few seconds it goes from 70 mb to around 4 gb and then the executable is killed by the kernel...

    Unfortunately I do not have an AMD card to perform tests... I will see if I can test the code on the processor, but it could take days to get to the same point running on it...

Similar Threads

  1. WebGL Memory Leak
    By Achilles4689 in forum WebGL - General
    Replies: 1
    Last Post: 08-25-2011, 11:02 PM
  2. memory leak on Pocket PC
    By Alaric in forum OpenGL ES general technical discussions
    Replies: 0
    Last Post: 11-02-2005, 04:50 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •