Flex 1.2 Assertion fails in DeviceD3D11.cpp when initializing Flex


I have written a c++cli bridge for flex1.2, I’m using the d3d11 device and context of my c# based app`s slimdx renderer; i´m initalizing flex like this:

nativePointers = new DX11NativePointer(); //class holding native dx11 pointers

nativePointers->deviceContext = (ID3D11DeviceContext*)(void*)dx11DeviceContext; //dx11DeviceContext is a comptr from c#
nativePointers->device = (ID3D11Device*)(void*)dx11Device; //dx11Device is a comptr from c#

NvFlexInitDesc desc;
desc.deviceIndex = g_device;//=0
desc.enableExtensions = g_extensions;//=true
desc.renderDevice = nativePointers->device;
desc.renderContext = nativePointers->deviceContext;
desc.computeContext = 0;
desc.computeType = eNvFlexD3D11;
desc.runOnRenderContext = false;

g_flexLib = NvFlexInit(NV_FLEX_VERSION, 0, &desc);

This works fine only the first time, when I try to reset my scene(= re-initialize flex) I get an assertion error:

"Assertion failed!

Program: …\NvFlexDebugD3D_x64.dll
File: …\dx\contextD3D11\DeviceD3D11.cpp
Line: 190

Expression: result == NVAPI_OK"

How can i find out what’s in line 190, ie which assertion failed?

Is there anything wrong with my initializiation? Possibly the error happens before, but without knowing which assertion failed I’m kind of stuck…

Thank you