-
Notifications
You must be signed in to change notification settings - Fork 56
Hw. acceleration support
UltraGrid supports video encoding and decoding libavcodec HW acceleration with VA-API and vendor specific APIs (VDPAU, QuickSync, AMF, VideoToolbox, NVENC/CUVID). Currently the acceleration works best with VA-API on Intel and VDPAU on Nvidia proprietary drivers.
If not stated otherwise, encode/decode with H.264 and HEVC was tested in the setups below.
GPU | OS | API | UG version | status |
---|---|---|---|---|
RX 580 | Ubuntu 18.04 | VA-API | pre-1.8 | +/- works1,2 |
RX 580 | Ubuntu 18.04 | VDPAU | pre-1.8 | works, decode only³ |
RX 580 | Windows 10 | AMF⁴ | pre-1.8 | works, encode only |
RX 580 | Arch 10/2023 | VA-API | 1.8.5 | encode works⁵ |
RX 580 | Arch 10/2023 | VA-API | ac110f1 | works⁵ |
RX 7600 | Arch 10/2023 | VA-API | 1.8.5 | encode works |
RX 7600 | Arch 10/2023 | VA-API | ac110f1 | works |
¹ encoded stream H.264 was not decodable until amdgpu-pro-19.20-812932-ubuntu-18.04 and kernel 5.0.0-17-generic installed, HEVC broken
² H.264 decoded but wrong colors in chroma
³ works in copy mode only
⁴ encode doesn't support intra-refresh (setting intra_refresh_mb doesn't seem to help; use quality constrain parameter - :qp_i=36
, which hand solves bitrate variance but causes artifacts on the I-frames)
⁵ slices are not supported by the encoder, :slices=1
need to be set
- Debian 12/Ubuntu 24.04 -
libmfx-gen1.2
andintel-media-va-driver-non-free
installed - user should be a member of render group (the output of cmd
groups
should contain "render", if not, usesudo gpasswd -a <user> render; newgrp render
)
- Check the output of
vpl-inspect
(package onevpl-tools) andvainfo
. - try to set
LIBVA_DRIVER_NAME=iHD
- with an older distro, build own libvpl (instead of package libmfx-gen1.2), media driver (instead of intel-media-va-driver-non-free, also see the notes)
- if building own FFmpeg, libvpl-dev is required
- CPU utilization seem to be rather even when using acceleration (some 2.5 core for one direction)
- works using XV30 (10-bit YCbCr 4:4:4), yuyv422 or vuya (8-bit YCbCr 4:4:4). y210le (10-bit 4:2:2) can be used if intra refresh is disabled
- X2RGB10 (10-bit RGB) works but converts RGB to YCbCr internally
-
bgra works when enabled HuC mode and low_power is enabled (VA-API entry point VAEntrypointEncSliceLP) –
-c libavcodec:encoder=hevc_qsv:low_power=1
- 10 and 12-bit YCbCr 4:4:4 works correctly
- RGB formats don't currently work - QSV decompresses them correctly as RGB but presents them (incorrectly) in a YCbCr container/pixelfmt xv36, xv30 or vuya (depending on bit-depth)
- UHD 4K resolution and YUV 4:4:4 (or equivalent RGB) causes "GPU Hang" errors, reported here and here; does occur with kernel 5.15 but not 6.0 regardless the in HuC mode
- not sure if there are not artifacts
The above color space issues can be tracked here.
Ubuntu at least 23.10 is recommended (unless drivers from Intel are used).
UltraGrid supports Vulkan decode through ffmpeg. Currently only copy mode is supported (the hw. frames are transferred to cpu managed memory). To use this, UltraGrid needs to be build with a recent enough ffmpeg (release 6.2) and the system needs to have a recent version of the mesa
package installed (23.1 for H.264 and 23.2 for HEVC).
The implementation has been observed to work on Intel and Nvidia GPUs. Currently, when running on Intel GPUs, the environment variable ANV_VIDEO_DECODE=1
needs to be set to enable Vulkan decode support in the driver.
If you have any technical or non-technical question or suggestion please feel free to contact us at