Hardware acceleration not working properly

Quick to answer questions about finding your way around Linux Mint as a new user.
Forum rules
There are no such things as "stupid" questions. However if you think your question is a bit stupid, then this is the right place for you to post it. Stick to easy to-the-point questions that you feel people can answer fast. For long and complicated questions use the other forums in the support section.
Before you post read how to get help. Topics in this forum are automatically closed 6 months after creation.
Locked
ohnoanyways
Level 1
Level 1
Posts: 7
Joined: Wed Jan 26, 2022 5:01 pm

Hardware acceleration not working properly

Post by ohnoanyways »

I can't get hardware acceleration properly working on MInt 20.3 Cinnamon, most Youtube videos above 4k30/1440p60 result in dropped frames. I tried this previously on Windows10 with Edge/Chrome/Firefox and always got smooth 4k60 playback with no dropped frames. Then followed a tutorial and installed VA-API (hope succesfully) and it improved a bit but still not on the same level as it was on Windows.
I've tried with Chromium and Firefox and the latter seems to work better.

VP9 works up to 4k30, 1440p60 5% dropped frames, 4k60 90% dropped frames.
AVC1 works up to 720p60, 1080p60 5% dropped frames.

Firefox flags:
media.ffmpeg.vaapi.enabled true
media.ffvpx.enabled false
media.rdd-vpx.enabled false
media.rdd-vpx.enabled true

Environment variables:
export LIBVA_DRIVER_NAME=i965
export MOZ_DISABLE_RDD_SANDBOX=1
export MOZ_X11_EGL=1

vainfo:

Code: Select all

libva info: VA-API version 1.7.0
libva info: User environment variable requested driver 'i965'
libva info: Trying to open /usr/lib/x86_64-linux-gnu/dri/i965_drv_video.so
libva info: Found init function __vaDriverInit_1_6
libva info: va_openDriver() returns 0
vainfo: VA-API version: 1.7 (libva 2.6.0)
vainfo: Driver version: Intel i965 driver for Intel(R) Kaby Lake - 2.4.0
vainfo: Supported profile and entrypoints
      VAProfileMPEG2Simple            :	VAEntrypointVLD
      VAProfileMPEG2Simple            :	VAEntrypointEncSlice
      VAProfileMPEG2Main              :	VAEntrypointVLD
      VAProfileMPEG2Main              :	VAEntrypointEncSlice
      VAProfileH264ConstrainedBaseline:	VAEntrypointVLD
      VAProfileH264ConstrainedBaseline:	VAEntrypointEncSlice
      VAProfileH264ConstrainedBaseline:	VAEntrypointEncSliceLP
      VAProfileH264Main               :	VAEntrypointVLD
      VAProfileH264Main               :	VAEntrypointEncSlice
      VAProfileH264Main               :	VAEntrypointEncSliceLP
      VAProfileH264High               :	VAEntrypointVLD
      VAProfileH264High               :	VAEntrypointEncSlice
      VAProfileH264High               :	VAEntrypointEncSliceLP
      VAProfileH264MultiviewHigh      :	VAEntrypointVLD
      VAProfileH264MultiviewHigh      :	VAEntrypointEncSlice
      VAProfileH264StereoHigh         :	VAEntrypointVLD
      VAProfileH264StereoHigh         :	VAEntrypointEncSlice
      VAProfileVC1Simple              :	VAEntrypointVLD
      VAProfileVC1Main                :	VAEntrypointVLD
      VAProfileVC1Advanced            :	VAEntrypointVLD
      VAProfileNone                   :	VAEntrypointVideoProc
      VAProfileJPEGBaseline           :	VAEntrypointVLD
      VAProfileJPEGBaseline           :	VAEntrypointEncPicture
      VAProfileVP8Version0_3          :	VAEntrypointVLD
      VAProfileVP8Version0_3          :	VAEntrypointEncSlice
      VAProfileHEVCMain               :	VAEntrypointVLD
      VAProfileHEVCMain               :	VAEntrypointEncSlice
      VAProfileHEVCMain10             :	VAEntrypointVLD
      VAProfileHEVCMain10             :	VAEntrypointEncSlice
      VAProfileVP9Profile0            :	VAEntrypointVLD
      VAProfileVP9Profile0            :	VAEntrypointEncSlice
      VAProfileVP9Profile2            :	VAEntrypointVLD
Last edited by LockBot on Wed Dec 28, 2022 7:16 am, edited 1 time in total.
Reason: Topic automatically closed 6 months after creation. New replies are no longer allowed.
User avatar
Larry78723
Level 14
Level 14
Posts: 5476
Joined: Wed Jan 09, 2019 7:01 pm
Location: Jasper County, SC, USA

Re: Hardware acceleration not working properly

