xpra icon
Bug tracker and wiki

This bug tracker and wiki are being discontinued
please use https://github.com/Xpra-org/xpra instead.

Version 27 (modified by Antoine Martin, 7 years ago) (diff)


[[Image(...)]] NVENC Encoder

This encoder requires a supported NVIDIA graphics card (Tesla, Quadro K4000 and up, ..) or a card which has the NVENC chip (GTX 680?, GTX 750 and up for sure) and a license key. (...)

This encoder offers the best latency, which is most noticeable at higher resolutions (1080p and up).


  • Download the CUDA SDK and install it. If present, you should remove any previously installed nvidia drivers: both "nouveau" and nvidia's proprietary drivers - either install the drivers bundled with CUDA or a sufficiently recent version, preferably directly from nvidia (ie: 331.20, 331.49 and 334.21 are known to work - 337.12 does not and may need an updated SDK or different keys, 331.79 also works but may require newer license keys)
  • Download the cuda.pc pkgconfig file (missing from the SDK) and install it (usually in /usr/lib64/pkgconfig for 64-bit systems)
  • Install PyCuda
  • Download the latest NVENC SDK (aka "NVIDIA VIDEO CODEC SDK") and install it (just unzip into /usr/local/)
  • Download the nvenc3.pc pkgconfig file (also missing from the SDK) and install it
  • Build xpra version with nvenc support:
    ./setup.py install --with-nvenc


  • the files given here are for the current versions of the SDKs and for 64 bit systems only, adjust the files and locations accordingly
  • If CUDA refuses to build and complains about:
    Installation Failed. Using unsupported Compiler.
    run the CUDA installer with "-override-compiler" or "--override" for newer SDK.
  • there are undocumented incompatibilities between kernel versions, nvidia driver versions and nvenc SDK versions. If possible, install the driver version bundled with the nvenc SDK. For more details see here If you ignore this warning, you may get undecipherable errors at runtime (incompatible structure version errors, etc)


Because of the unusual location of the CUDA and NVENC libraries and support tools, it is your responsibility to ensure that the required shared objects and the CUDA compiler can be located/loaded at runtime. You can specify the paths each time on the command line:

PATH=$PATH:/usr/local/cuda-5.5/bin/ \
LD_LIBRARY_PATH=${LD_LIBRARY_PATH}:/usr/local/cuda-5.5/lib64:/usr/lib64/nvidia \
 xpra ...

Or make those settings more permanent in your user or system profile.

Beware that the new paths added to PATH and LD_LIBRARY_PATH should be appended to the current values (as per the example above) and not inserted before them, this is to prevent a conflict with other system libraries. (ie: libOpenCL.so is known to cause crashes)

If the nvenc codec loads, it should get used ahead of x264 when you specify the h264 encoding, you can verify the encoder in use with:

xpra info | grep "encoder="

Note: your client must be either 0.10.9 / 0.11.0-r4661 or newer. With older clients (0.10.x), you must specify "--encoding=x264" to get h264...

To force xpra to use nvenc as video encoder and no other, you can also specify:

  • with version 0.12 onwards (r5376) using the --video-encoders= command line option:
    xpra start :10 --video-encoders=nvenc

To debug nvenc, add:

xpra -d nvenc start ...

Scaling: nvenc supports scaling natively, see CSC/Scaling for details on how to configure scaling.

License Key

If you have access to a license key, you can specify it like so:

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

Attachments (6)

Download all attachments as: .zip