You are not logged in.

#1 2021-02-14 10:20:22

mitchpk
Member
Registered: 2020-04-01
Posts: 19

Youtube on Linux using twice as much power as Windows (GPU decoding)

Heading into university, I decided to purchase a new laptop for my CS degree. It's an Ideapad S540 (AMD Ryzen 4800u, integrated graphics). After installing Arch, there was a consistent problem that I didn't experience with the stock Windows installation that came with the laptop. Youtube on Arch uses about twice as much battery power as Windows, even with similar CPU usage. I have enabled hardware accelerated video decoding on Chromium, tried Firefox, switched my CPU governor from ondemand to powersave, and nothing seems to improve the discharge rate of the battery while watching videos.

Here are the values I measured by reading /sys/class/power_supply and HWinfo on Windows:

Idle: ~3.8W on both Linux and Windows
Youtube 1080p60 video: 6W on Windows and 11.6W(!) on Linux

As a last attempt, I installed Ubuntu to see if the issue was caused by my choice of packages, however the problem still occurred.

Is this a common issue? Is the mesa driver just inferior at video decoding compared to the proprietary AMD drivers in Windows?

Last edited by mitchpk (2021-02-16 09:37:52)

Offline

#2 2021-02-14 10:23:40

Head_on_a_Stick
Member
From: London
Registered: 2014-02-20
Posts: 7,680
Website

Re: Youtube on Linux using twice as much power as Windows (GPU decoding)

https://wiki.archlinux.org/index.php/Fi … celeration

EDIT: oops, sorry, you claim to have already done that. So I will instead ask for proof that it is enabled.

Last edited by Head_on_a_Stick (2021-02-14 10:26:17)

Offline

#3 2021-02-14 14:20:43

mitchpk
Member
Registered: 2020-04-01
Posts: 19

Re: Youtube on Linux using twice as much power as Windows (GPU decoding)

Head_on_a_Stick wrote:

https://wiki.archlinux.org/index.php/Fi … celeration

EDIT: oops, sorry, you claim to have already done that. So I will instead ask for proof that it is enabled.

I did not spend much time in Firefox, but I can confirm that hardware acceleration is enabled in Chromium.
Visiting chrome://media-internals, the video_decoder reports MojoVideoDecoder which indicates that the GPU is decoding video, according to https://wiki.archlinux.org/index.php/ch … celeration.

I also tried the Chromium extension h264ify to see if decoding H.264 was any different to VP9, however there was no difference in power consumption.

Offline

#4 2021-02-14 15:29:26

ewaller
Administrator
From: Pasadena, CA
Registered: 2009-07-13
Posts: 19,739

Re: Youtube on Linux using twice as much power as Windows (GPU decoding)

I always need to ask, how did you instrument the power?


Nothing is too wonderful to be true, if it be consistent with the laws of nature -- Michael Faraday
Sometimes it is the people no one can imagine anything of who do the things no one can imagine. -- Alan Turing
---
How to Ask Questions the Smart Way

Offline

#5 2021-02-14 16:27:11

mitchpk
Member
Registered: 2020-04-01
Posts: 19

Re: Youtube on Linux using twice as much power as Windows (GPU decoding)

ewaller wrote:

I always need to ask, how did you instrument the power?

On Arch I could find the battery discharge rate by reading /sys/class/power_supply/BAT0/power_now
On Windows I downloaded HWinfo which has a section that reports the discharge rate.
When the laptop is idle, both of these methods report a value of around 3.8W, which I assume is primarily from the display and network adaptor.

Offline

#6 2021-02-14 16:41:53

ewaller
Administrator
From: Pasadena, CA
Registered: 2009-07-13
Posts: 19,739

Re: Youtube on Linux using twice as much power as Windows (GPU decoding)

That all sounds reasonable.  It does presuppose you are running on batteries and that we trust what the battery tells us.

A lot of people use the estimates in powertop, but it misses the backlight power when not running on batteries.


Nothing is too wonderful to be true, if it be consistent with the laws of nature -- Michael Faraday
Sometimes it is the people no one can imagine anything of who do the things no one can imagine. -- Alan Turing
---
How to Ask Questions the Smart Way

Offline

#7 2021-02-14 16:52:36

seth
Member
Registered: 2012-09-03
Posts: 49,972

Re: Youtube on Linux using twice as much power as Windows (GPU decoding)

Do you perceive simila battery drain when playing the video w/ mpv?
(requires youtube-dl)

Edit: also check powertop on what actually draws it.

Last edited by seth (2021-02-14 16:53:32)

Online

#8 2021-02-15 03:22:46

mitchpk
Member
Registered: 2020-04-01
Posts: 19

Re: Youtube on Linux using twice as much power as Windows (GPU decoding)

seth wrote:

Do you perceive simila battery drain when playing the video w/ mpv?
(requires youtube-dl)

Edit: also check powertop on what actually draws it.

Using mpv, the power draw is slightly better at ~10W.
Here are the powertop results: https://cdn.discordapp.com/attachments/ … 134810.jpg

Last edited by mitchpk (2021-02-15 14:37:09)

Offline

#9 2021-02-15 08:09:49

seth
Member
Registered: 2012-09-03
Posts: 49,972

Re: Youtube on Linux using twice as much power as Windows (GPU decoding)

Don't post images of (portions) of text.
At least replace the oversized image w/ a link.

I'd start by losing gnome (and frankly pulseaudio) and compare windows to eg. openbox (browser or "mpv -ao alsa", latter will skip pulseaudio)
Do you btw. run gnome on X11 or on wayland?

loginctl session-status

Online

#10 2021-02-16 03:12:05

mitchpk
Member
Registered: 2020-04-01
Posts: 19

Re: Youtube on Linux using twice as much power as Windows (GPU decoding)

seth wrote:

Don't post images of (portions) of text.
At least replace the oversized image w/ a link.

I'd start by losing gnome (and frankly pulseaudio) and compare windows to eg. openbox (browser or "mpv -ao alsa", latter will skip pulseaudio)
Do you btw. run gnome on X11 or on wayland?

loginctl session-status

Using i3 with mpv and no pulseaudio results in ~8.5W, however the powertop results are still dominated by dbs_work_handler and tick_sched_timer.
I have been using X11, however trying gnome with wayland produces similar results of around 10W.

Offline

#11 2021-02-16 08:49:39

seth
Member
Registered: 2012-09-03
Posts: 49,972

Re: Youtube on Linux using twice as much power as Windows (GPU decoding)

dominated by dbs_work_handler and tick_sched_timer

What does that mean? How much do they exactly draw?
How much in comparism when *not* playing a video?

Thos are CPU management tasks, wakeups, schedulers, etc.

Does power_now support the overall draw when *not* running powertop?

Online

Board footer

Powered by FluxBB