Capturing D3D11 with nvEnc

Suppose one would like to capture frames from d3d11 device and encode with h264 codec.
I am able to initialize the encoder with my Device (The one used by the app) by passing it to nvEncOpenEncodeSessionEx, but then i am unable to register this device as a resource.
Should one pass a new, empty instance of a device to nvEncOpenEncodeSessionEx ?
If so, what the encoder using it for?