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.

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.

| improve this answer | |
  • 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. – Thuat Nguyen Mar 11 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 – Vasiliy Ivashin Mar 11 at 18:18
  • 2
    @ThuatNguyen you don't need VDPAU for Intel GPU, that's for Nvidia only AFAIK. – Vasiliy Ivashin Mar 11 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 – Vasiliy Ivashin Mar 11 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! – Vasiliy Ivashin Mar 11 at 21:37
9

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

| improve this answer | |
  • 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 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 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 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 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.

| improve this answer | |
  • 3
    Kubuntu is the offical Ubuntu flavor for KDE. – All Workers Are Essential Mar 11 at 16:12
  • 1
    Yes, and the OP seemed interested in trying a lighter desktop. – Kurankat Mar 11 at 20:24
-1

Kubuntu uses KDE Plasma desktop environment that is why it is resourse hugry. But don't worry you can easily install comperatively lighter desktop environment.

To install cinnamon:

sudo apt install cinnamon

or to install lxqt:(most lightweight)

sudo apt install lxqt

Reboot your computer and click on gear icon while on login screen and select newly installed desktop environment.

| improve this answer | |
  • 13
    I disagree. Not only is Plasma not very resource-hungry for RAM, it is also not (in my experience) more resource hungry for processor time. Cinnamon in my experience is a relatively resource-hungry desktop, and LXDE is a minimalist desktop that I would not recommend to someone used to the functionality of Gnome, Plasma or Cinnamon. Additionally, to install Cinnamon desktop is a fair bit more complicated than this. Have a look here for more info: linuxconfig.org/… – Kurankat Mar 10 at 21:44
  • 2
    LXQt is the new Lubuntu desktop, replacing LXDE. It is lighter than LXDE. – K7AAY Mar 10 at 22:02
  • 3
    @Kurankat It's not that complicated when you are using Kubuntu. Kubuntu uses the Universe repository by default so there is no need to enable the repository like the tutorial you reference. Also, cinnamon appears to be sort of a metapackage that pulls pretty much all the same dependencies as cinnamon-desktop-environment. – mchid Mar 11 at 0:40
  • 2
    That is kind of maybe possible. But KDE's resource appetite should have little to do with the interpretation of encoded videos. Rather, this sounds like the software is doing software decoding rather than accelerating with hardware. Or that you are, as mentioned by @chrylis -on strike- that the graph in windows is total processor load, vs single core. While KDE is more resource hungry than a lot of it's competitors it's not that bad, not by a Longshot. – rasmus91 Mar 11 at 7:36
  • 7
    Sorry, but the point of using Kubuntu is running KDE. – Martin Schröder Mar 11 at 8:10

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.