Linux – High CPU usage while playing a YouTube video

browsercpulinux-mintvideo

I have installed Linux Mint 18.2 Cinnamon (kernel: 4.10.0-32-generic) on my new ASUS UX430UA notebook. It has Intel Core i5-7200U, integrated graphics only – Intel HD Graphics 620 and 8 GB of operating memory.

I noticed that when I'm playing YouTube video, even when it is minimized, it has high CPU usage – around 40% of each CPU core with 720p@25 video. Compared to my previous notebook – MSI GE60 2OC with Intel Core i5-4200M it is four times more. Intel Core i5-7200U should be even a bit faster (tried benchmarks proven this to me).

What I tried:

  • different web browser – all have this issue for me
  • check CPU throttling
  • custom compiled Chromium from public repository with forced HW decoder (also set in chrome://flags) – in chrome://media-internals was written that I am using HW decoder
  • install recent intel-microcode
  • try different Linux distribution

Is it normal with this configuration (which I don't think) or can you tell me what I am missing?

EDIT:

All tested web browsers runs very strange in this issue. When I launch them first time after boot and load page with video from YouTube, CPU usage stays about 40 seconds of video playing at 5% per core. After, it increases to 40% per core. Then even when I launch any others web browser or the same one again, playing video consumes 40% of each core usage. No web browser background processes are running by my research.

EDIT 2:

It seems that installing i965-va-driver package helps with playing videos with local video players as xplayer and more effective with vlc. Strange is that my old laptop MSI didn't require installing something like that and plays videos with local video players even a bit more effective (lower CPU usage) – I don't think that in LiveCD OS uses a dedicated GPU (in my case Nvidia GT750M) for HW video decoding. Installing that package also helps a bit with playing videos on YouTube with custom compiled Chromium with forced HW video decoding, but I believe there is still much to improve.

I hope that this all is caused by newer hardware and it will get some support in this area later.

Best Answer

Problem is not in way of video decoding or compatibility with used desktop environment. I found that problem is in CPU governor (I found it from my another question). Both notebooks ASUS and MSI are using pstate to driving CPU frequency scaling. However, frequency on MSI is higher than ASUS in the same circumstances, so CPU usage on ASUS must be higher to product the same processing power (explain original question and EDIT 2). It is probably caused by that MSI has i5-4200M, whereas ASUS has i5-7200U, which should be powersave processor compared to i5-4200M, so it holds frequency as low as possible. Also, I don't know why, but one minute after boot, ASUS holds its CPU frequency on the maximum (explain EDIT comment).

Solution:

It really doesn't exist, because it is not problem at all. It is powersafe (but also quite powerful) processor, so power consumption is also important. However, if it is really required to hold this processor on the maximum frequency and see beautiful numbers in CPU usage, it is possible to change CPU governor from powersave to performance - look on the Internet (but remember that your CPU must be driven by pstate).

Related Question