VAAPI Hardware video acceleration FFMPEG on AMDGPU

Issues related to applications and software problems
Akhelinux
Posts: 7
Joined: 2023/03/01 07:15:04

VAAPI Hardware video acceleration FFMPEG on AMDGPU

Post by Akhelinux » 2023/03/01 09:24:38

Hi all
Need help with vaapi setup on CentOS 7.

Hardware
HP ProLiant ML310e Gen8 v2
Xeon® E3-1270 v3
8 Gb Ram
AMD RX 550 2Gb
ILO on board video

Software
CentOS 7.9
Radeon™ Software for Linux® version 22.40.3 for RHEL 7.9

libva-1.8.3-1.el7.x86_64
libva-utils-1.8.3-4.el7.x86_64


In BIOS HP ProLiant ML310e Gen8 v2
Primary ILO on board video Secondary AMD RX 550

how to better configure the BIOS for video adapters. Which should be primary which secondary. Or maybe some should be disabled.

Code: Select all

[root@zmserver scripts]# ffmpeg -hwaccels
ffmpeg version 3.4.12 Copyright (c) 2000-2022 the FFmpeg developers
  built with gcc 4.8.5 (GCC) 20150623 (Red Hat 4.8.5-44)
  configuration: --prefix=/usr --bindir=/usr/bin --datadir=/usr/share/ffmpeg --docdir=/usr/share/doc/ffmpeg --incdir=/usr/include/ffmpeg --libdir=/usr/lib64 --mandir=/usr/share/man --arch=x86_64 --optflags='-O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector-strong --param=ssp-buffer-size=4 -grecord-gcc-switches -m64 -mtune=generic' --extra-ldflags='-Wl,-z,relro ' --extra-cflags=' ' --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libvo-amrwbenc --enable-version3 --enable-bzlib --disable-crystalhd --enable-fontconfig --enable-gcrypt --enable-gnutls --enable-ladspa --enable-libass --enable-libbluray --enable-libcdio --enable-libdrm --enable-indev=jack --enable-libfreetype --enable-libfribidi --enable-libgsm --enable-libmp3lame --enable-nvenc --enable-openal --enable-opencl --enable-opengl --enable-libopenjpeg --enable-libopus --disable-encoder=libopus --enable-libpulse --enable-librsvg --enable-libsoxr --enable-libspeex --enable-libtheora --enable-libvorbis --enable-libv4l2 --enable-libvidstab --enable-libvpx --enable-libx264 --enable-libx265 --enable-libxvid --enable-libzvbi --enable-avfilter --enable-avresample --enable-libmodplug --enable-postproc --enable-pthreads --disable-static --enable-shared --enable-gpl --disable-debug --disable-stripping --shlibdir=/usr/lib64 --enable-libmfx --enable-runtime-cpudetect
  libavutil      55. 78.100 / 55. 78.100
  libavcodec     57.107.100 / 57.107.100
  libavformat    57. 83.100 / 57. 83.100
  libavdevice    57. 10.100 / 57. 10.100
  libavfilter     6.107.100 /  6.107.100
  libavresample   3.  7.  0 /  3.  7.  0
  libswscale      4.  8.100 /  4.  8.100
  libswresample   2.  9.100 /  2.  9.100
  libpostproc    54.  7.100 / 54.  7.100
Hardware acceleration methods:
vdpau
qsv
vaapi
cuvid

Code: Select all

root@zmserver scripts]# lshw -c display
  *-display                 
       description: VGA compatible controller
       product: Lexa PRO [Radeon 540/540X/550/550X / RX 540X/550/550X]
       vendor: Advanced Micro Devices, Inc. [AMD/ATI]
       physical id: 0
       bus info: pci@0000:04:00.0
       version: c7
       width: 64 bits
       clock: 33MHz
       capabilities: pm pciexpress msi vga_controller bus_master cap_list rom
       configuration: driver=amdgpu latency=0
       resources: irq:31 memory:e0000000-efffffff memory:dfe00000-dfffffff ioport:5000(size=256) memory:fbfc0000-fbffffff memory:fbf00000-fbf1ffff
  *-display
       description: VGA compatible controller
       product: MGA G200EH
       vendor: Matrox Electronics Systems Ltd.
       physical id: 0.1
       bus info: pci@0000:01:00.1
       version: 00
       width: 32 bits
       clock: 33MHz
       capabilities: pm msi pciexpress vga_controller bus_master cap_list rom
       configuration: driver=mgag200 latency=0
       resources: irq:16 memory:9f000000-9fffffff memory:fbde0000-fbde3fff memory:fb000000-fb7fffff