Post by Larry78723 »

Without some technical information about the machine, we can’t help you. Please post an inxi -Fxpmzr report. This will give us a concise overview of your hardware and how Mint sees it per  How to get help .

Here is how to generate the report and post it:

Open a terminal window (Ctrl-Alt-t). Make it fullscreen to avoid unneeded linebreaks or chopped lines. Copy the following code and paste into the terminal (Ctrl-Shft-V) then hit Enter/Return:

Code: Select all

inxi -Fxpmrz 


Go to Edit, Select All, and then Copy, come back here, click on reply then code tags, </>, and then paste.
Image


The results will help us to help you.
Image
If you have found the solution to your initial post, please open your original post, click on the pencil, and add (Solved) to the Subject, it helps other users looking for help, and keeps the forum clean.
ohnoanyways
Level 1
Level 1
Posts: 7
Joined: Wed Jan 26, 2022 5:01 pm

Re: Hardware acceleration not working properly

Post by ohnoanyways »

Code: Select all

~$ inxi -Fxpmrz 
System:    Kernel: 5.4.0-96-generic x86_64 bits: 64 compiler: gcc v: 9.3.0 Desktop: Cinnamon 5.2.7 Distro: Linux Mint 20.3 Una 
           base: Ubuntu 20.04 focal 
Machine:   Type: Laptop System: LENOVO product: 20HR0022MX v: ThinkPad X1 Carbon 5th serial: <filter> 
           Mobo: LENOVO model: 20HR0022MX v: SDK0J40697 WIN serial: <filter> UEFI: LENOVO v: N1MET68W (1.53 ) date: 11/11/2021 
Battery:   ID-1: BAT0 charge: 27.1 Wh condition: 51.5/57.0 Wh (90%) model: SMP 01AV430 status: Charging 
Memory:    RAM: total: 7.54 GiB used: 1.11 GiB (14.7%) 
           RAM Report: permissions: Unable to run dmidecode. Root privileges required. 
CPU:       Topology: Dual Core model: Intel Core i5-7200U bits: 64 type: MT MCP arch: Amber Lake rev: 9 L2 cache: 3072 KiB 
           flags: avx avx2 lm nx pae sse sse2 sse3 sse4_1 sse4_2 ssse3 vmx bogomips: 21599 
           Speed: 800 MHz min/max: 400/3100 MHz Core speeds (MHz): 1: 801 2: 800 3: 800 4: 801 
Graphics:  Device-1: Intel HD Graphics 620 vendor: Lenovo ThinkPad X1 Carbon 5th Gen driver: i915 v: kernel bus ID: 00:02.0 
           Display: x11 server: X.Org 1.20.13 driver: modesetting unloaded: fbdev,vesa resolution: 1920x1080~60Hz 
           OpenGL: renderer: Mesa Intel HD Graphics 620 (KBL GT2) v: 4.6 Mesa 21.0.3 direct render: Yes 
Audio:     Device-1: Intel Sunrise Point-LP HD Audio vendor: Lenovo ThinkPad X1 Carbon 5th Gen driver: snd_hda_intel v: kernel 
           bus ID: 00:1f.3 
           Sound Server: ALSA v: k5.4.0-96-generic 
Network:   Device-1: Intel Ethernet I219-V vendor: Lenovo ThinkPad X1 Carbon 5th Gen driver: e1000e v: 3.2.6-k port: efa0 
           bus ID: 00:1f.6 
           IF: enp0s31f6 state: down mac: <filter> 
           Device-2: Intel Wireless 8265 / 8275 driver: iwlwifi v: kernel port: efa0 bus ID: 04:00.0 
           IF: wlp4s0 state: up mac: <filter> 
           IF-ID-1: wwan0 state: down mac: <filter> 
Drives:    Local Storage: total: 238.47 GiB used: 21.73 GiB (9.1%) 
           ID-1: /dev/nvme0n1 vendor: Toshiba model: N/A size: 238.47 GiB 
Partition: ID-1: / size: 58.42 GiB used: 10.11 GiB (17.3%) fs: ext4 dev: /dev/nvme0n1p2 
           ID-2: /boot/efi size: 475.1 MiB used: 5.2 MiB (1.1%) fs: vfat dev: /dev/nvme0n1p1 
           ID-3: /home size: 174.60 GiB used: 11.61 GiB (6.6%) fs: ext4 dev: /dev/nvme0n1p3 
Sensors:   System Temperatures: cpu: 54.0 C mobo: N/A 
           Fan Speeds (RPM): cpu: 0 
