If one creates a context in the application main thread and then calls OpenCL functions utilizing this context from other threads (such as memory allocation/deallocation), OpenCL runtime creates 3 semaphores for each thread but not frees them when this thread is destroyed.
Attached is a sample code illustrating the problem.
Instructions -- on a machine with an AMD GPU (we tested on HD 7970) running Windows 7 x64:
1. Compile the application
2. Run Windows Task Manager
3. Make sure that the Handles column is shown (View > Select Columns..)
Note: it seems that Task Manager on Windows 8 does not have this menu, use other monitoring tools on that OS.
4. Run the application. Hit ENTER several times. Note that every time ENTER is pressed, the number of Handles consumed is increased by 3.
5. Use Windbg from Windows SDK to find out that the leaking handles represent semaphores and inspect the call stack within amdocl[64].dll
Solved! Go to Solution.
Hi Himanshu,
it seems that the problem is not reproducible with 13.11 beta. Did not test in 13.10.
Regards,
Tim
Thanks for reporting it. I will let you know my findings.
Hi Himanshu,
any progress on this?
Thanks, Tim
I am able to reproduce it, forwarding it to relevant people.
Thanks, Himanshu
This has been fixed in OCL runtime, and should be present in future driver releases.
As of Catalyst 13.9, the problem is still reproducible.
Will check and get back to you... Thanks
Any updates?
The code has been fixed...
However, I am not sure which driver release it will appear.
I will ask around and find it... Please wait,
meanwhile, can you check 13.10 Beta -- if thats easy for you to do.
Thanks,
- Bruhaspati
The fix is available for the next beta release...This may come coming November... But as usual, I am not in a position to guarantee this.
1 thing I can do is to check this internal driver and tell you whether the problem is gone or not.
If I get to do that -- I will post you an update.
HTH,
Best,
Bruhaaaaaaa.........
Hi Himanshu,
it seems that the problem is not reproducible with 13.11 beta. Did not test in 13.10.
Regards,
Tim
Hi Tim,
Thanks for reporting this subtle issue here, providing us a repro-case and helping us improve the drivers,
Appreciate it much,
Thanks,
Best,
Bruhaspati