Random High CPU usage and Stuttering

Good morning,
I’m relatively new to Linux in general and decided to come from Windows a couple of days ago.

So I got two problems but the one that is keeping me from using it properly and making it feel sluggish is my CPU using a ton of performance every now and then.
In AwesomeWM (yes, I tried a couple for fun) it was so bad that the freezes happened every 5 to 10 seconds, and when it froze it just typed the last letter it registered before freezing twice which made writing nearly impossible.
In i3 the lag happens less often and it doesn’t double-type the letters. It just freezes and I can continue typing as if nothing happened.

I can see when using htop that the culprit is this command:

/usr/lib/Xorg :0 -seat seat0 -auth /run/lightdm/root/:0 -nolisten tcp vt7 -notswitch

My guess is that I messed up something with the Nvidia driver to use my Graphics card (RTX 3050Ti) when following the instructions from the following forum post:

The second problem with the optimus switch is that I’m not allowed to use the scripts provided by that. If I type sudo set-intel.sh it will tell me that it configured it to intel … and then on the next start it will just be stuck in the blackscreen where I could (technically) activate tty. Sadly I can’t activate tty to try and revert it because the tty-terminal gets shown for only a second and then returns to that black screen with the blinking cursor in the top left corner.

Thank you in advance!

Greetings! And welcome to the EndeavourOS forums.

Sorry to hear about your freezing issues. I know you mentioned you have an RTX 3050Ti, but it does help to post your system settings to allow others here to potentially better diagnose your problem. In a terminal copy this command,

inxi -Fxxc0z --no-host

