Version 42 (modified by 6 years ago) (diff) | ,
---|
NVENC Encoder
This encoder offers the best latency, which is most noticeable at higher resolutions (1080p and up). See wiki/Encodings/nvenc/Performance.
Hardware
This encoder requires a supported NVIDIA graphics card:
- Tesla onwards cards: Quadro K4000 and up, .. (no license key required)
- Some consumer cards (ie: GTX 680, GTX 750 and up for sure) and a license key (best with SDK version 4 or older)
Software Requirements
You must have PyCUDA installed, and a recent enough version of the nvidia drivers. How you install those drivers is entirely up to you:
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
.
Note: xpra version 0.15 or newer is required.
Using NVENC
If the nvenc codec loads properly, it will be used ahead of the x264 software encoder automatically (that's assuming that the encoding used is h264
- which is the default).
You can verify the video encoder in use with:
xpra info | grep "encoder="
Scaling: nvenc supports scaling natively, see CSC/Scaling for details on how to configure scaling.
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 loading of video encoders, you can run the following scripts which are installed with xpra:
xpra/codecs/loader.py
xpra/codecs/video_helper.py
xpra/codecs/nv_util.py
Once nvenc is running, you can debug the encoding process step with:
xpra start -d nvenc ...
License Keys
As of version 0.15, 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 ...
Building
- Download the CUDA SDK and install it (tested with versions 5 through to 7). 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 (more details below)
- Install PyCuda version 2015.1 or later (using your distribution's package manager if possible)
- Download the NVENC SDK, aka "NVIDIA VIDEO CODEC SDK" and install it (just unzip into
/opt/
), then create a symlink named just/opt/nvencV
(where V is the SDK version, ie:nvenc4
). You may want to stick with SDK versions 3 or 4 if you plan on using consumer cards with a license key, as the SDK version 5 removes the ability to use keys (see #825). - Download the pkgconfig file matching your SDK version (ie: nvenc4.pc) and install it (same location as the
cuda.pc
) - When building xpra, nvenc support should be auto-detected, but you can try forcing it to verify, ie: for version 4:
./setup.py install --with-nvenc4
Notes:
- you may need to adjust some paths
- 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)
ie: 331.20
, 331.49
and 334.21
are known to work with the version 3 SDK - 331.79
and 337.12
require a different set of license keys, more information here: #595
- newer driver versions seem to be completely broken, do not use versions 350 and newer (see #558)
Attachments (6)
-
nvenc3.pc (325 bytes) - added by 9 years ago.
nvenc pkgconfig file (sdk v3)
-
nvenc-comments.patch (457 bytes) - added by 8 years ago.
apply this patch to NVENC SDK v3 to compile without warnings
-
cuda.pc (216 bytes) - added by 8 years ago.
simpler version of the cuda pkgconfig file, works with recent versions of the driver
-
nvenc.pc (317 bytes) - added by 8 years ago.
pkgconfig file for version 4
-
nvenc4.pc (319 bytes) - added by 7 years ago.
pkgconfig file for nvenc v4
-
nvenc5.pc (305 bytes) - added by 7 years ago.
pkgconfig file for nvenc v5
Download all attachments as: .zip