multi 4k videos decode with dxva using nvidia

hello everyone, I got an error 0xfffffffb from NvAPI_D3D9_GetSurfaceHandle, when decoding 2 4k videos in multi-thread, but after I added a static criticalsection before NvAPI_D3D9_GetSurfaceHandle and the error gone, so I wonder why’s that happen or any details I should know about this. Any reply will be appreciated, thks a lot