As written in the faq, the fix is adding “copy-hw=2” for nvvideoconvert. Here is a sample cmd.
gst-launch-1.0 videotestsrc ! video/x-raw,format=RGBA ! nvvideoconvert copy-hw=2 ! video/x-raw\(memory:NVMM\),format=RGBA ! nveglglessink
please refer to this topic for SW encoding.