Code: Select all

[root@zmserver scripts]# lspci -k | grep VGA
01:00.1 VGA compatible controller: Matrox Electronics Systems Ltd. MGA G200EH
04:00.0 VGA compatible controller: Advanced Micro Devices, Inc. [AMD/ATI] Lexa PRO [Radeon 540/540X/550/550X / RX 540X/550/550X] (rev c7)

[root@zmserver scripts]# lspci -k
04:00.0 VGA compatible controller: Advanced Micro Devices, Inc. [AMD/ATI] Lexa PRO [Radeon 540/540X/550/550X / RX 540X/550/550X] (rev c7)
	Subsystem: Hewlett-Packard Company Device 841e
	Kernel driver in use: amdgpu
	Kernel modules: amdgpu

Code: Select all

[root@zmserver ~]# LIBVA_DRIVER_NAME=radeonsi vainfo
libva info: VA-API version 0.40.0
libva info: va_getDriverName() returns -1
libva info: User requested driver 'radeonsi'
libva info: Trying to open /usr/lib64/dri/radeonsi_drv_video.so
libva error: /usr/lib64/dri/radeonsi_drv_video.so has no function __vaDriverInit_0_32
libva error: /usr/lib64/dri/radeonsi_drv_video.so has no function __vaDriverInit_0_32

I did not find any clear information on this error. Are there any suggestions what could be wrong?

BShT
Posts: 585
Joined: 2019/10/09 12:31:40

Re: VAAPI Hardware video acceleration FFMPEG on AMDGPU

Post by BShT » 2023/03/01 11:33:50

seems you have two graphics cards

try to disable Matrox

User avatar
TrevorH
Site Admin
Posts: 33219
Joined: 2009/09/24 10:40:56
Location: Brighton, UK

Re: VAAPI Hardware video acceleration FFMPEG on AMDGPU

Post by TrevorH » 2023/03/01 11:34:29

If you disable the Matrox card then your iLO will no longer be able to have a remote console capability.
The future appears to be RHEL or Debian. I think I'm going Debian.
Info for USB installs on http://wiki.centos.org/HowTos/InstallFromUSBkey
CentOS 5 and 6 are deadest, do not use them.
Use the FAQ Luke

User avatar
TrevorH
Site Admin
Posts: 33219
Joined: 2009/09/24 10:40:56
Location: Brighton, UK

Re: VAAPI Hardware video acceleration FFMPEG on AMDGPU

Post by TrevorH » 2023/03/01 11:36:10

libva error: /usr/lib64/dri/radeonsi_drv_video.so has no function __vaDriverInit_0_32
That file is not something that is provided by any CentOS package so I think your problem is with the driver you have installed.

Code: Select all

[root@centos7 r]# yum provides '/usr/lib64/dri/radeonsi_drv_video.so'
Loaded plugins: priorities
170 packages excluded due to repository priority protections
No matches found
The future appears to be RHEL or Debian. I think I'm going Debian.
Info for USB installs on http://wiki.centos.org/HowTos/InstallFromUSBkey
CentOS 5 and 6 are deadest, do not use them.
Use the FAQ Luke

Akhelinux
Posts: 7
Joined: 2023/03/01 07:15:04

Re: VAAPI Hardware video acceleration FFMPEG on AMDGPU

Post by Akhelinux » 2023/03/01 12:21:58

BShT wrote:
2023/03/01 11:33:50
seems you have two graphics cards

try to disable Matrox
it doesn't seem like. it is! ) I wrote about it at the very beginning.

Akhelinux
Posts: 7
Joined: 2023/03/01 07:15:04

Re: VAAPI Hardware video acceleration FFMPEG on AMDGPU

Post by Akhelinux » 2023/03/01 12:23:05

TrevorH wrote:
2023/03/01 11:34:29
If you disable the Matrox card then your iLO will no longer be able to have a remote console capability.
I know, thanks for the feedback

Akhelinux
Posts: 7
Joined: 2023/03/01 07:15:04

Re: VAAPI Hardware video acceleration FFMPEG on AMDGPU

Post by Akhelinux » 2023/03/01 12:34:11

TrevorH wrote:
2023/03/01 11:36:10

That file is not something that is provided by any CentOS package so I think your problem is with the driver you have installed.

Code: Select all

[root@centos7 r]# yum provides '/usr/lib64/dri/radeonsi_drv_video.so'
Loaded plugins: priorities
170 packages excluded due to repository priority protections
No matches found

Code: Select all

