-
Notifications
You must be signed in to change notification settings - Fork 230
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
cl_khr_d3d11_sharing causes tearing and artifacts on DG2 #602
Comments
Hi @nyanmisaka |
Wait the event returned by Can you reproduce the issue with my command on Windows using an Arc dGPU? |
Hi @XCRobert We found that the compute-runtime/opencl/source/os_interface/windows/d3d10_11_sharing_functions.cpp Lines 357 to 363 in 4100e1a
compute-runtime/opencl/source/sharings/d3d/d3d_surface.cpp Lines 127 to 132 in e53eae6
We did an experiment, it's proved that combining |
Hello there! I got some tearing and artifacts when sharing textures between the D3D11 and OpenCL.
Here's the main procedures to decode and share a video frame in FFmpeg:
1, hwcontext_d3d11va
ID3D10Multithread_SetMultithreadProtected
to true.D3D11_RESOURCE_MISC_SHARED
.2, hwcontext_opencl
CL_CONTEXT_INTEROP_USER_SYNC=0
on same D3D11 device.subresource
to create Y and UV images from the ID3D11Texture2D texture array withclCreateFromD3D11Texture2DKHR
and thecl_intel_d3d11_nv12_media_sharing
extension.3, d3d11va hwaccel decoder
4, hwcontext_opencl
clEnqueueAcquireD3D11ObjectsKHR
and wait the eventclEnqueueReleaseD3D11ObjectsKHR
and wait the event5, uninit and cleanup the decoder and hwcontexts
Once I set the decoder thread count to 1
-threads 1
in FFmpeg, it gives me tearing and artifacts in the output image.I only notice the issue on DG2 and a few Xe graphics, both are Gen12 platform with the latest driver 4032 installed.
For comparison I also tried the same CLI on the GPU from AMD and it works fine.
So I suspect there are some flaws in the Gen12 Windows driver since the
cl_khr_d3d11_sharing
extension claimed that the driver is responsible for providing the synchronization guarantee if I setCL_CONTEXT_INTEROP_USER_SYNC=0
on context creation.The test video is taken from http://www.larmoire.info/jellyfish/media/jellyfish-120-mbps-4k-uhd-hevc-10bit.mkv
You can try with our pre-built custom ffmpeg or build the ffmpeg with this patch applied to enable the MISC_SHARED flag.
Thanks in advance!
The text was updated successfully, but these errors were encountered: