Closed cassiofb-dev closed 1 year ago
Can you share output of the following command?
ps -eo thcount
Thanks for the tip, exploring a little bit with logs I saw that this was the only error that froze the program but there were also some logs in other tabs.
It turned out that I was missing a program called procps, in my case it was this package. I think the issue can be closed, the only suggestion is to show the user some error message in the case this package is not installed or working fine.
It looks like BusyBox does not support --no-headers
parameter for ps
command.
The application is updated (v2.17.3). It contains changes for fixing problems if procps
is not installed.
It may be downloadable in about:
You can test CPU and other tabs that have problems by using SMC v2.17.3 and write the result here.
Ok. When flatpak updates, I will uninstall procps and test again. Thanks for the quick reply!
Hi, I updated to v2.17.3 and got the same error with different logs. Besides changing the log the System tab now works without installing procps(I noticed this after testing somethings).
localhost:~$ flatpak run io.github.hakandundar34coding.system-monitoring-center
ps: bad -o argument 'thcount', supported arguments: user,group,comm,args,pid,ppid,pgid,etime,nice,rgroup,ruser,time,tty,vsz,sid,stat,rss
Traceback (most recent call last):
File "/app/share/system-monitoring-center/systemmonitoringcenter/Cpu.py", line 217, in loop_func
number_of_total_processes, number_of_total_threads = Libsysmon.get_processes_threads()
File "/app/share/system-monitoring-center/systemmonitoringcenter/Libsysmon.py", line 1535, in get_processes_threads
ps_output_lines = (subprocess.check_output(command_list, shell=False)).decode().strip().split("\n")
File "/usr/lib/python3.10/subprocess.py", line 421, in check_output
return run(*popenargs, stdout=PIPE, timeout=timeout, check=True,
File "/usr/lib/python3.10/subprocess.py", line 526, in run
raise CalledProcessError(retcode, process.args,
subprocess.CalledProcessError: Command '['flatpak-spawn', '--host', 'ps', '-eo', 'thcount']' returned non-zero exit status 1.
ps: bad -o argument 'thcount', supported arguments: user,group,comm,args,pid,ppid,pgid,etime,nice,rgroup,ruser,time,tty,vsz,sid,stat,rss
Traceback (most recent call last):
File "/app/share/system-monitoring-center/systemmonitoringcenter/MainWindow.py", line 1112, in main_gui_tab_loop
Cpu.loop_func()
File "/app/share/system-monitoring-center/systemmonitoringcenter/Cpu.py", line 217, in loop_func
number_of_total_processes, number_of_total_threads = Libsysmon.get_processes_threads()
File "/app/share/system-monitoring-center/systemmonitoringcenter/Libsysmon.py", line 1535, in get_processes_threads
ps_output_lines = (subprocess.check_output(command_list, shell=False)).decode().strip().split("\n")
File "/usr/lib/python3.10/subprocess.py", line 421, in check_output
return run(*popenargs, stdout=PIPE, timeout=timeout, check=True,
File "/usr/lib/python3.10/subprocess.py", line 526, in run
raise CalledProcessError(retcode, process.args,
subprocess.CalledProcessError: Command '['flatpak-spawn', '--host', 'ps', '-eo', 'thcount']' returned non-zero exit status 1.
Is there any way to get only number of threads of the processes by using ps command of BusyBox?
What is printed if following commands are used?
ps -eo thread
ps -eo threads
Example output from ps -eo thcount
(procps):
Sorry for the delay, I searched for sometime but did not found a solution. Using cat and ps in the proc dir should output the same result:
cat /proc/*/status | grep Threads | cut -c10-
This is the output on my install:
Bellow are some tests I did on some Distros.
cat /proc/*/status | grep Threads | cut -c10-
There may be shell injection problems if this command is used.
ls
and cat
commands are used separately if procps
command is not installed.
There may be a new update in about 3-4 days. If you do not want to wait for the new update, you can use it by following these steps:
src
folderLibsysmon.py
file and replace with the one in the installation directory.Installation directory for Flatpak:
/var/lib/flatpak/app/io.github.hakandundar34coding.system-monitoring-center/current/active/files/share/system-monitoring-center/systemmonitoringcenter
I tested it by modifying the ps
command for testing the second way.
I will close this issue. But you can write additional comments if the problem is not fixed.
Awesome, it worked now! I tested from the source, It's really cool you can do this with python! I'll keep in touch if there is some problem in the flatpak update.
The application is updated on Flathub. It may be downloadable in about 3 hours.
The changes for fixing the problem are included in this version but version number did not change. It would consume lower CPU if ps
command was used. But it did not work as you know. The effect may be very small because your CPU is not old.
Additionally, GPU memory graph is added. Does it work on your system? Can you run the application by using terminal and share screenshot of the GPU tab (and terminal output if there are errors)?
Yes it work fine on AMD, Intel there are some missing info.
Sorry, ignore my last comment I was not using last version. The GPU memory graph froze like the CPU tab. Logs:
Traceback (most recent call last):
File "/app/share/system-monitoring-center/systemmonitoringcenter/Gpu.py", line 265, in loop_func
gpu_memory_usage_percentage = Libsysmon.get_gpu_memory_usage_percentage(gpu_memory_used, gpu_memory_capacity)
File "/app/share/system-monitoring-center/systemmonitoringcenter/Libsysmon.py", line 2950, in get_gpu_memory_usage_percentage
gpu_memory_used_bytes = get_memory_bytes_from_string(gpu_memory_used)
File "/app/share/system-monitoring-center/systemmonitoringcenter/Libsysmon.py", line 2973, in get_memory_bytes_from_string
memory_bytes = float(memory_number) / memory_divisor
UnboundLocalError: local variable 'memory_divisor' referenced before assignment
Traceback (most recent call last):
File "/app/share/system-monitoring-center/systemmonitoringcenter/MainWindow.py", line 1120, in main_gui_tab_loop
Gpu.loop_func()
File "/app/share/system-monitoring-center/systemmonitoringcenter/Gpu.py", line 265, in loop_func
gpu_memory_usage_percentage = Libsysmon.get_gpu_memory_usage_percentage(gpu_memory_used, gpu_memory_capacity)
File "/app/share/system-monitoring-center/systemmonitoringcenter/Libsysmon.py", line 2950, in get_gpu_memory_usage_percentage
gpu_memory_used_bytes = get_memory_bytes_from_string(gpu_memory_used)
File "/app/share/system-monitoring-center/systemmonitoringcenter/Libsysmon.py", line 2973, in get_memory_bytes_from_string
Can you try again by using the latest source code?
Sure, I will try it after work. Is there a telegram o discord for better communication?
Just run from source, perfect 👌 I'll try with Intel IGPU later too.
No error in Intel IGPU, but it does not show some infos (I guess the problem here is intel gpu).
Is there a telegram o discord for better communication?
Currenly, no. I know it is hard to use this place for communication. There may be improvements for this situation according to project size.
No error in Intel IGPU, but it does not show some infos (I guess the problem here is intel gpu).
Integrated Intel GPUs does not provide GPU usage information. There is a tool (intel_gpu_top) but it requires root privileges. I do not know about GPU usage of discrete Intel GPUs.
Currently, the bugs are fixed and the application works. The application may be improved further if you want to continue. Otherwise, you can leave the following questions as unanswered.
Does your Intel CPU has performance + efficiency cores? Or are all of them same?
Finally, can you run the following command on the system with AMD GPU and upload the output file (amd_gpu_load_test.txt)?
while true; do cat /sys/class/drm/card1/device/gpu_busy_percent; echo $EPOCHREALTIME; done
In order to stop running the script, you can use Ctrl+C after 5-6 seconds.
Time and GPU load are written to this file by using the script above.
Your screen refresh rate is high (165 Hz). Currently this file is read about 360 times in a second. It may be lowered (and CPU consumption) if it is not required.
Does your Intel CPU has performance + efficiency cores? Or are all of them same?
They are all efficient cores, the CPU is an Intel N100 with 4 E-Cores.
Finally, can you run the following command on the system with AMD GPU and upload the output file (amd_gpu_load_test.txt)?
This system uses an AMD R5 3600 with RX 6600M, amd_gpu_load_test.txt.
It did not print time values. Prrobably, BusyBox does not support it. Can you find an equıivalent command?
Example time output: 1689231148.358306
Do you need the numbers after the dot? If not this should do:
cat /sys/class/drm/card1/device/gpu_busy_percent; date +%s;
Do you need the numbers after the dot?
It is required. The command that you wrote prints every second. It should be printed as much as possible.
You can add > amd_gpu_load_test.txt
at the end of the command to redirect the output to a file.
GPU max power value is added for AMD GPUs. Can you run the application by using terminal, open GPU tab and share its screenshot (and terminal output if there are errors)?
@dCo3lh0,
Can you share output of the following commands? Note: You can unsubscribe this issue. If you do not want to be informed, write here.
These command outputs are required for new GPU information of NVIDIA GPUs. For example: memory frequency, encoding engine load etc.
Each of them are single line commands.
Last two ones are for getting elapsed time values. You can share only time values of them.
Example time output:
For GPU information:
nvidia-smi --query-gpu=gpu_name,gpu_bus_id,driver_version,utilization.gpu,utilization.memory,utilization.encoder,utilization.decoder,memory.total,memory.free,memory.used,temperature.gpu,clocks.current.graphics,clocks.max.graphics,clocks.current.memory,clocks.max.memory,power.draw,power.limit --format=csv
For elapsed time value:
time nvidia-smi --query-gpu=gpu_name,gpu_bus_id,driver_version,utilization.gpu,utilization.memory,utilization.encoder,utilization.decoder,memory.total,memory.free,memory.used,temperature.gpu,clocks.current.graphics,clocks.max.graphics,clocks.current.memory,clocks.max.memory,power.draw,power.limit --format=csv
For elapsed time value:
time nvidia-smi --query-gpu=gpu_name,gpu_bus_id,driver_version,utilization.gpu,utilization.memory,memory.total,memory.free,memory.used,temperature.gpu,clocks.current.graphics,clocks.max.graphics,power.draw --format=csv
Can you run the application by using terminal, open GPU tab and share its screenshot (and terminal output if there are errors)?
No errors, really fluid and nice. Besides the intel I also got a Nvidia here. It's kinda old but this weekend I'll check on it too.
Well, you can use adjtimex on BusyBox and a really long command (probably has the same security issues you mentioned before). But its a good starting point:
adjtimex | grep -i tv | cut -d: -f2 | sed 's/^ *//g' | tr '\n' '.' | sed 's/.$/\n/'
So by running:
while true; do cat /sys/class/drm/card1/device/gpu_busy_percent; adjtimex | grep -i tv | cut -d: -f2 | sed 's/^ *//g' | tr '\n' '.' | sed 's/.$/\n/'; done > amd_gpu_load_test.txt
I got: amd_gpu_load_test.txt
@cassiofb-dev,
The changes were in only source code. But they will be usable by using Flatpak in about 4 hours.
Can you run the application by using terminal, open GPU tab and share its screenshot (and terminal output if there are errors)?
It was not clear (source code).
probably has the same security issues you mentioned before
I will not use this command in the application code. It is for understanding refresh rate of the GPU load file. I read the output file. It looks like all load values are repeated 7 times. There are a few exceptions. The read frequency was about 360 times. I will change it to 120. There is still a margin.
Besides the intel I also got a Nvidia here. It's kinda old but this weekend I'll check on it too.
I do not know your GPU model. Very old NVIDIA GPUs provide limited information.
Update: The source code is updated again. AMD GPU load accuracy is improved. Currently, it is not sent to Flatpak repositories.
The changes were in only source code. But they will be usable by using Flatpak in about 4 hours.
Yeah, I should have run from source 😅
I do not know your GPU model. Very old NVIDIA GPUs provide limited information.
It's a GTX 1660, it's even before RTX models. I gave it to my little bro but I can test there.
Btw, there were some logs on user panel but it does not seem to be an error.
(python:7648): Gdk-CRITICAL **: 10:22:00.852: gdk_texture_new_for_pixbuf: assertion 'GDK_IS_PIXBUF (pixbuf)' failed
/usr/lib/python3.11/site-packages/gi/overrides/Gio.py:42: Warning: g_object_unref: assertion 'G_IS_OBJECT (object)' failed
return Gio.Application.run(self, *args, **kwargs)
(python:7648): Gdk-CRITICAL **: 10:22:01.455: gdk_texture_new_for_pixbuf: assertion 'GDK_IS_PIXBUF (pixbuf)' failed
/usr/lib/python3.11/site-packages/gi/overrides/Gio.py:42: Warning: g_object_unref: assertion 'G_IS_OBJECT (object)' failed
return Gio.Application.run(self, *args, **kwargs)
(python:7648): Gdk-CRITICAL **: 10:22:02.215: gdk_texture_new_for_pixbuf: assertion 'GDK_IS_PIXBUF (pixbuf)' failed
/usr/lib/python3.11/site-packages/gi/overrides/Gio.py:42: Warning: g_object_unref: assertion 'G_IS_OBJECT (object)' failed
return Gio.Application.run(self, *args, **kwargs)
(python:7648): Gdk-CRITICAL **: 10:22:02.378: gdk_texture_new_for_pixbuf: assertion 'GDK_IS_PIXBUF (pixbuf)' failed
(python:7648): Gdk-CRITICAL **: 10:22:02.382: gdk_texture_new_for_pixbuf: assertion 'GDK_IS_PIXBUF (pixbuf)' failed
(python:7648): Gdk-CRITICAL **: 10:22:02.388: gdk_texture_new_for_pixbuf: assertion 'GDK_IS_PIXBUF (pixbuf)' failed
(python:7648): Gdk-CRITICAL **: 10:22:02.394: gdk_texture_new_for_pixbuf: assertion 'GDK_IS_PIXBUF (pixbuf)' failed
(python:7648): Gdk-CRITICAL **: 10:22:02.400: gdk_texture_new_for_pixbuf: assertion 'GDK_IS_PIXBUF (pixbuf)' failed
(python:7648): Gdk-CRITICAL **: 10:22:02.407: gdk_texture_new_for_pixbuf: assertion 'GDK_IS_PIXBUF (pixbuf)' failed
(python:7648): Gdk-CRITICAL **: 10:22:02.413: gdk_texture_new_for_pixbuf: assertion 'GDK_IS_PIXBUF (pixbuf)' failed
(python:7648): Gdk-CRITICAL **: 10:22:02.418: gdk_texture_new_for_pixbuf: assertion 'GDK_IS_PIXBUF (pixbuf)' failed
(python:7648): Gdk-CRITICAL **: 10:22:02.424: gdk_texture_new_for_pixbuf: assertion 'GDK_IS_PIXBUF (pixbuf)' failed
(python:7648): Gdk-CRITICAL **: 10:22:02.431: gdk_texture_new_for_pixbuf: assertion 'GDK_IS_PIXBUF (pixbuf)' failed
(python:7648): Gdk-CRITICAL **: 10:22:02.436: gdk_texture_new_for_pixbuf: assertion 'GDK_IS_PIXBUF (pixbuf)' failed
(python:7648): Gdk-CRITICAL **: 10:22:02.443: gdk_texture_new_for_pixbuf: assertion 'GDK_IS_PIXBUF (pixbuf)' failed
(python:7648): Gdk-CRITICAL **: 10:22:02.448: gdk_texture_new_for_pixbuf: assertion 'GDK_IS_PIXBUF (pixbuf)' failed
(python:7648): Gdk-CRITICAL **: 10:22:02.455: gdk_texture_new_for_pixbuf: assertion 'GDK_IS_PIXBUF (pixbuf)' failed
(python:7648): Gdk-CRITICAL **: 10:22:02.460: gdk_texture_new_for_pixbuf: assertion 'GDK_IS_PIXBUF (pixbuf)' failed
(python:7648): Gdk-CRITICAL **: 10:22:02.467: gdk_texture_new_for_pixbuf: assertion 'GDK_IS_PIXBUF (pixbuf)' failed
(python:7648): Gdk-CRITICAL **: 10:22:02.473: gdk_texture_new_for_pixbuf: assertion 'GDK_IS_PIXBUF (pixbuf)' failed
(python:7648): Gdk-CRITICAL **: 10:22:02.479: gdk_texture_new_for_pixbuf: assertion 'GDK_IS_PIXBUF (pixbuf)' failed
(python:7648): Gdk-CRITICAL **: 10:22:02.485: gdk_texture_new_for_pixbuf: assertion 'GDK_IS_PIXBUF (pixbuf)' failed
(python:7648): Gdk-CRITICAL **: 10:22:02.491: gdk_texture_new_for_pixbuf: assertion 'GDK_IS_PIXBUF (pixbuf)' failed
(python:7648): Gdk-CRITICAL **: 10:22:02.497: gdk_texture_new_for_pixbuf: assertion 'GDK_IS_PIXBUF (pixbuf)' failed
(python:7648): Gdk-CRITICAL **: 10:22:02.958: gdk_texture_new_for_pixbuf: assertion 'GDK_IS_PIXBUF (pixbuf)' failed
/usr/lib/python3.11/site-packages/gi/overrides/Gio.py:42: Warning: g_object_unref: assertion 'G_IS_OBJECT (object)' failed
return Gio.Application.run(self, *args, **kwargs)
(python:7648): Gdk-CRITICAL **: 10:22:03.305: gdk_texture_new_for_pixbuf: assertion 'GDK_IS_PIXBUF (pixbuf)' failed
(python:7648): Gdk-CRITICAL **: 10:22:03.323: gdk_texture_new_for_pixbuf: assertion 'GDK_IS_PIXBUF (pixbuf)' failed
(python:7648): Gdk-CRITICAL **: 10:22:03.328: gdk_texture_new_for_pixbuf: assertion 'GDK_IS_PIXBUF (pixbuf)' failed
(python:7648): Gdk-CRITICAL **: 10:22:03.335: gdk_texture_new_for_pixbuf: assertion 'GDK_IS_PIXBUF (pixbuf)' failed
(python:7648): Gdk-CRITICAL **: 10:22:03.339: gdk_texture_new_for_pixbuf: assertion 'GDK_IS_PIXBUF (pixbuf)' failed
(python:7648): Gdk-CRITICAL **: 10:22:03.347: gdk_texture_new_for_pixbuf: assertion 'GDK_IS_PIXBUF (pixbuf)' failed
(python:7648): Gdk-CRITICAL **: 10:22:03.352: gdk_texture_new_for_pixbuf: assertion 'GDK_IS_PIXBUF (pixbuf)' failed
(python:7648): Gdk-CRITICAL **: 10:22:03.359: gdk_texture_new_for_pixbuf: assertion 'GDK_IS_PIXBUF (pixbuf)' failed
(python:7648): Gdk-CRITICAL **: 10:22:03.364: gdk_texture_new_for_pixbuf: assertion 'GDK_IS_PIXBUF (pixbuf)' failed
(python:7648): Gdk-CRITICAL **: 10:22:03.370: gdk_texture_new_for_pixbuf: assertion 'GDK_IS_PIXBUF (pixbuf)' failed
(python:7648): Gdk-CRITICAL **: 10:22:03.376: gdk_texture_new_for_pixbuf: assertion 'GDK_IS_PIXBUF (pixbuf)' failed
(python:7648): Gdk-CRITICAL **: 10:22:03.382: gdk_texture_new_for_pixbuf: assertion 'GDK_IS_PIXBUF (pixbuf)' failed
(python:7648): Gdk-CRITICAL **: 10:22:03.388: gdk_texture_new_for_pixbuf: assertion 'GDK_IS_PIXBUF (pixbuf)' failed
(python:7648): Gdk-CRITICAL **: 10:22:03.394: gdk_texture_new_for_pixbuf: assertion 'GDK_IS_PIXBUF (pixbuf)' failed
(python:7648): Gdk-CRITICAL **: 10:22:03.400: gdk_texture_new_for_pixbuf: assertion 'GDK_IS_PIXBUF (pixbuf)' failed
(python:7648): Gdk-CRITICAL **: 10:22:03.406: gdk_texture_new_for_pixbuf: assertion 'GDK_IS_PIXBUF (pixbuf)' failed
(python:7648): Gdk-CRITICAL **: 10:22:03.412: gdk_texture_new_for_pixbuf: assertion 'GDK_IS_PIXBUF (pixbuf)' failed
(python:7648): Gdk-CRITICAL **: 10:22:03.418: gdk_texture_new_for_pixbuf: assertion 'GDK_IS_PIXBUF (pixbuf)' failed
(python:7648): Gdk-CRITICAL **: 10:22:03.425: gdk_texture_new_for_pixbuf: assertion 'GDK_IS_PIXBUF (pixbuf)' failed
(python:7648): Gdk-CRITICAL **: 10:22:03.708: gdk_texture_new_for_pixbuf: assertion 'GDK_IS_PIXBUF (pixbuf)' failed
/usr/lib/python3.11/site-packages/gi/overrides/Gio.py:42: Warning: g_object_unref: assertion 'G_IS_OBJECT (object)' failed
return Gio.Application.run(self, *args, **kwargs)
Yeah, I should have run from source
My comment was not clear about the application source.
It's a GTX 1660, it's even before RTX models.
It is not very old. For example GT540m is very old. My notebook has one GT540m. Very limited information is printed when closed sourced driver is used.
About printed warnings: There may be a GTK4, GIO or language binding bug.
There will be detailed changes for GPU tab for AMD and NVDIA GPUs. Some new graphs and information will be added. I will write here. But write here if you are bored.
Update:
The source code is updated.
New graphics and Details window is added. Currently, video encoding and decoding load information is shown for only NVIDIA GPUs.
Here is an example screenshot:
@cassiofb-dev,
Can you share output of these commands for AMD GPU used system?
grep . /sys/class/drm/card1/*
grep . /sys/class/drm/card1/device/*
There may be some information about video encoding/decoding load of the discrete AMD GPU.
grep . /sys/class/drm/card1/*
grep . /sys/class/drm/card1/device/*
The second command displayed some strange variables and access denied because of root permissions.
Are there any bugs (GPU tab) when you run the latest source code?
There may be GPU indicator on the Summary tab. Do you have design ideas (place to add, shape, etc.)?
Hmm, I can only think of two options:
Option 1 could be the best, the only problem is Intel GPU usage :/
GPU usage may be optional (option in tab customization menu). Because this would increase CPU increase about 1-3% depending on system. This is the first tab of the application and it is Summary tab. This tab may be kept open for long times.
What kind of information would be displayed for GPU then?
You can write if you want to give detailed design details. This feature may be added a few versions later.
What kind of information would be displayed for GPU then? 1) GPU usage. 2) GPU memory (This information may not be appended if there is emtpy space problem on the graphics.)
Big changes on the current design would require more time. Because drawing function is very long.
What kind of information would be displayed for GPU then?
If you are asking that: What will be if the option is enabled and selected GPU is an integrated Intel GPU? Indicator will be empty.
Hi, I'm using for some time this awesome app.
I am having an freezing issue on CPU tab, the Summary and all other tabs/places works fine.
Enviroment
How to reproduce
Log