AnsweredAssumed Answered

OpenCL 1.2 "cl_khr_dx9_media_sharing" bugs

Question asked by madshi on Nov 8, 2012
Latest reply on Nov 29, 2012 by madshi

Hey guys,

 

trying to make the "cl_khr_dx9_media_sharing" OpenCL 1.2 extension work. The latest AMD drivers (12.11 beta) generally support this extension and it works ok, but there are a couple of bugs:

 

(1) When first calling clCreateFromDX9MediaSurfaceKHR() in thread "A" and then later calling clReleaseMemObject() in thread "B", there's a crash. When calling both in the same thread, there's no problem. Since calling both in the same thread is easy enough, this is not very important to me. Generally my impression is that AMD's OpenCL implementation is not very thread safe. But I can live with that for now.

 

(2) Show stopper: Sometimes clCreateFromDX9MediaSurfaceKHR() fails with error code -1022. This happens in the following situation:

 

- IDirectXVideoProcessorService.CreateSurface(NV12) succeeds -> (IDirect3D9Surface) 0x44440000

- clCreateFromDX9MediaSurfaceKHR() succeeds

- clEnqueueAcquireDX9MediaSurfacesKHR() succeeds

- clEnqueueNDRangeKernel() succeeds

- clEnqueueReleaseDX9MediaSurfacesKHR() succeeds

- clReleaseMemObject() succeeds

- ((IDirect3D9Surface) 0x44440000)->Release() succeeds

- IDirectXVideoProcessorService.CreateSurface(NV12) succeeds -> (IDirect3D9Surface) 0x44440000

- clCreateFromDX9MediaSurfaceKHR() fails with -1022

 

This problem occurs only if a newly created IDirect3D9Surface by random chance gets the exact same address of an older (already released) IDirect3D9Surface, which was already used by OpenCL. I've double checked the reference counts of all involved interfaces/objects and I'm definitely properly releasing everything. So this seems like a bug in the implementation of the "cl_khr_dx9_media_sharing" extension.

 

Is this forum the right place to post such bug reports? Or is there a bug reporting system set up somewhere for developers?

 

Thanks!

Outcomes