Sporadic "Access violation reading location at 0xFFFFFFFFFFFFFFFF" during NVENC encoding session on D3D11 device

Hi.

We have been experiencing a game crash during video encoding session which runs inside Unreal Engine 4.27 based game. The rendering API in use is DirectX11. The crash timing is inconsistent. Sometimes it crashes after several minutes, but most of the time the crash occurs after more than hour into the gameplay.
We are using NVENC to record the gameplay on NVIDIA enabled machines continuously on the client,inside the game’s process as a part of Ludeo SDK. On some machines it doesn’t occur at all.

Here is the full exception:

“Unhandled exception at 0x00007ffD97B76FD7 (nvwgf2umx.dll) in UE4Minidump.dmp: 0xC0000005:Access violation reading location 0xFFFFFFFFFFFFFFFF”

Our issue is very similar to this one:

Currently we are running this game with a software video encoder to understand what causes the error. So far we haven’t been able to reproduce this crash.The game was running for two hours on software encoder and the crash never happened. Our NVENC encoder uses DirectX11 API to perform texture copy (via simple render pass, rendering to a full screen triangle) from the game’s backbuffer into encoding surface which is nvenc mapped D3D texture resource. We can’t see anything in the code which could be the cause of the problem. We also can’t find any helpful info in UE logs either. On the application level everything looks ok.

UPDATE:
We ran a game written in C++ (no Unreal Engine), D3D11, same NVENC, for 4 hours and there was no error like this.
We also ran a Unity game, D3D11, same NVENC and the crash doesn’t occur there.
So far we can see that the crash happens in a setups where the engine is Unreal 4 (didn’t test on 5) and encoder is NVENC.

Here is the setup of one of our PCs where the error happens always (still sporadically) when using NVENC:

OS:
Name Microsoft Windows 10 Pro
Version 10.0.19045 Build 19045

Graphics:
GeForce GTX 1660 SUPER
Driver version 556.12

Video Codec SDK version: 11.1.5

0xFFFFFFFFFFFFFFFF is the equvivalent of NULL for windows kernel. They do not use 0 address, but that.

Hi.
Well, this info doesn’t help me much.