Repos:     No active apt repos in: /etc/apt/sources.list 
           Active apt repos in: /etc/apt/sources.list.d/brave-browser-release.list 
           1: deb [signed-by=/usr/share/keyrings/brave-browser-archive-keyring.gpg arch=amd64] https://brave-browser-apt-release.s3.brave.com/ stable main
           Active apt repos in: /etc/apt/sources.list.d/gerardpuig-ppa-focal.list 
           1: deb http://ppa.launchpad.net/gerardpuig/ppa/ubuntu focal main
           Active apt repos in: /etc/apt/sources.list.d/linuxuprising-java-focal.list 
           1: deb http://ppa.launchpad.net/linuxuprising/java/ubuntu focal main
           Active apt repos in: /etc/apt/sources.list.d/official-package-repositories.list 
           1: deb http://packages.linuxmint.com una main upstream import backport
           2: deb http://archive.ubuntu.com/ubuntu focal main restricted universe multiverse
           3: deb http://archive.ubuntu.com/ubuntu focal-updates main restricted universe multiverse
           4: deb http://archive.ubuntu.com/ubuntu focal-backports main restricted universe multiverse
           5: deb http://security.ubuntu.com/ubuntu/ focal-security main restricted universe multiverse
           6: deb http://archive.canonical.com/ubuntu/ focal partner
           Active apt repos in: /etc/apt/sources.list.d/protonvpn-stable.list 
           1: deb [signed-by=/usr/share/keyrings/protonvpn-stable-archive-keyring.gpg] https://repo.protonvpn.com/debian stable main
Info:      Processes: 215 Uptime: 2m Init: systemd runlevel: 5 Compilers: gcc: 9.3.0 Shell: bash v: 5.0.17 inxi: 3.0.38
UPDATE:

Tried some things and got Chromium somewhat working by adjusting flags on chrome://flags
#ignore-gpu-blocklist enabled
#enable-gpu-rasterization enabled
#enable-zero-copy enabled
#ozone-platform-hint X11

Rest of these flags couldn't find them in browser so i went and opened a terminal /usr/bin$ sudo nano chromium
Added flags:
export CHROMIUM_FLAGS="$CHROMIUM_FLAGS --disable-gpu-driver-bug-workarounds"
export CHROMIUM_FLAGS="$CHROMIUM_FLAGS --enable-accelerated-video-decode"
export CHROMIUM_FLAGS="$CHROMIUM_FLAGS --enable-features=VaapiVideoDecoder"
export CHROMIUM_FLAGS="$CHROMIUM_FLAGS --use-gl=desktop"

Image

Browser view is smooth, practically no dropped frames.
Image

Fullscreen 14% dropped frames.
Image

Despite running smoother than Firefox it uses much more CPU for some reason.
But now what, i don't know how to get it 100% smooth and whether this is a browser or driver related issue?
User avatar
SMG
Level 25
Level 25
Posts: 31971
Joined: Sun Jul 26, 2020 6:15 pm
Location: USA

Re: Hardware acceleration not working properly

Post by SMG »

ohnoanyways wrote: Sat Jan 29, 2022 6:45 amDespite running smoother than Firefox it uses much more CPU for some reason.
But now what, i don't know how to get it 100% smooth and whether this is a browser or driver related issue?
I'm not sure what driver you think might be the issue. You have already proved making changes to the Chrome software application has resulted in changes.

Browsers nowadays are full-fledged software applications and require significantly more resources than they did in the past in order to run everything they have running.

Browsers (and the videos one watches in them) are also affected by network transfer rates.

I normally suggest those with 8th-gen Intel and newer use the newer kernels. Some people (but not all) with 6th and 7th-gen Intel have also seen improvements. You could try upgrading to the 5.13 kernel in Update Manager to see if that helps improve the performance you are experiencing.

Instructions for upgrading to the 5.13 kernel:
  • Open Update Manager.
  • Select View > Linux Kernels and click Continue.
  • Make sure 5.13 is selected on the left panel and then click the top-most option on the right panel. An "Install" button will appear.
  • Install the kernel and then reboot for it to become active.
Image
A woman typing on a laptop with LM20.3 Cinnamon.
h3o
Level 1
Level 1
Posts: 21
Joined: Mon Feb 21, 2022 3:18 pm

Re: Hardware acceleration not working properly

Post by h3o »

Do any special codecs need to be installed for hardware acceleration to work on chrome?
I installed both the .deb (from the chrome website) and the flatpak (beta) and hardware acceleration only works on the flatpak. They are both the same versions (98.0.4758.102), and I'm running with the same flags. Not sure if the flatpak was built (or patched) a different way to support Vaapi playback or if it;s bundled with a codec/driver needed for Vaapi that would need to be installed separately for the .deb to function the same. I'm not that partial to .deb vs flatpak either way, but more just curious in if this can be solved with the .deb.
Locked

Return to “Beginner Questions”