NVENC

This encoder offers the best latency, which is most noticeable at higher resolutions.

Hardware

This encoder requires a supported NVIDIA graphics card: * a “professional” Quadro 4000 card (no license key required) * a consumer card and a license key or a patch to workaround the artificial context limit which can be debilitating

Software Requirements

You must have PyCUDA installed (it is included in the official xpra repositories), and a recent enough version of the nvidia drivers. It is not compatible with the nouveau driver.

How you install those drivers is entirely up to you, here are some options for Fedora / RHEL: * nvidia installers * negativo17 repository * rpmfusion * elrepo etc..

If your CUDA (libcuda.so) or NVENC (libnvidia-encode.so) libraries are installed in an unusual location, it is your responsibility to ensure they can be loaded at runtime, usually by adding the directory to the LD_LIBRARY_PATH.

Using NVENC

If the codec loads properly, it will be used ahead of the other software encoders automatically.

You can verify the video encoder currently in use with:

xpra info | grep "encoder="

Important: the video encoder is only used when needed, usually when there is a stream of screen updates.

Debugging

To force xpra to use nvenc exclusively as video encoder, you can use the --video-encoders= command line option:

xpra start :10 --video-encoders=nvenc

To debug the availability of video encoders and GPUs:

xpra encoding
xpra video
xpra nvinfo

Once nvenc is running, you can debug the encoding process step with:

xpra start -d nvenc ...

License Keys

You can store the license keys in nvenc.keys, either globally in /etc/xpra/ or per-user in ~/.xpra/.

Or you can also use the environment variable:

XPRA_NVENC_CLIENT_KEY="0A1B2C3D-4E5F-6071-8293-A4B5C6D7E8F9" xpra ...

Newer SDK versions may not support keys, or just not the same set of keys, in which case the number of sessions will be limited when using consumer cards unless you patch the library.

Building

cat > /usr/lib64/pkgconfig/nvenc.pc
prefix=/usr/local/nvenc
exec_prefix=${prefix}
includedir=${prefix}/Interface
libdir=/usr/lib64/nvidia

Name: nvenc
Description: NVENC
Version: 10
Requires: 
Conflicts:
Libs: -L${libdir} -lnvidia-encode
Cflags: -I${includedir}
END
./setup.py build --with-nvenc

Caveats