cancel
Showing results for 
Search instead for 
Did you mean: 

Archives Discussions

Atmapuri
Journeyman III

Tracking down memory leaks with Open CL driver

Hi!

Is there some support in the Open CL interface to detect where the memory is leaking? My code verified clean, but I dont see inside the driver. From what I understand only this is being executed:

clEnqueueWriteBuffer

clEnqueueReadBuffer

clEnqueueCopyBuffer

clEnqueueNDRangeKernel


Putting these functions in a tight loop causes a memory leak of about 4GB in 5min. Are there some limits on how many times you can reuse a Kernel, mem buffer or other? How could I figure out where is the memory going?

Thanks!
Atmapuri

0 Likes
4 Replies
bpurnomo
Staff
Staff

Tracking down memory leaks with Open CL driver

Did you release the event object created by the clEnqueueNDRangeKernel call?

You can check OpenCL resource leaks issue easily in your application using the AMD APP Profiler tool.

0 Likes
notzed
Challenger

Tracking down memory leaks with Open CL driver

These methods only use the pointer they're given until they return. If you're allocating memory to pass to them and not managing it yourself, then it will leak.

Otherwise your query doesn't really make sense - i've had real-time video processing run for hours without any leaks.

 

0 Likes
Atmapuri
Journeyman III

Tracking down memory leaks with Open CL driver

Hi!

Ok, that looks like a good idea. (the event). Probably the only object for which there is no explicit clCreate command and is created by the library.

How can I see resource leaks with APP Profiler when using the command line?

I simply tried passing my app as a parameter, but it deadlocked after producing a log of about 10 000 calls to clEnqueNDRangeKernel.

Thanks!
Atmpuri

 

0 Likes
bpurnomo
Staff
Staff

Tracking down memory leaks with Open CL driver

To see the resource leaks with APP Profiler with the command line mode: pass -t and -T command line switch, please see http://developer.amd.com/tools/AMDAPPProfiler/html/usingthecommandlinesection.html

Some html files will be generated; one html file will list the resource leaks if there is any.

0 Likes