32

I am just moving to Kubuntu from Windows. And i feel that browsers on Kubuntu cost so much CPU to work.

Example: When I watch Youtube:

  • In windows, CPU is around 12%.
  • In Kubuntu, CPU is around 50%. Same result w/18.04 & 19.10, plus Ubuntu 18.04.

Or When I surf the Web, especially when I watch video or listen song, CPU on Kubuntu is always higher.

I tried Firefox, Chrome, Chromium but the CPU usage is always too high.

And here is my PC's information:

  • Intel core I5-6200U
  • VGA Intel HD Graphics 520
  • 4GB Ram

Have anybody know how to solve this issue? Please help me. Thank you so much.

1
  • 1
    Comments are not for extended discussion; this conversation has been moved to chat.
    – Thomas Ward
    Mar 13, 2020 at 16:49

3 Answers 3

47

The main reason you're seeing higher CPU consumption is the lack of hardware acceleration of video-related functions: mostly video decoding and possibly rendering. Intel's open source GPU drivers are of great quality and support these features, however browsers have some troubles implementing support.

The following information is to my best knowledge as of March 11 2020:

GPU acceleration

Both Firefox and Chrome/Chromium support GPU acceleration for rendering, but it is not enabled by default.

Firefox

You need to enable two things: Off-Main-Thread Compositing (OMTC) and WebRender.

I personally have the next settings in about:config:

layers.acceleration.force-enabled = true
gfx.webrender.all = true
gfx.webrender.compositor = true
gfx.webrender.enabled = true
dom.webgpu.enabled = true

That results in everything in about:support's Decision Log is enabled. But you might need to experiment with the settings to get a combination that works for you, because some hardware/driver combinations might experience problems.

Chrome/Chromium

GPU acceleration needs to be enabled by setting browser feature flags. chromium-flags.conf might not work depending on your browser version, but the same flags are available through chrome://flags.

My personal configuration has these flags:

--ignore-gpu-blacklist
--enable-gpu-rasterization
--enable-oop-rasterization
--enable-native-gpu-memory-buffers
--enable-zero-copy
--enable-accelerated-mjpeg-decode
--enable-accelerated-video

That results in all features in chrome://gpu being green, enabled and hardware accelerated, except for Vulkan. Once again that may vary depending on you hardware, drivers and even browser version, so experiment and find the settings that work for you.

Video decoding

No browsers implement hardware video decoding by default. Good news is that is about to change.

Firefox

Next Firefox version (75) will ship GPU video decoding feature under Wayland. You'll probably have to enable it manually.

Chromium

There is a patch for Chromium that enables GPU video decoding, but it is not merged into the main branch. That means you have to install a special version from a PPA.

13
  • 1
    Thank you so much but it does not really work on Kubuntu 19.10 but I will try your guide again on Kubuntu 18.04. Mar 11, 2020 at 14:51
  • 1
    @sudodus Just tested in Kubuntu 19.10. Got everything working in a few minutes. Firefox required switching on a few flags in about:config. chromium-flags.conf did not work, but pretty much all those settings are available through chrome://flags Mar 11, 2020 at 18:18
  • 2
    @ThuatNguyen you don't need VDPAU for Intel GPU, that's for Nvidia only AFAIK. Mar 11, 2020 at 18:30
  • 3
    @ThuatNguyen Basically install Chromium from PPA and VAAPI driver, go to chrome://flags and switch on ignore-gpu-blacklist, enable-gpu-rasterization, enable-oop-rasterization, enable-zero-copy, disable-accelerated-video-decode. Restart browser and check chrome://gpu. It should be mostly green. Then start a Youtube video and check chrome://media-internals - it should say kVideoDecoderName=MojoVideoDecoder Mar 11, 2020 at 18:39
  • 2
    @ThuatNguyen In Firefox I have: layers.acceleration.force-enabled = true, gfx.webrender.all = true, gfx.webrender.compositor = true, gfx.webrender.enabled = true, dom.webgpu.enabled = true, so that everything in about:support's Decision Log is enabled. Videos still eat up CPU due to to SW decoding, but overall experience is smoother. Cheers! Mar 11, 2020 at 21:37
10

I'd blame the video drivers ...

On windows it is known that most video codecs shove work if possible to the graphics card away from CPU, and typically manufacturers spend much more time optimizing windows-drivers than any other.

Especially open source drivers where they would have to reveal their optimizations to any competitor. And you mention specifically video playback

4
  • 1
    This irony is quite funny - a regular, layman user that tries to speed up their computer by moving to Linux might end up with a slower machine because of not-so-efficient drivers.
    – T. Sar
    Mar 13, 2020 at 12:58
  • But the true part is that you can "recover" older weaker computers by using Linux that supports the older hardware and uses overall less resources than a modern windows
    – eagle275
    Mar 16, 2020 at 8:37
  • Will this computer appear faster for what the user wants to do, tho? A poorly configured browser (somewhat of the default, when dealing with out-of-the-box mainstream browsers for Linux) can make things even worse than just running modern windows.
    – T. Sar
    Mar 16, 2020 at 8:47
  • In this case yes - I was more referring to salvaging your (many-)years old computer to be a print- or cloud-server
    – eagle275
    Mar 16, 2020 at 9:02
1

One possible issue is problems when having multiple desktops installed with all sharing the same home folder. Settings changed in one can affect another. Less so a problem with Gnome vs. Plasma, for example, but more likely in multiple desktops with the same underlying base (i.e. Unity, Gnome, Cinnamon). I've had minor issues with Unity & Gnome, for example.

You are likely to get the best user experience by installing an official flavour with your preferred desktop, if one exists. I would suggest preparing some Live USBs with the flavours you'd like to try (Lubuntu, Xubuntu... have you tried Mate, it is also lightweight and very polished), testing things in the live USB, and then installing the flavour you like best.

At the end of the day, though, I suspect that @sudodus is correct, and the Intel GPU drivers just aren't as good for Linux (a not uncommon situation). If this is the case you might not see any improvement changing desktop environment.

2
  • 3
    Kubuntu is the offical Ubuntu flavor for KDE. Mar 11, 2020 at 16:12
  • 1
    Yes, and the OP seemed interested in trying a lighter desktop.
    – Kurankat
    Mar 11, 2020 at 20:24

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .