cancel
Showing results for 
Search instead for 
Did you mean: 

Archives Discussions

timchist
Elite

Semaphore handle leak when host threads are destroyed on Windows

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

0 Likes
1 Solution

Hi Himanshu,

it seems that the problem is not reproducible with 13.11 beta. Did not test in 13.10.

Regards,

Tim

View solution in original post

12 Replies
himanshu_gautam
Grandmaster

Thanks for reporting it. I will let you know my findings.

0 Likes

Hi Himanshu,

any progress on this?

Thanks, Tim

0 Likes

I am able to reproduce it, forwarding it to relevant people.

Thanks, Himanshu

0 Likes

This has been fixed in OCL runtime, and should be present in future driver releases.

0 Likes

As of Catalyst 13.9, the problem is still reproducible.

0 Likes

Will check and get back to you... Thanks

0 Likes

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

0 Likes

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.........

0 Likes

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

0 Likes