Bug 492844

Summary: VP9 encoding is not GPU accelerated
Product: [Frameworks and Libraries] KPipeWire Reporter: Francis John Baldon <fjbaldon>
Component: generalAssignee: Plasma Bugs List <plasma-bugs-null>
Status: CONFIRMED ---    
Severity: normal CC: aleixpol, correosinuso23, dion, kde, noahadvs, postix
Priority: NOR    
Version First Reported In: unspecified   
Target Milestone: ---   
Platform: Fedora RPMs   
OS: Linux   
See Also: https://bugs.kde.org/show_bug.cgi?id=488896
https://bugs.kde.org/show_bug.cgi?id=500434
Latest Commit: Version Fixed/Implemented In:
Sentry Crash Report:
Attachments: output from vainfo

Description Francis John Baldon 2024-09-08 21:43:46 UTC
Created attachment 173459 [details]
output from vainfo

SUMMARY
Attached is an output from vainfo. I'm having high cpu usage when I do webm/vp9 screen recording on spectacle. The default format is webm/vp9 and when I switch to mp4/h.264, cpu usage drastically decreases. I'm also seeing activity on the Video row when I'm using mp4/h.264 but nothing on webm/vp9. I have this line on my vainfo output so I assume I can encode vp9 on my igpu: "VAProfileVP9Profile0: VAEntrypointEncSlice"

STEPS TO REPRODUCE
1. Screen record using Spectacle (Wayland)
2. Use System Monitor or intel_gpu_top to monitor cpu and gpu usage
3. Spectacle does not offload its encoding to the gpu, instead it uses only the cpu

OBSERVED RESULT
Spectacle does not use the gpu when encoding the video

EXPECTED RESULT
Spectacle uses the gpu when encoding the video

SOFTWARE/OS VERSIONS
Windows: 
macOS: 
(available in the Info Center app, or by running `kinfo` in a terminal window)
Linux/KDE Plasma: Fedora Linux 40
KDE Plasma Version: 6.1.4
KDE Frameworks Version: 6.5.0
Qt Version: 6.7.2

ADDITIONAL INFORMATION
Comment 1 Noah Davis 2024-09-10 07:20:53 UTC
I actually have a patch to add GPU accelerated VP9 encoding to KPipeWire (the library Spectacle uses for recording), but the problem is I don't have any way to test it. If you're willing and able to test that the patch works, we could merge it. https://invent.kde.org/plasma/kpipewire/-/merge_requests/91
Comment 2 Francis John Baldon 2024-09-11 10:13:01 UTC
After using libva-intel-driver for days, I'm not sure now if the bug is caused by Spectacle solely. As I've noticed, even chromium now doesn't do vp9 decoding, so this might be a driver issue.