CPU 100% most of the time after upgrade to 21.05 (Plasma5 desktop)

Hi, new NixOS user here using Plasma5 desktop. 21.05 upgrade came out in less than a month after I installed NixOS 20.09, so not much experience for any proper comparisons. However, I have issue with high CPU load under 21.05, which is making desktop unusable.

Firstly, it takes way too long to reach desktop from SDDM but then, once desktop comes, each and every program I launch takes ages (from desktop users perspective) to load. When I checked system monitor, CPU shows almost always at 100%, esp when an application is launched. See sample screenshot.

As can be seen, I don’t have issue with memory (4-5 applications open including firefox, at the time of screenshot). I checked ‘top’ and saw two programs .kwin_x11 and X were always around 20-26% of CPU.

I am currently booted into 20.09 and system is ‘normal’. See screenshot.

Thanks in advance for any assistance.

1 Like

Hi

And the “Process Table” tab, from “System Monitor”, when you look at the column “CPU %”, and sort that column, by clicking on the name of the column, then showing a “CPU % ^”, show which processes on the top?

1 Like

@M12 it is the -wrapped process for each application I’m launching with .ksysguard-wrap and kwin_x11 and X following them.

Some things I noticed now though.

  1. There is difference between what top and ksysguard show, with top percent values almost double. See attached.
  2. Without firefox, the CPU usage comes down after quite some time (?) but with firefox it stays 100% for very long (see 3).
  3. I don’t know how long is very long because when I wanted to reply to you initially I could not, due to mentioned issue. Then I left to have food. When I returned the screen was locked. Upon lock, now even with firefox (and 5 other programs) open, the system is usable (although CPU stays for most part above 60%).

Sorry if it sounds more like a story; I do not know how else to explain. One thing though, I have Kubuntu 21.10 (devel, plasma ver. 5.21), Ubuntu MATE and Lubuntu on the same laptop and I dont have any such issue. Well, actually I don’t have issue on 20.09 as well.

Following are my system specs if that helps.

[saivinob@nixos:~]$ inxi -ACDMNSG
System:
  Host: nixos Kernel: 5.10.37 x86_64 bits: 64 Desktop: KDE Plasma 5.21.5 
  Distro: NixOS 21.05.740.aa576357673 (Okapi) 
Machine:
  Type: Laptop System: HP product: HP Laptop 14-bs0xx 
  v: Type1ProductConfigId serial: <superuser required> 
  Mobo: HP model: 8320 v: 19.16 serial: <superuser required> UEFI: Insyde 
  v: F.30 date: 11/07/2017 
CPU:
  Info: Dual Core model: Intel Celeron N3060 bits: 64 type: MCP cache: 
  L2: 1024 KiB 
  Speed: 480 MHz min/max: 480/2480 MHz Core speeds (MHz): 1: 480 2: 480 
Graphics:
  Message: No device data found. 
  Device-1: Chicony HP Webcam type: USB driver: uvcvideo 
  Display: x11 server: X.org 1.20.11 driver: loaded: N/A 
  resolution: <missing: xdpyinfo> 
  Message: Unable to show advanced data. Required tool glxinfo missing. 
Audio:
  Device-1: HDA Intel PCH driver: HDA-Intel 
  Sound Server-1: ALSA v: k5.10.37 running: yes 
  Sound Server-2: PulseAudio v: 14.2-rebootstrapped running: yes 
Network:
  Message: No device data found. 
Drives:
  Local Storage: total: 596.17 GiB used: 19.28 GiB (3.2%) 
  ID-1: /dev/sda vendor: Samsung model: HM641JI size: 596.17 GiB

Edit: I noticed some ‘no device data found’ entry. If they are required, please let me know how I can get them.

when you only “upgrade” via channel change

  • e.g. the “old” UI state will stay (how could you clean everything)?

What if you install 21.05 new/clean?

inxi tells you, a required tool is missing: glxinfo and xdpyinfo

You could install them via /etc/nixos/configuration.nix or via commandline in a terminal:

nix-shell -p glxinfo
nix-shell -p xorg.xdpyinfo

Also you could try:

sudo inxi

to gain access to more info as superuser

Could you post your /etc/nixos/configuration.nix ?

What is the output of terminal command:

sudo nix-channel --list

And how did you upgrade? (with which commands?)

You could also have a look at the logs, try for example in a terminal:

journalctl -b -p err

and have a look if it shows something of interest

Hi, sorry for late reply. The rains had disrupted network in my place.

@igel, yes I can try to do a clean install to test.

@M12, I installed glxinfo and xdpyinfo and it only provided following additional info.

