I’ve been trying to get NVidia’s hardware encoding on linux to work (In order to capture application displays and stream them, encoding them using the HW encoder on NVidia cards). We have a similar streaming setup working on windows (which uses DirectX things, so not really applicable to Linux except for reusing some code fragments) but capturing the whole screen.
To do that; I was planning to capture window display from X11 (Using XComposite and glXBind extensions) to an OpenGL texture, feed the texture to NvEnc to get a video stream
I’ve had trouble getting the examples to work for NvCodec API
- First of all, I’m running the “Amazon Linux 2 with .Net Core, PowerShell, Mono, and MATE Desktop Environment” AMI on a g4dn.xlarge instance on Amazon EC2.
- I try and build the samples (It took some effort to get them to compile).
- When I try to run this, I get an error about the libraries not being loaded. When I search for this string in the samples source, I discover it is printing that if glGetString(GL_VENDOR) returns something other than “NVIDIA Corporation”. It returns “VMWare, Inc.” on the instance I’m using. I’m not sure if this is due to the drivers not being installed correctly (nvidia-smi returns the correct driver info, by the wasy) or due to the virtualized nvidia GPUs on Amazon EC2 returning VMWare
- If I disable that check in the sample source, the call to nvEncOpenEncodeSessionEx returns 2, which is NV_ENC_ERR_UNSUPPORTED_DEVICE. I believe this error stems from the same reason I get a wrong vendor from OpenGL.