Hit enter, and it’ll output your system information (it shows nothing personal, just hardware specs, so it’s safe to use this btw) then copy that output over here in the forums using ``` (it’s the key above Tab key usually) and mark sure you put that before and after the end the command. It should look something like mine, just with different specs of course:

[scott@endeavourOS ~]$ inxi -Fxxc0z --no-host
System:    Kernel: 5.10.75-1-lts x86_64 bits: 64 compiler: gcc v: 11.1.0 Desktop: GNOME 40.5 tk: GTK 3.24.30 wm: gnome-shell
           dm: GDM Distro: EndeavourOS base: Arch Linux
Machine:   Type: Laptop System: Acer product: Aspire E5-576G v: V1.32 serial: <filter>
           Mobo: KBL model: Ironman_SK v: V1.32 serial: <filter> UEFI: Insyde v: 1.32 date: 10/24/2017
Battery:   ID-1: BAT1 charge: 16.2 Wh (100.0%) condition: 16.2/62.2 Wh (26.1%) volts: 12.6 min: 11.1 model: PANASONIC AS16B5J
           serial: <filter> status: Full
CPU:       Info: Quad Core model: Intel Core i5-8250U bits: 64 type: MT MCP arch: Kaby Lake note: check rev: A cache:
           L2: 6 MiB
           flags: avx avx2 lm nx pae sse sse2 sse3 sse4_1 sse4_2 ssse3 vmx bogomips: 28800
           Speed: 800 MHz min/max: 400/3400 MHz Core speeds (MHz): 1: 800 2: 800 3: 800 4: 800 5: 800 6: 800 7: 800 8: 800
Graphics:  Device-1: Intel UHD Graphics 620 vendor: Acer Incorporated ALI driver: i915 v: kernel bus-ID: 00:02.0
           chip-ID: 8086:5917
           Device-2: NVIDIA GP108M [GeForce MX150] vendor: Acer Incorporated ALI driver: nvidia v: 470.74 bus-ID: 01:00.0
           chip-ID: 10de:1d10
           Device-3: Chicony HD WebCam type: USB driver: uvcvideo bus-ID: 1-7:4 chip-ID: 04f2:b571
           Display: x11 server: X.org 1.20.13 compositor: gnome-shell driver: loaded: modesetting,nvidia
           resolution: <missing: xdpyinfo>
           OpenGL: renderer: NVIDIA GeForce MX150/PCIe/SSE2 v: 4.6.0 NVIDIA 470.74 direct render: Yes
Audio:     Device-1: Intel Sunrise Point-LP HD Audio vendor: Acer Incorporated ALI driver: snd_hda_intel v: kernel
           bus-ID: 00:1f.3 chip-ID: 8086:9d71
           Sound Server-1: ALSA v: k5.10.75-1-lts running: yes
           Sound Server-2: JACK v: 1.9.19 running: no
           Sound Server-3: PulseAudio v: 15.0 running: yes
           Sound Server-4: PipeWire v: 0.3.39 running: yes
Network:   Device-1: Intel Dual Band Wireless-AC 3168NGW [Stone Peak] driver: iwlwifi v: kernel bus-ID: 03:00.0
           chip-ID: 8086:24fb
           IF: wlan0 state: up mac: <filter>
           Device-2: Realtek RTL8111/8168/8411 PCI Express Gigabit Ethernet vendor: Acer Incorporated ALI driver: N/A
           port: 3000 bus-ID: 04:00.1 chip-ID: 10ec:8168
Bluetooth: Device-1: Intel Wireless-AC 3168 Bluetooth type: USB driver: btusb v: 0.8 bus-ID: 1-5:3 chip-ID: 8087:0aa7
           Report: rfkill ID: hci0 rfk-id: 0 state: up address: see --recommends
Drives:    Local Storage: total: 238.47 GiB used: 130.25 GiB (54.6%)
           ID-1: /dev/sda vendor: SK Hynix model: HFS256G39TND-N210A size: 238.47 GiB speed: 6.0 Gb/s serial: <filter>
Partition: ID-1: / size: 233.17 GiB used: 130.25 GiB (55.9%) fs: ext4 dev: /dev/sda2
           ID-2: /boot/efi size: 511 MiB used: 296 KiB (0.1%) fs: vfat dev: /dev/sda1
Swap:      ID-1: swap-1 type: file size: 512 MiB used: 19.2 MiB (3.8%) priority: -2 file: /swapfile
Sensors:   System Temperatures: cpu: 55.0 C mobo: N/A gpu: nvidia temp: 48 C
           Fan Speeds (RPM): N/A
Info:      Processes: 283 Uptime: 1d 4h 42m Memory: 15.51 GiB used: 4.06 GiB (26.2%) Init: systemd v: 249 Compilers:
           gcc: 11.1.0 Packages: pacman: 1281 Shell: Bash v: 5.1.8 running-in: tilix inxi: 3.3.07
[scott@endeavourOS ~]$ 

Chances are if you’re able to log in and use your system, you probably didn’t do anything wrong when you set up Optimus Switch, but it also depends on the kernel you’re using, so by posting your inxi output we can start to narrow some things down.

I am by no means an expert here, so if others can chime in and help, please do, I’m just helping to get the ball rolling :wink:

1 Like

Thanks for the reply to get things going.

Here is what was requested:
I used the same inxi -Fxxc0z --no-host command you did, but apparently I might have messed up the coloring of my shell there.

System:    Kernel: 5.10.75-1-lts x86_64 bits: 64 compiler: gcc v: 11.1.0 Desktop: i3 4.20 dm: LightDM Distro: EndeavourOS
           base: Arch Linux
Machine:   Type: Laptop System: Dell product: XPS 15 9510 v: N/A serial: <filter> Chassis: type: 10 serial: <filter>
           Mobo: Dell model: 01V4T3 v: A00 serial: <filter> UEFI: Dell v: 1.3.2 date: 06/17/2021
Battery:   ID-1: BAT0 charge: 62.3 Wh (73.9%) condition: 84.3/84.3 Wh (100.0%) volts: 12.0 min: 11.4 model: BYD DELL M59JH18
           serial: <filter> status: Discharging
CPU:       Info: 8-Core model: 11th Gen Intel Core i7-11800H bits: 64 type: MT MCP arch: Tiger Lake rev: 1 cache: L2: 24 MiB
           flags: avx avx2 lm nx pae sse sse2 sse3 sse4_1 sse4_2 ssse3 vmx bogomips: 73728
           Speed: 949 MHz min/max: 800/4600 MHz Core speeds (MHz): 1: 949 2: 1091 3: 801 4: 801 5: 886 6: 801 7: 881 8: 801
           9: 801 10: 801 11: 801 12: 965 13: 888 14: 850 15: 945 16: 1094
Graphics:  Device-1: Intel TigerLake-H GT1 [UHD Graphics] vendor: Dell driver: i915 v: kernel bus-ID: 00:02.0
           chip-ID: 8086:9a60
           Device-2: NVIDIA GA107M [GeForce RTX 3050 Ti Mobile] vendor: Dell driver: nvidia v: 470.74 bus-ID: 01:00.0
           chip-ID: 10de:25a0
           Device-3: Microdia Integrated_Webcam_HD type: USB driver: uvcvideo bus-ID: 3-11:3 chip-ID: 0c45:672e
           Display: x11 server: X.Org 1.20.13 driver: loaded: modesetting,nvidia resolution: 3456x2160~60Hz s-dpi: 75
           OpenGL: renderer: NVIDIA GeForce RTX 3050 Ti Laptop GPU/PCIe/SSE2 v: 4.6.0 NVIDIA 470.74 direct render: Yes
Audio:     Device-1: Intel Tiger Lake-H HD Audio vendor: Dell driver: snd_hda_intel v: kernel bus-ID: 00:1f.3
           chip-ID: 8086:43c8
           Sound Server-1: ALSA v: k5.10.75-1-lts running: yes
           Sound Server-2: JACK v: 1.9.19 running: no
           Sound Server-3: PulseAudio v: 15.0 running: yes
           Sound Server-4: PipeWire v: 0.3.39 running: no
Network:   Device-1: Intel Tiger Lake PCH CNVi WiFi vendor: Rivet Networks driver: iwlwifi v: kernel bus-ID: 00:14.3
           chip-ID: 8086:43f0
           IF: wlan0 state: up mac: <filter>
           IF-ID-1: br-ab5a7bd29999 state: down mac: <filter>
           IF-ID-2: docker0 state: down mac: <filter>
Bluetooth: Device-1: Intel AX201 Bluetooth type: USB driver: btusb v: 0.8 bus-ID: 3-14:4 chip-ID: 8087:0026
           Report: rfkill ID: hci0 rfk-id: 1 state: down bt-service: not found rfk-block: hardware: no software: no
           address: see --recommends
Drives:    Local Storage: total: 476.94 GiB used: 11.61 GiB (2.4%)
           ID-1: /dev/nvme0n1 vendor: Micron model: 2300 NVMe 512GB size: 476.94 GiB speed: 31.6 Gb/s lanes: 4
           serial: <filter> temp: 31.9 C
Partition: ID-1: / size: 467.88 GiB used: 11.61 GiB (2.5%) fs: ext4 dev: /dev/nvme0n1p2
           ID-2: /boot/efi size: 511 MiB used: 296 KiB (0.1%) fs: vfat dev: /dev/nvme0n1p1
Swap:      Alert: No swap data was found.
Sensors:   System Temperatures: cpu: 43.0 C mobo: N/A
           Fan Speeds (RPM): N/A
Info:      Processes: 341 Uptime: 3h 22m Memory: 31.09 GiB used: 1008.7 MiB (3.2%) Init: systemd v: 249 Compilers: gcc: 11.1.0
           Packages: pacman: 833 Shell: fish v: 3.3.1 running-in: kitty inxi: 3.3.07
1 Like

Okay, thanks for the output. I can see you’ve got the latest nvidia driver installed (same as me) and you’re currently running the LTS kernel, which is generally the recommended kernel to use, unless you have very new hardware, then the more current mainline kernel would be your best bet. Now I can see you’re got the Dell XPS 15 9510, which was released not too long ago, so this would qualify as very new hardware for me. So since that’s the case and this is the easiest first step to take for some troubleshooting, I’m going to recommend you install the mainline current kernel and see if your issue persists or not. To install the current kernel we can do that a few ways:

Option 1:

Graphiicaly we can install/remove kernels via EndeavourOS tool called akm which I think should be installed by default. If it’s not instalelled by default, just run:

sudo pacman -S akm

Running akm you should see something like this:
Screenshot from 2021-10-30 17-28-04
Now in my case I’m using 3 kernels, the mainline kernel which is just called core/linux in this case, as well as the linux-lts and linux-zen kernels. I use these for troubleshooting possible bugs mostly, otherwise I typically run the LTS kernel.

In your case, to get the linux kernel, check these two boxes so akm knows to enable them.

core/linux
core/linux-headers

This will let akm know you want to install both of these. Then on the bottom right, click on “Execute” and akm will run and download and install the linux kernel for you. It may take some time to do this (maybe a minute or two), so be patient while it works. Once it’s complete, you’ll need to reboot into the new linux kernel to test it out. When rebooting, EndeavourOS defaults to showing the Grub menu, you’ll see this for a couple seconds, and you can use your laptops up/down arrow keys to cycle to the kernel you want to use. You should see 4 different entries here:

EndeavourOS, on linux-lts
EndeavourOS, on linux-lts (fallback initramfs)
EndeavourOS, on linux
EndeavourOS, on linux (fallback initramfs)

Normally your system boots into the linux-lts entry, but in this case, select the one that says:

EndeavourOS, on linux

This will boot you into the latest kernel. You can ignore the fallback kernel options for now, and just select the linux kernel that’s currently at 5.14 and use that to see if your system has anymore freezes. Now it is possible that your system may actually default to the current linux kernel, so you may not even need to select anything if it’s already selected, just any fyi.

Option 2:

sudo pacman -S linux
sudo pacman -S linux-headers
sudo grub-mkconfig -o /boot/grub/grub.cfg

The first two commands install the required packages for the linux kernel and the third command updates the Grub. Like I mentioned above, it takes a bit of time for your system to download and install a kernel, so just let it run for a minute or two and then you should be good to reboot, select the 5.14 kernel in the Grub menu and hopefully you should be good to go.

If you have any questions about this or can’t quite get any of this to work, just let me know, happy to help.

3 Likes

The normal Linux Kernel is (when using the EndeavourOS installation) already pre-installed. It gives the option to additionally install the LTS-Kernel which I did because I read it’s the more recommended one.
So I already have that normal Linux Kernel installed alongside the LTS one.
I’m gonna give that a try and will give an update in a moment.

1 Like

I can reply quite fast O.o
So … My Kernel is now using the 5.14.14-arch-1 x86_64 Kernel when selecting the normal Linux Kernel instead of the LTS one.
It still uses the RTX 3050 Ti as OpenGL renderer.
Sadly I still have the same CPU spikes as mentioned in the first post. Though I’m honestly hesitant to use the Nvidia Driver setup again since it kinda broke when switching the renderer to a point where I had to reinstall the system.

1 Like

Silly me, I should’ve simply just asked if it happens on the current linux kernel too instead of launching into a detailed how-to! But in any case since your hardware is still relatively new, Linux does need some time in order to properly support newer hardware. Now I’m only assuming it’s nvidia related issue at this point no guarantee there, but right now the nvidia driver is at 470.74, the next new driver release is going to be 495 that’s now stable and should be out soon (like maybe a couple of days or a week or so). The new version is mostly for having better Wayland support for nvidia, but since you’re still on Xorg like myself that shouldn’t matter here, however new driver versions due bring improvements and bug fixes. So it’s possible that when the 495 driver gets released, it may resolve your issue, but it also may not as well, it’s hard to say for certain.

I don’t use the Optimus Switch method myself, I use the Optimus Manager method when I installed and configured nvidia on my laptop, but both methods should work out okay.

I wonder if perhaps maybe @linesma has any thoughts on what your issue might be if it is possibly nvidia or Optimus Switch related?

It might just be you have to wait for the new driver and see for the time being.

1 Like

Well luckily in i3 I can definitely live with that for a few weeks to try out the coming-up driver version.
Though it’s kinda unlucky since (especially since I’m new to the Linux world) I would love to try out other WM before really committing to one. Sadly with awesome, it turned into so unusable that I honestly don’t even want to try out other window managers right now.

That forum entry about Optimus Switch was mainly the first (and only) detailed explanation of how to install anything Nvidia-related which resulted in me using it.
Reading up on Optimus Manager: that might be the better option for me since I mainly use that Laptop for University/Programming related stuff. So I guess I don’t need to use my Graphics card the entire time either for Desktop/Browser stuff.

Also: Thanks for the detailed how-to anyways! Was pretty easy to understand as well. :3

1 Like

No worries, happy to help when I can. Now, there’s always a few different ways to test out other window managers or even other distros if you have the time to tinker around. You can either install a specific distro like say PopOS (or EndeavourOS too of course!) and then install your preferred WM on top of that. Or my personal approach I like is to use an application like Boxes (similar to VirtualBox), which are both Virtual Managers that you can run within your desktop to test other desktops without actually installing it onto your actual system since it works all within the Boxes/VirtualBox software. These are just Virtual Machines, so while it’s nice to test things out within them, they do take a little bit of a performance hit since it’s kind of like emulating a system within a system (kind of like the movie Inception).

Quick side note, there is the EndeavourOS wiki that was created to help most users get setup with various options: https://discovery.endeavouros.com

There is also a section in that EndeavourOS wiki specifically for nvidia here: https://discovery.endeavouros.com/category/nvidia/

There’s a couple options to choose there, you don’t have to use all of them, just the one or two wikis there should get you the option you want. That’s how I got all mine setup with the help of wiki pages.

Since I know you like a WM type of environment, there’s actually a user here that created a new WM called worm that they are actively developing and adding new features too. Some features are not fully implemented yet, but for the most part it’s in working order, so if you’re curious you can take a look here and read up on it:

As a final side note, and something to consider as like a last resort if you will, Pop!_OS is a Linux distro, based off Ubuntu, but what I want to say is they have one of the best out of box experiences with nvidia. So if there’s a chance your issue doesn’t get resolved, before going back to say Windows, I’d recommend trying Pop!_OS at some point. The other reason I mention PopOS is because while they use the Gnome DE, they also created something called pop-shell, which acts as a tiling manager in Gnome. A lot of people like it and find it very useful. Just something to keep in the back of your mind or if you want you can also test out PopOS if you have the time too.

2 Likes

A good resource for installing wm can be found here:

https://wiki.archlinux.org/title/window_manager

It mainly boils down to what language you want to use to configure them. i3wm is a good beginner wm and easy to setup. Qtile is good if you like python, the config file is pretty straight forward and they have widgets that can be easily added to your bar. Xmonad was a pain to me, too difficult. dwm is in C or C++, very minimal. To name a few of the popular ones.

And DT has some good guides:

Good luck with your nvidia graphics and welcome to the forum!

2 Likes

@Schattenbrot The new nvidia 495 driver is out. I’ve updated and it works okay on my laptop with an nvidia MX150, so go ahead if you haven’t already and run either sudo pacman -Syu or yay in your terminal of choice, update, and reboot and see if this problem persists or if it makes it any better and let me know. It’s Halloween and I’ll be at a concert for the evening so won’t be back till late late tonight, but hopefully it works for you!

1 Like

Thanks for the reminder :3
I hope you had a nice concert evening.
My reply is a bit late but after I installed them with paru it seems to be fine. Only gave it a 2-minute quick test since it’s almost 4 am and I need to sleep.
I’ll try it out tomorrow in more detail (maybe even in combination with AwesomeWM or dying inside with Xmonad) and see if it got really fixed.
I’ll send an update later today/tomorrow after trying it in more detail. Maybe even in combination with AwesomeWM or Xmonad.

1 Like

Did you find any working solution?
I’m facing the same issues on i3wm. I tried both linux-lts and linux kernels but the issue is still there.
I also tried switching the graphics mode using envycontrol, but no luck there as well.

This is an old thread please start a new topic. With that new topic post log files.

Hey welcome here @macroni23 :enos:

as @thefrog already mention… do not take over old thread and instead open a new one link to this one in cas eneeded.
Revive old threads only ping everyone involved and is most case outdated already on the informations.
Provide a general system specs info there and may logs.
https://discovery.endeavouros.com/forum-log-tool-options/how-to-include-systemlogs-in-your-post/2021/03/
Check glances in terminal to see what is on top causing teh load can help too finding culprit.

closing