Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Lagging system and sporadic freezes
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Portage & Programming
View previous topic :: View next topic  
Author Message
northfrisia
n00b
n00b


Joined: 01 Feb 2021
Posts: 33

PostPosted: Sun Mar 31, 2024 5:42 am    Post subject: Lagging system and sporadic freezes Reply with quote

Hi,

When using programs, which utilize opengl, I notice sporadic (that is: repeated but not with a fixed period) freezes and locks
of the particular program.
This is especially noticeable while using blender and wezterm.
For seconds nothing can be edited, input moved or clicked.

To get finally rid of this I used vmstat, top, perf and others to find evidence of what is the root of this.

And I found one clue:
Running vmstat with a refresh period of one second I got this:

Code:

 0  0 244072 5863400 1545392 17596308    0    0     0     0  430  746  0  0 100  0  0  0
 0  0 244072 5871368 1545392 17596308    0    0     0     0  487  782  1  0 99  0  0  0
 0  0 244072 5876924 1545392 17596308    0    0     0     0  441  699  1  0 99  0  0  0
 0  0 244072 5881940 1545392 17596308    0    0     0     0  357  553  1  0 100  0  0  0
 1  0 244072 5844448 1545392 17631964    0    0     0     0 1353 18829  1  0 99  0  0  0
procs -----------memory---------- ---swap-- -----io---- -system-- -------cpu-------
 r  b   swpd   free   buff  cache   si   so    bi    bo   in   cs us sy id wa st gu
 1  0 244072 5529504 1545392 17975004    0    0     0     0 12661 172921  5  3 92  0  0  0
 0  1 244072 5408796 1545392 18098284    0    0     0 88064 6180 62156  2  2 92  5  0  0
 0  1 244072 5408796 1545392 18098284    0    0     0 95232  575  654  0  0 92  8  0  0
 0  0 244072 5706420 1545392 17596308    0    0     0 67692 1426 2470  1  1 93  6  0  0
 0  0 244072 5724520 1545392 17596308    0    0     0     0  816 1693  1  0 99  0  0  0
 0  0 244072 5721300 1545404 17596296    0    0     0   212 1572 3540  1  0 98  1  0  0
 0  0 244072 5729364 1545404 17596308    0    0     0     0  422  701  1  0 99  0  0  0
 0  0 244072 5737428 1545404 17596308    0    0     0     0  418  653  1  0 99  0  0  0
 0  0 244072 5747736 1545404 17596308    0    0     0     0  392  615  1  0 99  0  0  0
 0  0 244072 5713464 1545404 17596308    0    0     0     0 4036 13932  9  1 90  0  0  0
 0  0 244072 5731064 1545404 17596308    0    0     0     0  342  530  0  0 100  0  0  0


Every time such a lock happens I find such a burst of io (here starting at line 1 after the two-lined header in the middle of the dump.
According to the manpage of vmstat the according fields are:
IO
bi: Kibibyte received from a block device (KiB/s).
bo: Kibibyte sent to a block device (KiB/s).

System
in: The number of interrupts per second, including the clock.
cs: The number of context switches per second.

CPU
These are percentages of total CPU time.
us: Time spent running non-kernel code. (user time, including nice time)
sy: Time spent running kernel code. (system time)
id: Time spent idle. Prior to Linux 2.5.41, this includes IO-wait time.
wa: Time spent waiting for IO. Prior to Linux 2.5.41, included in idle.

For me it looks like there are bursts of harddisk input and output.

But why does this affect only opengl related programs as it seems?
And where did it come from?

What can I do to improve this (annoying) situation?

My system:
OS: Gentoo 2.15 x86_64
Host: MS-7C02 (1.0)
Kernel: 6.8.2 (vanilla)
Shell: zsh 5.9
Display (HP LP2475w): 1920x1200 @ 60Hz
Bios (UEFI): 3.60 (5.14)
WM: Openbox (X11)
Terminal: WezTerm 20240325-093507-e5ac32f2
Terminal Font: JetBrains Mono
CPU: AMD Ryzen 5 3600 (12) @ 4.21 GHz
MOBO: B450 TOMAHAWK MAX (MS-7C02), Micro-Star International Co., Ltd
GPU: NVIDIA GeForce RTX 2060 SUPER
Memory: 7.90 GiB / 31.30 GiB (25%)
Swap: 238.35 MiB / 512.00 MiB (47%)

Best regards,
Northfrisia

PS:
IF I interpret the burst of IO (above) correctly...
...then there is an IO burst to the harddisk.
In that case (for whatever reason) the Nvidia-GPU cannot get access to the bus and is "locked out" for
a moment (or two). Or in other words: Harddisk IO and GPU IO are mutual exclusive...not in general but
with my setup / my hardware.

Did I made a stupid error while building my PC (graphics card in the wrong slot for example) ?
Did I made a equivalent stupid error while configuring my kernel (vanilla) ?
What can I investigate next?
Back to top
View user's profile Send private message
paulj
Guru
Guru


Joined: 30 Sep 2004
Posts: 513
Location: Wales, UK

PostPosted: Mon Apr 01, 2024 7:52 am    Post subject: Reply with quote

I don't know enough to comment on your hardware choices, or whether this has an impact, nor have I used vmstat before. However, your symptoms remind me of utilising swap (even though your vmstat results suggest there isn't a memory issue). Although 32Gb of memory, and Openbox should be light touch - are you doing something particularly heavy in blender?
  • You could try running some stress testing using stress-ng and see if the delays are present when not utilising the swap space.
  • Maybe you need to consider increasing the memory size?
Hopefully someone with more knowledge will come along and help shortly!
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Portage & Programming All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum