Page 1 of 1

Tainted Mesa DRI drivers for Mageia 9

PostPosted: Jul 24th, '23, 22:24
by gilou
Hi,

I've made a procedure to enable Mesa support for optional video codecs to lower CPU usage and save battery life while video encoding and decoding.
This procedure is for those who want to do it on their own.
This is to work around this pending issue: https://bugs.mageia.org/show_bug.cgi?id=32060

Edit: Inaccuracies have been corrected in the procedure.
Edit2: Simplified installation (and update).
Edit3: Fixed "sudo" bug in the building script
Edit4: Fixed "sudo" bug in the installation script; Fixed issues when trying to install 23.1.7 update.

Re: Tainted Mesa DRI drivers for Mageia 9

PostPosted: Jul 25th, '23, 10:34
by morgano

Re: Tainted Mesa DRI drivers for Mageia 9

PostPosted: Sep 16th, '23, 20:10
by danlion
Thank you, gilou and morgano. I'm beginning to look at hardware accel for video and this was really useful.

This is a Radeon 7 APU with amdgpu driver, and the scripts worked perfectly as root after removing the quotes from "${SUDO}" (otherwise it complained "command not found"). The output of vainfo includes now entrypoints for VC1, H264 and HEVC, and I'm happy about the performance improvement.

I also noticed the previous VAProfileVP9Profile0, VAProfileVP9Profile2 and VAProfileAV1Profile0 are missing now.

Output of vainfo before:
Code: Select all
    Trying display: x11
    libva info: VA-API version 1.16.0
    libva info: Trying to open /usr/lib64/dri/radeonsi_drv_video.so
    libva info: Found init function __vaDriverInit_1_16
    libva info: va_openDriver() returns 0
    vainfo: VA-API version: 1.16 (libva 2.16.0)
    vainfo: Driver version: Mesa Gallium driver 23.1.3 for AMD Radeon RX 6600 (navi23, LLVM 15.0.6, DRM 3.52, 6.3.9-desktop-2.mga9)
    vainfo: Supported profile and entrypoints
        VAProfileMPEG2Simple            : VAEntrypointVLD
        VAProfileMPEG2Main              : VAEntrypointVLD
        VAProfileJPEGBaseline           : VAEntrypointVLD
        VAProfileVP9Profile0            : VAEntrypointVLD       <---
        VAProfileVP9Profile2            : VAEntrypointVLD       <---
        VAProfileAV1Profile0            : VAEntrypointVLD       <---
        VAProfileNone                   : VAEntrypointVideoProc


and after:
Code: Select all
vainfo: Driver version: Mesa Gallium driver 23.1.5 for AMD Radeon R7 Graphics (carrizo, LLVM 15.0.6, DRM 3.52, 6.4.7-desktop-3.mga9)
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                     
      VAProfileJPEGBaseline           : VAEntrypointVLD
      VAProfileNone                   : VAEntrypointVideoProc


It would be good to have those missing entries too, wouldn't it? Is is possible to add them?

Re: Tainted Mesa DRI drivers for Mageia 9

PostPosted: Sep 22nd, '23, 21:55
by gilou
Thanks for the bug fix: I've updated the script accordingly.

Regarding your issue about missing codecs, note that the vainfo outputs come from different graphic cards: RX6600 vs Carrizo.
Carrizo APUs do not support VP9 codec, so it's perfectly normal if vainfo do not report support for VP9 codec.

Re: Tainted Mesa DRI drivers for Mageia 9

PostPosted: Sep 23rd, '23, 03:51
by danlion
You're right; I assumed those capabilities were available previously and they were not. lspci says this GPU is a "Wani", though I had also seen it called "Carrizo" by software or websites previously; and yes, its Unified Video Decoder 6.0 doesn't have support for VP9 or AV1.

Since this thread is linked from the wiki, some other users of AMD graphics may want to check the list shown here: https://en.wikipedia.org/wiki/Unified_Video_Decoder
-
Thanks again, gilou. And a petit détail I had forgotten: at first, the compilation stopped with an error message about disk full. I don't know whether the /tmp directory had too much data or the tmpfs partition was too small; I just tinkered a bit build.sh to use another partition for WORKDIR. If that happens to someone else and gets stuck, maybe a reboot will help, to have /tmp cleaned.

Re: Tainted Mesa DRI drivers for Mageia 9

PostPosted: Sep 23rd, '23, 22:22
by gilou
The building script creates a working directory using command mktemp, which defaults creating working directory relative to /tmp.
If space is a problem in tmpfs, setting environment variable TMPDIR before running the building script can help:
Code: Select all
export TMPDIR="${PWD}"
.

Re: Tainted Mesa DRI drivers for Mageia 9

PostPosted: Sep 24th, '23, 11:03
by danlion
Nice one. It has been assimilated.

Re: Tainted Mesa DRI drivers for Mageia 9

PostPosted: Oct 2nd, '23, 07:58
by gilou
I've just fixed the scripts because there was an issue when updating to mesa 23.1.7.