Version 17 (modified by 7 years ago) (diff) | ,
---|
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 760 and up) and a license key. (...)
This encoder offers the best latency, which is most noticeable at higher resolutions (1080p and up).
Building
- 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
is known to work) - 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 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 v0.11.x (trunk) r4652 or later with nvenc support:
./setup.py install --with-nvenc
Notes:
- the files given here are for the current versions of the
SDK
s 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
" - 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)
Using NVENC
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
- with version 0.11:
XPRA_ENCODER_TYPE=nvenc xpra ...
To debug nvenc, add:
xpra -d nvenc start ...
(versions older than v0.12 required the use of the XPRA_OPENCL_DEBUG=1
environment variable)
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)
-
nvenc3.pc (325 bytes) - added by 7 years ago.
nvenc pkgconfig file (sdk v3)
-
nvenc-comments.patch (457 bytes) - added by 7 years ago.
apply this patch to NVENC SDK v3 to compile without warnings
-
cuda.pc (216 bytes) - added by 7 years ago.
simpler version of the cuda pkgconfig file, works with recent versions of the driver
-
nvenc.pc (317 bytes) - added by 7 years ago.
pkgconfig file for version 4
-
nvenc4.pc (319 bytes) - added by 6 years ago.
pkgconfig file for nvenc v4
-
nvenc5.pc (305 bytes) - added by 6 years ago.
pkgconfig file for nvenc v5
Download all attachments as: .zip