Nv Encoder blocks when doing encoding

Sometimes the nv encoder blocks after calling nvEncEncodePicture api. And the backtrace is as below.

#0 0x00007ff9f5325c04 in win32u!NtGdiDdDDIWaitForSynchronizationObjectFromCpu
() from C:\Windows\System32\win32u.dll
#1 0x00007ff9f1ffdb26 in d3d11!D3D11CoreGetLayeredDeviceSize ()
from C:\Windows\SYSTEM32\d3d11.dll
#2 0x00007ff9f1fcc849 in d3d11!D3D11CoreCreateDevice ()
from C:\Windows\SYSTEM32\d3d11.dll
#3 0x00007ff9c3889489 in nvwgf2umx!NVAPI_Thunk ()
from C:\Windows\System32\DriverStore\FileRepository\nvgridsw.inf_amd64_02aae4f7f10ea9bb\nvwgf2umx.dll
#4 0x00007ff9c3850224 in nvwgf2umx!NVAPI_Thunk ()
from C:\Windows\System32\DriverStore\FileRepository\nvgridsw.inf_amd64_02aae4f7f10ea9bb\nvwgf2umx.dll
#5 0x00007ff9c38503d4 in nvwgf2umx!NVAPI_Thunk ()
from C:\Windows\System32\DriverStore\FileRepository\nvgridsw.inf_amd64_02aae4f7f10ea9bb\nvwgf2umx.dll
#6 0x00007ff9c38500f5 in nvwgf2umx!NVAPI_Thunk ()
from C:\Windows\System32\DriverStore\FileRepository\nvgridsw.inf_amd64_02aae4f7f10ea9bb\nvwgf2umx.dll
#7 0x00007ff9c3858a93 in nvwgf2umx!NVAPI_Thunk ()
from C:\Windows\System32\DriverStore\FileRepository\nvgridsw.inf_amd64_02aae4f7f10ea9bb\nvwgf2umx.dll
#8 0x00007ff9c385d68e in nvwgf2umx!NVAPI_Thunk ()
from C:\Windows\System32\DriverStore\FileRepository\nvgridsw.inf_amd64_02aae4f7f10ea9bb\nvwgf2umx.dll
#9 0x00007ff9c38e53a3 in nvwgf2umx!NVAPI_Thunk ()
from C:\Windows\System32\DriverStore\FileRepository\nvgridsw.inf_amd64_02aae4f7f10ea9bb\nvwgf2umx.dll
#10 0x00007ff9c388a27e in nvwgf2umx!NVAPI_Thunk ()
from C:\Windows\System32\DriverStore\FileRepository\nvgridsw.inf_amd64_02aae4f7f10ea9bb\nvwgf2umx.dll
#11 0x00007ff9c385d216 in nvwgf2umx!NVAPI_Thunk ()
from C:\Windows\System32\DriverStore\FileRepository\nvgridsw.inf_amd64_02aae4f7f10ea9bb\nvwgf2umx.dll
#12 0x00007ff9c3891696 in nvwgf2umx!NVAPI_Thunk ()
from C:\Windows\System32\DriverStore\FileRepository\nvgridsw.inf_amd64_02aae4f7f10ea9bb\nvwgf2umx.dll
#13 0x00007ff9c388f1fc in nvwgf2umx!NVAPI_Thunk ()
from C:\Windows\System32\DriverStore\FileRepository\nvgridsw.inf_amd64_02aae4f7f10ea9bb\nvwgf2umx.dll
#14 0x00007ff9c38959f1 in nvwgf2umx!NVAPI_Thunk ()
from C:\Windows\System32\DriverStore\FileRepository\nvgridsw.inf_amd64_02aae4f7f10ea9bb\nvwgf2umx.dll
#15 0x00007ff9c395595f in nvwgf2umx!NVAPI_Thunk ()
from C:\Windows\System32\DriverStore\FileRepository\nvgridsw.inf_amd64_02aae4f7f10ea9bb\nvwgf2umx.dll
#16 0x00007ff9c38b84ef in nvwgf2umx!NVAPI_Thunk ()
from C:\Windows\System32\DriverStore\FileRepository\nvgridsw.inf_amd64_02aae4f7f10ea9bb\nvwgf2umx.dll
#17 0x00007ff9c38b7cd7 in nvwgf2umx!NVAPI_Thunk ()
from C:\Windows\System32\DriverStore\FileRepository\nvgridsw.inf_amd64_02aae4f7f10ea9bb\nvwgf2umx.dll
#18 0x00007ff9c386542d in nvwgf2umx!NVAPI_Thunk ()
from C:\Windows\System32\DriverStore\FileRepository\nvgridsw.inf_amd64_02aae4f7f10ea9bb\nvwgf2umx.dll
#19 0x00007ff9c3865c56 in nvwgf2umx!NVAPI_Thunk ()
from C:\Windows\System32\DriverStore\FileRepository\nvgridsw.inf_amd64_02aae4f7f10ea9bb\nvwgf2umx.dll
#20 0x00007ff9c384310c in nvwgf2umx!NVAPI_Thunk ()
from C:\Windows\System32\DriverStore\FileRepository\nvgridsw.inf_amd64_02aae4f7f10ea9bb\nvwgf2umx.dll
#21 0x00007ff9c2a5dfc4 in nvwgf2umx!NVDEV_Thunk ()
from C:\Windows\System32\DriverStore\FileRepository\nvgridsw.inf_amd64_02aae4f7f10ea9bb\nvwgf2umx.dll
#22 0x00007ff9c2ccd607 in nvwgf2umx!OpenAdapter12 ()
from C:\Windows\System32\DriverStore\FileRepository\nvgridsw.inf_amd64_02aae4f7f10ea9bb\nvwgf2umx.dll
#23 0x00007ff9f1fa87a7 in d3d11!D3D11On12CreateDevice ()
from C:\Windows\SYSTEM32\d3d11.dll
#24 0x00007ff9f1fa8671 in d3d11!D3D11On12CreateDevice ()
from C:\Windows\SYSTEM32\d3d11.dll
#25 0x00007ff9c199c910 in nvEncodeAPI64!NvEncodeAPIGetMaxSupportedVersion ()
from C:\Windows\SYSTEM32\nvEncodeAPI64.dll
#26 0x00007ff9c199de45 in nvEncodeAPI64!NvEncodeAPIGetMaxSupportedVersion ()
from C:\Windows\SYSTEM32\nvEncodeAPI64.dll
#27 0x00007ff9c19ad627 in nvEncodeAPI64!NvEncodeAPIGetMaxSupportedVersion ()
from C:\Windows\SYSTEM32\nvEncodeAPI64.dll
#28 0x00007ff9c19ad952 in nvEncodeAPI64!NvEncodeAPIGetMaxSupportedVersion ()
from C:\Windows\SYSTEM32\nvEncodeAPI64.dll
#29 0x00007ff9c19acc43 in nvEncodeAPI64!NvEncodeAPIGetMaxSupportedVersion ()
from C:\Windows\SYSTEM32\nvEncodeAPI64.dll
#30 0x00007ff9c19a9384 in nvEncodeAPI64!NvEncodeAPIGetMaxSupportedVersion ()
from C:\Windows\SYSTEM32\nvEncodeAPI64.dll
#31 0x00007ff9c19bcb20 in nvEncodeAPI64!NvEncodeAPIGetMaxSupportedVersion ()
from C:\Windows\SYSTEM32\nvEncodeAPI64.dll

The Nv encoder is working in async mode.

Hello @zhangt_xd ,

I am sorry to hear you having trouble with NVENC. In case you still see this issue, can you provide a bit more detail on what you try to accomplish and ideally a minimal repro application?

Also please provide your system details as you find them in the Windows System information as well as which GU you are using and what driver version.

Thanks!

Thanks