[root@zmserver ~]# yum provides '/usr/lib64/dri/radeonsi_drv_video.so'
Загружены модули: fastestmirror, langpacks
Loading mirror speeds from cached hostfile
 * base: mirror.truenetwork.ru
 * elrepo: ftp.nluug.nl
 * epel: mirror.yandex.ru
 * extras: mirrors.datahouse.ru
 * remi-php81: mirror.docker.ru
 * remi-safe: mirror.docker.ru
 * rpmfusion-free-updates: mirror.yandex.ru
 * updates: mirrors.datahouse.ru
No matches found
the drivers were installed from this link
https://www.amd.com/en/support/graphics ... eon-rx-550

I don't understand what other options there may be for drivers. only if try to downgrade the version...

Akhelinux
Posts: 7
Joined: 2023/03/01 07:15:04

Re: VAAPI Hardware video acceleration FFMPEG on AMDGPU

Post by Akhelinux » 2023/03/01 12:44:50

BShT wrote:
2023/03/01 11:33:50
try to disable Matrox
by the way about this. I installed the CentOS 7 on another PC with Vega. (only one card in system)
And vainfo gives the same error there

User avatar
TrevorH
Site Admin
Posts: 33219
Joined: 2009/09/24 10:40:56
Location: Brighton, UK

Re: VAAPI Hardware video acceleration FFMPEG on AMDGPU

Post by TrevorH » 2023/03/01 13:01:26

the drivers were installed from this link
https://www.amd.com/en/support/graphics ... eon-rx-550
See if there is a support link on that page that you can ask. It appears their driver is broken for this.
The future appears to be RHEL or Debian. I think I'm going Debian.
Info for USB installs on http://wiki.centos.org/HowTos/InstallFromUSBkey
CentOS 5 and 6 are deadest, do not use them.
Use the FAQ Luke

Akhelinux
Posts: 7
Joined: 2023/03/01 07:15:04

Re: VAAPI Hardware video acceleration FFMPEG on AMDGPU

Post by Akhelinux » 2023/03/02 11:07:39

Solved the errors in vainfo by downgrading the driver version. On some resource I read that to install (or rather to work) fresh drivers on CentOS 7, you need to update the kernel to 5.15 and higher. This option does not suit me because then the drivers on the B120i fall off. As a result, I decided to sort out the drivers before the release of the kernel 5.15. I stopped at Radeon Software for Linux® 18.50 and installed only AMDGPU All-Open. By the way, the versions below do not work.
After that

Code: Select all

[root@zmserver ~]# vainfo --device /dev/dri/renderD128 --display drm
libva info: VA-API version 0.40.0
libva info: va_getDriverName() returns 0
libva info: Trying to open /usr/lib64/dri/radeonsi_drv_video.so
libva info: Found init function __vaDriverInit_0_40
libva info: va_openDriver() returns 0
vainfo: VA-API version: 0.40 (libva )
vainfo: Driver version: Mesa Gallium driver 18.2.0-rc3 for Radeon RX550/550 Series (POLARIS12, DRM 3.27.0, 3.10.0-1160.83.1.el7.x86_64, LLVM 7.0.1)
vainfo: Supported profile and entrypoints
      VAProfileMPEG2Simple            :	VAEntrypointVLD
      VAProfileMPEG2Main              :	VAEntrypointVLD
      VAProfileVC1Simple              :	VAEntrypointVLD
      VAProfileVC1Main                :	VAEntrypointVLD
      VAProfileVC1Advanced            :	VAEntrypointVLD
      VAProfileH264ConstrainedBaseline:	VAEntrypointVLD
      VAProfileH264ConstrainedBaseline:	VAEntrypointEncSlice
      VAProfileH264Main               :	VAEntrypointVLD
      VAProfileH264Main               :	VAEntrypointEncSlice
      VAProfileH264High               :	VAEntrypointVLD
      VAProfileH264High               :	VAEntrypointEncSlice
      VAProfileHEVCMain               :	VAEntrypointVLD
      VAProfileHEVCMain               :	VAEntrypointEncSlice
      VAProfileHEVCMain10             :	VAEntrypointVLD
      VAProfileJPEGBaseline           :	VAEntrypointVLD
      VAProfileNone                   :	VAEntrypointVideoProc
now I'm testing ffmpeg vaapi options because radeontop shows strange activity
the changes are only in these sensors. the remaining indicators are at zero

Code: Select all

132М / 2043М VRAM   6,45% │   
38M / 3065M GTT   1,25% │ 
0,30G / 1,75G Memory Clock  17,14% 
0,58G / 1,18G Shader Clock  48,09%

Post Reply