Optimization for laptop manjaro i3

Hi there,
I’ve been searching for a while, unfortunately I couldn’t find a fix.

I have a laptop: Lenovo C340-14API
CPU: Ryzen 3 3200U
GPU: Radeon Vega Mobile Gfx
Ram: 8GB but split 6GB for system and at least 2GB for GPU
Dual boot: Win 10 / Manjaro
Manjaro: WM → i3WM 4.20.1
Kernel: 5.15.32-1
GPU drivers: Open source

There are 2 problems.

one of them is when the laptop is on charge, the temperature rises and makes the fan go nuts.
Which doesn’t happen when in win10.
Is there a way to fix that? the sound is annoying and the temperature is worrying.

The other problem comes from firefox.
The CPU usage jumps up to 90% sometimes just for search.
But most of the time it’s on youtube that the CPU goes that high.
In win10 it never goes above 53%

On Manjaro i3 on my desktop, it never goes above 34%
but sure it’s a bit more powerful with a proper GPU.

I tried to remove all extensions in firefox but it didn’t do anything.
when the youtube video is in the background, the cpu usage drops in the 15% But as soon as it’s back on the for front, it jumps again at 70% to 90%.

Is there a way to fix that?

Let me know if you need any additional info.

provide formated output from:
inxi -Fazy
mhwd -l
mhwd -li

1 Like

That might be happening because firefox uses GPU acceleration on Win10.

Have look here: https://wiki.archlinux.org/title/Firefox#Hardware_video_acceleration

inxi -Fazy
System:
  Kernel: 5.15.32-1-MANJARO arch: x86_64 bits: 64 compiler: gcc v: 11.2.0
    
  Desktop: i3 v: 4.20.1 info: i3bar vt: 7 dm: LightDM v: 1.30.0
    Distro: Manjaro Linux base: Arch Linux
Machine:
  Type: Laptop System: LENOVO product: 81N6 v: Lenovo IdeaPad C340-14API
    serial: <superuser required> Chassis: type: 10 v: Lenovo IdeaPad C340-14API
    serial: <superuser required>
  Mobo: LENOVO model: LNVNB161216 v: SDK0J40700 WIN
    serial: <superuser required> UEFI: LENOVO v: AGCN28WW(V1.11)
    date: 01/27/2021
Battery:
  ID-1: BAT1 charge: 35.0 Wh (94.9%) condition: 36.9/45.0 Wh (81.9%)
    volts: 16.4 min: 15.4
    model: 0x43 0x65 0x6C 0x78 0x70 0x 0x4C 0x31 0x38 0x43 0x34 0x50 0x4500
    type: Li-ion serial: <filter> status: discharging cycles: 60
CPU:
  Info: model: AMD Ryzen 3 3200U with Radeon Vega Mobile Gfx bits: 64
    type: MT MCP arch: Zen/Zen+ note: check family: 0x17 (23)
    model-id: 0x18 (24) stepping: 1 microcode: 0x8108109
  Topology: cpus: 1x cores: 2 tpc: 2 threads: 4 smt: enabled cache:
    L1: 192 KiB desc: d-2x32 KiB; i-2x64 KiB L2: 1024 KiB desc: 2x512 KiB
    L3: 4 MiB desc: 1x4 MiB
  Speed (MHz): avg: 1363 high: 1386 min/max: 1400/2600 boost: enabled
    scaling: driver: acpi-cpufreq governor: powersave cores: 1: 1386 2: 1313
    3: 1379 4: 1375 bogomips: 20770
  Flags: avx avx2 ht lm nx pae sse sse2 sse3 sse4_1 sse4_2 sse4a ssse3 svm
  Vulnerabilities:
  Type: itlb_multihit status: Not affected
  Type: l1tf status: Not affected
  Type: mds status: Not affected
  Type: meltdown status: Not affected
  Type: spec_store_bypass
    mitigation: Speculative Store Bypass disabled via prctl and seccomp
  Type: spectre_v1
    mitigation: usercopy/swapgs barriers and __user pointer sanitization
  Type: spectre_v2
    mitigation: Retpolines, IBPB: conditional, STIBP: disabled, RSB filling
  Type: srbds status: Not affected
  Type: tsx_async_abort status: Not affected
