ffmpeg -f kmsgrab is failing: Failed to open DRM device.

Generix is right – the NVIDIA X driver predates drm and doesn’t use drm-kms for modesetting.

If you want to capture the contents of the display in an efficient way, your best bet is probably to use the NVIDIA Capture SDK.