Youtube high cpu

Hello, a topic not related to the distros, does anyone know why when you open YouTube the CPU consumes a lot and the temperature rises, does anyone know a solution?

thanks.

im using thorium browser, and this problem is with all browsers chrome or firefox related

How much % CPU is consumed and for how long, when you open youtube?

You can use the System Monitor utility for this. A short spike in CPU/temp usage followed by settling back to baseline levels is normal when opening youtube. But without playing any video there shouldn’t be a sustained hogging of the CPU. Even when you play a video unless you have no hardware acceleration, it shouldn’t take more than ~50% of your combined cores usage. This is my experience from both Linux and Windows on a fairly low end system (i5 Skylake). If you have better specs then CPU usage should be even lower.

1 Like

It could be that your browsers aren’t using hardware acceleration. You can check using nvtop – see if the GPU value fluctuates in your browser when playing a video. You can also compare it by playing a video in f.ex Clapper or mpv-based players.

Of course there’s also a possibility of YouTube’s ambient mode causing CPU spikes:

Here’s a guide just in case the problem is indeed hardware acceleration. This assumes Wayland; the following works on my device with AMD card and on another with Intel.

Firefox (Flatpak)

Navigate to about:support and check if you have something like this (Ctrl+F Codec Support).

If you don’t see it, navigate to about:config and search for media.ffmpeg.vaapi.enabled, then enable it if it’s not enabled yet. Restart Firefox and see if you notice any changes.

If you still don’t see GPU acceleration working, check if you have the following Flatpak packages installed: org.freedesktop.Platform.ffmpeg-full and org.freedesktop.Platform.openh264. If not, install them.

You’ll probably also want to make sure your browsers are allowed to use GPU acceleration in Flatseal. Honestly I’m not sure if this plays a part, but I always have GPU acceleration enabled for all Flatpaks by default.

Theoretically speaking these are the only things you need for Firefox hardware acceleration (ffmpeg-full, openh264, GPU acceleration permission and media.ffmpeg.vaapi.enabled in some computers).

Chromium, Chromium-based browsers (Flatpak)

Navigate to .var/app/org.chromium.Chromium/config/. Replace org.chromium.Chromium with Thorium or other browsers’ bundle name.

Create a new .conf file inside the config folder containing the following lines. For Chromium the file name would be chromium-flags.conf, I believe for Chrome it would be chrome-flags.conf and for Edge, edge-flags.conf. Not sure what it would be for other Chromium-based browsers.

--ozone-platform-hint=auto
--enable-features=VaapiVideoDecodeLinuxGL,VaapiVideoEncoder,Vulkan,DefaultANGLEVulkan,VulkanFromANGLE,WebRTCPipeWireCapturer, TouchpadOverscrollHistoryNavigation                                             
--enable-gpu-rasterization
--ignore-gpu-blocklist
--enable-zero-copy
--disable-gpu-memory-buffer-video-frames

That’s all it took for me to get these values in chrome://gpu and hardware acceleration to work. I also have the ffmpeg-full and openh264 Flatpak packages installed and allowed GPU acceleration.

5 Likes

Since Chromium 131, the VaapiVideoDecodeLinuxGL option was renamed to AcceleratedVideoDecodeLinuxGL, don’t know about the other options.

1 Like

Thanks for informing! I wasn’t aware of the change.

Is there a list of what hardware codecs are used by YouTube? I think I have hardware decoding working (Firefox flatpak on Bazzite with a nVidia 1080 card). But, my supported codecs is a bit different. I don’t have AV1 but do have VP8.

EDIT: the below is solved. I had added some environment variables with Flatseal specifying LIBVA driver and other things. Apparently this confused the software. I removed all environment variables that had the “set by user” warning icon and now it works properly:

ORIGINAL post below:


I am using Firefox and even though everything seems ok (have the flatpak packages, have enabled GPU acceleration in Flatseal, checked about:config and got the green boxes for enabled) I am concerned about the fact that it still seems to not use the GPU.

Here is my Firefox showing Hardware codecs:

Here is the GPU usage tab for the Intel Arc:

As you can see the Nvidia is completely unused, the Arc sits at about about 7% for the most part. But the CPU is at an uncomfortable 17-18% which drops to 3% when I stop the video.

So somehow it seems that even though everything “seems” ok, the hardware acceleration doesn’t actually get used on my laptop…

Anything else I could check?

P.S. On my desktop, where I have an AMD RX6800, the same setup seems to work fine: CPU usage remains <3% when playing 4K videos on YouTube, whereas the “Video Decoding” in the GPU tab of Mission Center spikes and shows 40% usage specifically in the “video decode” section of the GPU tab.

I tried to update from 41.20250227.1 to 41.20250301 and I lost all support for hardware decoding in Firefox. In about:support my “Hardware Decoding” column was all red, and playing a full-screen video in YouTube was using something like 90% CPU.

I saw that the update included a new kernel, new libnvidia modules and something like 11 different nvidia packages.

I’m happy to give more details if someone thinks they can help.

I would suggest you write a post in Firefox-specific forums, like the one I posted here.

You’re not going to get much traction if you don’t provide much info…