will8211 / unimatrix

Python script to simulate the display from "The Matrix" in terminal. Uses half-width katakana unicode characters by default, but can use custom character sets. Accepts keyboard controls while running. Based on CMatrix.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Intense CPU when run unimatrix?

tmpm697 opened this issue · comments

I monitor cpu with "watch sensors" and notice cpu core i7 (4 core) has increased at least 6-7 celsius (51,52 to 57,58)

I use unimatrix-git from aur (archlinux) and run "unimatrix -n -l ens -s 96" with "st" terminal.

I also observe less cpu contest with cmatrix than unimatrix.

So what's the problem with unimax? anyway if someone can help to translate "unimatrix -n -l ens -s 96" to cmatrix would be appreciated.

Xorg process go up to 60% cpu while running this software.

And after a while, some other apps get stuck like firefox and I had to manually to kill them.

I have Xorg with rate of 200.

I use 2k monitor dell.

Cmatrix is written in c iirc, and as unimatrix is python you sacrifice some speed for ease of reading, changes, and flexibility.

Certainly there are areas of unimatrix that could be improved to the point where there is little to no issues with speed compared to cmatrix; however I think it may be more likely you are experiencing unaccelerated terminal lag.

What OS, what hardware, and what kernel mods do you have loaded for your gpu? If you are using straight out basic VESA, I expect if you are running Linux it is not AMD hardware/gpu or there would be no issue as the kernel would automatically load the proper mods.

Is your gpu nvidia or intel integrated? Are you using Windows with acceleration turned off? Or running unimatrix in a WSL terminal? You stated Arch but you can do some highly interesting things with WSL if you are a masochist.

Cmatrix does not have the flexibility nor the feature set that unimatrix has. I don't think there is a way to do what you ask exactly in cmatrix with its current code base.

Could be. I'm at work so won't be looking it up, but is there not an accelerated terminal project we could test to see if there is a difference in rendering rate?

Step to produce:

  1. start unimatrix as above comment
  2. switch to another tty and check /usr/bin/top
  3. observe /usr/lib/Xorg cpu usage constantly above 30%, wait for a while to 60% and stuck down the OS, os starts to kill apps.

A process that constantly takes up 30% cpu is unusual, especially Xorg in this case.

Check this image: https://imgur.com/gallery/4HsKEk7

Firefox esr (78.11.0esr) crashes when I have both unimatrix and ff running.

https://imgur.com/gallery/WlV2GhC

I use gnome-terminal and sam result, Xorg's cpu and gnome-terminal-server keep over 40% -- so it worse than xst.

@will8211 I intend to use unimatrix with slock to have it work like matrix lockscreen. So terminal is always at fullscreen - 2k reso

@Apple-Lion I'll install it and try.

Steps:
Xst -> unimatrix... -> Xorg 40%
Gnome-terminal -> unimatrix... -> Xorg 40%
Alacritty -> unimatrix... -> Xorg 0.7% ---> expected

So somehow terminal help in this case, why alacrity does not stress Xorg? But xst and gnome-terminal does?

This is what I meant by accelerated terminal. Alacritty uses OpenGL to render the terminal. Hence it uses the little 620 dedicated graphics chip on your cpu.

This is better for large resolutions as you can see.

But all text displays in terminal should be able to be rendered by cpu without issue?

This is text, not video or complex 3D objects.

I tested with river and foot|alarcity terminal (pure wayland)

And other tests on Xorg as above.

The total cpu usage in case when I use xst and unimatrix is the lowest 10-15% in total when run both firefox (playing YouTube video) and unimatrix inside terminal.

The only downside of it is intense Xorg cpu usage.

I don't know if this helps, but here are a few more data points:

I'm testing right now on a Dell 9570 laptop (Intel i9-8950HK @ 4.8GHz, 32GB RAM (17 GB in use)) running Arch Linux (1 March 2021), kernel 5.11.2-arch1-1, xorg-server 1.20.10-3, Mate Desktop 1.24.1-1, Gnome Terminal 3.30.2, unimatrix-git r66.75f7402-1. It's not even showing up in the output of htop, nor is the Xorg server.

I just upgraded to unimatrix-git-r30.3692561-1. Same thing. If anything, unimatrix is now using a bit less RAM (16.6GB/32 now in use).

@virtadpt I tried with gnome-terminal above and just re-try, same result, Xorg constantly above 40% (note this result from running /usr/bin/top)

I think you used other monitors, not "top".

This stress Xorg and "sensors" command give some plus celsius.

I use the same unimatrix version from aur (arch)

Yes, I used htop, not top. I've just repeated the test with regular old top and Firefox and Electron seem to be taking up most of Windbringer's CPU time, with the odd "Web Content" subprocess popping up once in a while.

@virtadpt press "u" and type your username to filter out username's process for better view. Both Xorg and gnome-terminal-server will appear in screen, check CPU column for the info.

Note that, you should start gnome terminal in fullscreen mode before running unimatrix and switch tty and run top in there.

I'm wondering if we can have a way that force idling all processes?

As when run unimatrix as screen locker, I most won't do anything, maybe only allow pulseaudio continues to play background but other apps/processes should be idling.

Suspend and resume tasks would help and I chose to use alacritty for less hustle.