Graphics:
  Device-1: AMD Picasso/Raven 2 [Radeon Vega Series / Radeon Mobile Series]
    vendor: Lenovo driver: amdgpu v: kernel pcie: gen: 3 speed: 8 GT/s lanes: 16
    ports: active: eDP-1 empty: HDMI-A-1 bus-ID: 03:00.0 chip-ID: 1002:15d8
    class-ID: 0300
  Device-2: Acer Integrated Camera type: USB driver: uvcvideo bus-ID: 1-4:2
    chip-ID: 5986:2115 class-ID: 0e02
  Display: x11 server: X.Org v: 1.21.1.3 driver: X: loaded: amdgpu
    unloaded: modesetting alternate: fbdev,vesa gpu: amdgpu display-ID: :0
    screens: 1
  Screen-1: 0 s-res: 1920x1080 s-dpi: 96 s-size: 508x285mm (20.00x11.22")
    s-diag: 582mm (22.93")
  Monitor-1: eDP-1 mapped: eDP model: BOE Display 0x07d3 built: 2018
    res: 1920x1080 hz: 60 dpi: 158 gamma: 1.2 size: 309x174mm (12.17x6.85")
    diag: 355mm (14") ratio: 16:9 modes: max: 1920x1080 min: 640x480
  Message: Unable to show GL data. Required tool glxinfo missing.
Audio:
  Device-1: AMD Raven/Raven2/Fenghuang HDMI/DP Audio vendor: Lenovo
    driver: snd_hda_intel v: kernel pcie: gen: 3 speed: 8 GT/s lanes: 16
    bus-ID: 03:00.1 chip-ID: 1002:15de class-ID: 0403
  Device-2: AMD ACP/ACP3X/ACP6x Audio Coprocessor vendor: Lenovo
    driver: snd_pci_acp3x v: kernel alternate: snd_rn_pci_acp3x,snd_pci_acp5x
    pcie: gen: 3 speed: 8 GT/s lanes: 16 bus-ID: 03:00.5 chip-ID: 1022:15e2
    class-ID: 0480
  Device-3: AMD Family 17h/19h HD Audio vendor: Lenovo driver: snd_hda_intel
    v: kernel pcie: gen: 3 speed: 8 GT/s lanes: 16 bus-ID: 03:00.6
    chip-ID: 1022:15e3 class-ID: 0403
  Sound Server-1: ALSA v: k5.15.32-1-MANJARO running: yes
  Sound Server-2: JACK v: 1.9.20 running: no
  Sound Server-3: PulseAudio v: 15.0 running: yes
Network:
  Device-1: Realtek RTL8822BE 802.11a/b/g/n/ac WiFi adapter
    vendor: Lenovo ThinkPad E595 driver: rtw_8822be v: N/A modules: rtw88_8822be
    pcie: gen: 1 speed: 2.5 GT/s lanes: 1 port: 2000 bus-ID: 02:00.0
    chip-ID: 10ec:b822 class-ID: 0280
  IF: wlp2s0 state: up mac: <filter>
Bluetooth:
  Device-1: Realtek RTL8822BE Bluetooth 4.2 Adapter type: USB driver: btusb
    v: 0.8 bus-ID: 1-6:4 chip-ID: 0bda:b023 class-ID: e001 serial: <filter>
  Report: bt-adapter ID: hci0 rfk-id: 2 state: up address: <filter>
Drives:
  Local Storage: total: 298.09 GiB used: 135.34 GiB (45.4%)
  SMART Message: Unable to run smartctl. Root privileges required.
  ID-1: dev/sda maj-min: 8:0 vendor: Samsung model: MZNLN256HAJQ-000L2
    size: 238.47 GiB block-size: physical: 4096 B logical: 512 B speed: 6.0 Gb/s
    type: SSD serial: <filter> rev: 4L0Q scheme: GPT
  ID-2: dev/sdb maj-min: 8:16 type: USB vendor: SanDisk model: Cruzer Force
    size: 59.62 GiB block-size: physical: 512 B logical: 512 B type: N/A
    serial: <filter> rev: 1.27 scheme: MBR
  SMART Message: Unknown USB bridge. Flash drive/Unsupported enclosure?
Partition:
  ID-1: raw-size: 40.04 GiB size: 39.16 GiB (97.81%) used: 20.6 GiB (52.6%)
    fs: ext4 dev: /dev/sda7 maj-min: 8:7
  ID-2: boot/efi raw-size: 512 MiB size: 511 MiB (99.80%)
    used: 308 KiB (0.1%) fs: vfat dev: /dev/sda5 maj-min: 8:5
  ID-3: home raw-size: 70.29 GiB size: 68.68 GiB (97.72%)
    used: 39.36 GiB (57.3%) fs: ext4 dev: /dev/sda8 maj-min: 8:8
Swap:
  Kernel: swappiness: 60 (default) cache-pressure: 100 (default)
  ID-1: swap-1 type: partition size: 2 GiB used: 0 KiB (0.0%) priority: -2
    dev: dev/sda6 maj-min: 8:6
Sensors:
  System Temperatures: cpu: N/A mobo: N/A gpu: amdgpu temp: 40.0 C
  Fan Speeds (RPM): N/A
Info:
  Processes: 230 Uptime: 2m wakeups: 3 Memory: 5.8 GiB used: 1.98 GiB (34.2%)
  Init: systemd v: 250 tool: systemctl Compilers: gcc: 11.2.0 clang: 13.0.1
  Packages: pacman: 1309 lib: 346 Shell: Zsh v: 5.8.1 running-in: urxvt
  inxi: 3.3.15


mhwd -l 
0000:03:00.0 (0300:1002:15d8) Display controller ATI Technologies Inc:
--------------------------------------------------------------------------------
                  NAME               VERSION          FREEDRIVER           TYPE
--------------------------------------------------------------------------------
           video-linux            2018.05.04                true            PCI
     video-modesetting            2020.01.13                true            PCI
            video-vesa            2017.03.12                true            PCI

mhwd -li

 Installed PCI configs:
--------------------------------------------------------------------------------
                  NAME               VERSION          FREEDRIVER           TYPE
--------------------------------------------------------------------------------
           video-linux            2018.05.04                true            PCI


Warning: No installed USB configs!

How could it heat up, when it is running in powersave mode? So at lowest freq?

good questions.
Beats me.
Only thing I can tell you is when that laptop is plugged in, the fan go nuts here and there.
which never happens under win10

and if you check logs:
journalctl --boot -0 --no-pager

oright, thanks.
just went through the whole thing (the Archlinux wiki about firefox hardware acceleration) and set bunch of stuff true and others false.
Unfortunately, the behavior is still there.
tried it with the same video, 1080p and still youtube gives me 70% to 90% usage just to play the video.

Run this at the terminal:

watch -n1 cat /sys/devices/system/cpu/cpu*/cpufreq/scaling_governor

Plug in and plug out. Maybe it changes.

ok, I tried journalctl --boot -0 --no-pager,
got long text. what am i looking for there?

for some spamming first - repeated messages
some errors - red and orange color

I got this in red:

Apr 24 17:34:41 sipl-pc lightdm[865]: gkr-pam: unable to locate daemon control file

in orange:

Apr 24 17:34:33 sipl-pc kernel: [drm] failed to load ucode RLC_RESTORE_LIST_CNTL(0x11) 
Apr 24 17:34:33 sipl-pc kernel: [drm] psp gfx command LOAD_IP_FW(0x6) failed and response status is (0xFFFF300F)
Apr 24 17:34:33 sipl-pc kernel: [drm] failed to load ucode RLC_RESTORE_LIST_GPM_MEM(0x12) 
Apr 24 17:34:33 sipl-pc kernel: [drm] psp gfx command LOAD_IP_FW(0x6) failed and response status is (0xFFFF000F)
Apr 24 17:34:33 sipl-pc kernel: [drm] failed to load ucode RLC_RESTORE_LIST_SRM_MEM(0x13) 
Apr 24 17:34:33 sipl-pc kernel: [drm] psp gfx command LOAD_IP_FW(0x6) failed and response status is (0xFFFF000F)

Apr 24 17:34:33 sipl-pc kernel: amdgpu 0000:03:00.0: amdgpu: PSP runtime database doesn't exist

there doesn’t seem to be repeated messages

for:

watch -n1 cat /sys/devices/system/cpu/cpu*/cpufreq/scaling_governor

plugging and unplugging, have 4 lines of “powersave”

About the CPU load… just mentioned above, Try to enable GPU acceleration in Firefox. Also experiment with governors:

sudo cpupower frequency-info
sudo cpupower frequency-set -g conservative
sudo cpupower frequency-set -g ondemand
sudo cpupower frequency-set -g performance
sudo cpupower frequency-set -g schedutil
sudo cpupower frequency-set -g userspace

ok so I followed the Arch linux wiki to enable harware video acceleration in Firefox.
And i experimented with the governors.
Unfortunately not much luck.
I keep getting 70% to 90% CPU usage.

if you run firefox from terminal, and checking the logs there

I typed firefox in terminal which launched a new instance of firefox but it didn’t leave any trail in terminal. Am I missing something?

close completely firefox, then run it from terminal, play a video and check…
then close all programs, open some app that you have that monitors processess and check which one are consuming most

ok so I must be missing something.
I killed firefox process completely then typed firefox in terminal. Same thing, it launches firefox but doesn’t show anything like when you launch an app and it gives you some details.

I also launched the same video with firefox and used HTOP in terminal and there are like 8 firefox processes running the first one being the most cpu hungry.

yes there should be some info in teminal after you started firefox… hava no idea … maybe its related to i3? … you can try booting a liveusb of manjaro kde/gnome/xfce and try in the live session the performance… also switching kernel to the newest 5.17 or some older one 5.10 could be worth a try