Graphics:
Message: No device data found.
Device-1: Chicony HP Webcam type: USB driver: uvcvideo
Display: x11 server: X.Org 1.20.11 driver: loaded: N/A
resolution: 1366x768~60Hz
OpenGL: renderer: Mesa DRI Intel HD Graphics 400 (BSW) v: 4.6 Mesa 21.0.1

Here it is,

# Edit this configuration file to define what should be installed on
# your system.  Help is available in the configuration.nix(5) man page
# and in the NixOS manual (accessible by running ‘nixos-help’).

{ config, pkgs, ... }:

{
  imports =
    [ # Include the results of the hardware scan.
      ./hardware-configuration.nix
    ];

  # Use the systemd-boot EFI boot loader.
  boot.loader.systemd-boot.enable = true;
  boot.loader.efi.canTouchEfiVariables = true;

   networking.hostName = "nixos"; # Define your hostname.
  # networking.wireless.enable = true;  # Enables wireless support via wpa_supplicant.
  networking.networkmanager.enable = true; # using NetworkManager

  # Set your time zone.
  # time.timeZone = "Europe/Amsterdam";
  time.timeZone = "Asia/Kolkata";

  # The global useDHCP flag is deprecated, therefore explicitly set to false here.
  # Per-interface useDHCP will be mandatory in the future, so this generated config
  # replicates the default behaviour.
  networking.useDHCP = false;
  networking.interfaces.eno1.useDHCP = true;
  networking.interfaces.wlo1.useDHCP = true;

  # Configure network proxy if necessary
  # networking.proxy.default = "http://user:password@proxy:port/";
  # networking.proxy.noProxy = "127.0.0.1,localhost,internal.domain";

  # Select internationalisation properties.
  # i18n.defaultLocale = "en_US.UTF-8";
   console = {
     font = "Lat2-Terminus16";
     keyMap = "us";
   };

  # Enable the Plasma 5 Desktop Environment.
  services.xserver.enable = true;
  services.xserver.displayManager.sddm.enable = true;
  services.xserver.desktopManager.plasma5.enable = true;
  

  # Configure keymap in X11
   services.xserver.layout = "us";
  # services.xserver.xkbOptions = "eurosign:e";

  # Enable CUPS to print documents.
  # services.printing.enable = true;

  # Enable sound.
   sound.enable = true;
   hardware.pulseaudio.enable = true;

  # Enable touchpad support (enabled default in most desktopManager).
   services.xserver.libinput.enable = true;

  # Define a user account. Don't forget to set a password with ‘passwd’.
  # users.users.jane = {
  #   isNormalUser = true;
  #   extraGroups = [ "wheel" ]; # Enable ‘sudo’ for the user.
  # };
  users.users.saivinob = {
    isNormalUser = true;
    extraGroups = [ "wheel" "networkmanager" ];
  };

  # List packages installed in system profile. To search, run:
  # $ nix search wget
   environment.systemPackages = with pkgs; [
     emacs-nox wget vim
     firefox
   ];

  # Some programs need SUID wrappers, can be configured further or are
  # started in user sessions.
  # programs.mtr.enable = true;
  # programs.gnupg.agent = {
  #   enable = true;
  #   enableSSHSupport = true;
  # };

  # List services that you want to enable:

  # Enable the OpenSSH daemon.
  # services.openssh.enable = true;

  # Open ports in the firewall.
  # networking.firewall.allowedTCPPorts = [ ... ];
  # networking.firewall.allowedUDPPorts = [ ... ];
  # Or disable the firewall altogether.
  # networking.firewall.enable = false;

  # This value determines the NixOS release from which the default
  # settings for stateful data, like file locations and database versions
  # on your system were taken. It‘s perfectly fine and recommended to leave
  # this value at the release version of the first install of this system.
  # Before changing this value read the documentation for this option
  # (e.g. man configuration.nix or on https://nixos.org/nixos/options.html).
  system.stateVersion = "20.09"; # Did you read the comment?

}

Following are channel(s).

[saivinob@nixos:~]$ sudo nix-channel --list
nixos https://nixos.org/channels/nixos-21.05
nixos-legacy https://nixos.org/channels/nixos-20.09

As you can see I have (I kept 20.09 by renaming it). Does this really affect?

I upgraded following directions in the manual. i.e., running following (as root):

nix-channel --add https://nixos.org/channels/nixos-21.05 nixos
nixos-rebuild switch --upgrade

This is what I get if I try the given command.

– Journal begins at Sun 2021-05-30 10:57:57 IST, ends at Thu 2021-06-10 21:46:06 IST. –
Jun 10 19:55:42 nixos dhcpcd[739]: timed out
Jun 10 19:56:19 nixos pulseaudio[1037]: GetManagedObjects() failed: org.freedesktop.DBus.Error.ServiceUnknown: The name org.bluez was not provided by any .service files