0

I am running i3 window manager on a single 4k display. However, I have 12 desktops and maybe 50 windows open. Recently I noticed that zoom video is very laggy at times, also it takes a second to redraw the screen content after switching desktops.

I am running nvidia gt1030 gpu with nvidia-470 drivers, kernel 5-11, ubuntu 20.4, X11 (not wayland). Nvidida-smi reports roughly 1.8G video memory used out of 2G in total, most of it by X11.

nvidia-smi reports X using 1.1G:

+-----------------------------------------------------------------------------+
| NVIDIA-SMI 470.63.01    Driver Version: 470.63.01    CUDA Version: 11.4     |
|-------------------------------+----------------------+----------------------+
| GPU  Name        Persistence-M| Bus-Id        Disp.A | Volatile Uncorr. ECC |
| Fan  Temp  Perf  Pwr:Usage/Cap|         Memory-Usage | GPU-Util  Compute M. |
|                               |                      |               MIG M. |
|===============================+======================+======================|
|   0  NVIDIA GeForce ...  Off  | 00000000:01:00.0  On |                  N/A |
| 35%   43C    P0    N/A /  30W |   1770MiB /  1985MiB |      0%      Default |
|                               |                      |                  N/A |
+-------------------------------+----------------------+----------------------+
                                                                           
+-----------------------------------------------------------------------------+
| Processes:                                                                        |
|  GPU   GI   CI        PID   Type   Process name                  GPU Memory |
|        ID   ID                                                   Usage      |
|=============================================================================|
|    0   N/A  N/A      1195      G   /usr/lib/xorg/Xorg                101MiB |
|    0   N/A  N/A      2156      G   /usr/lib/xorg/Xorg               1110MiB |
|    0   N/A  N/A      3283      G   ...AAAAAAAAA= --shared-files       54MiB |
|    0   N/A  N/A      3559      G   ...AAAAAAAAA= --shared-files       36MiB |
|    0   N/A  N/A      3960      G   ...AAAAAAAAA= --shared-files       98MiB |
|    0   N/A  N/A   1355789      G   ...AAAAAAAAA= --shared-files      123MiB |
|    0   N/A  N/A   1396950      G   /usr/lib/firefox/firefox          204MiB |
|    0   N/A  N/A   1397047      G   /usr/lib/firefox/firefox            0MiB |
|    0   N/A  N/A   1397098      G   /usr/lib/firefox/firefox            0MiB |
|    0   N/A  N/A   1397130      G   /usr/lib/firefox/firefox            0MiB |
+-----------------------------------------------------------------------------+

And this is sort of confirmed by xrestop: The top processes in terms of memory usage as reported by xrestop are

xrestop - Display: localhost
          Monitoring 54 clients. XErrors: 0
          Pixmaps: 1102671K total, Other:     156K total, All: 1102827K total

res-base Wins  GCs Fnts Pxms Misc   Pxm mem  Other   Total   PID Identifier    
0600000    83  161    1   78  696   796246K     23K 796269K   ?   i3
5200000    58   95    2   26  330    82590K     13K  82603K  9496 emacs
0200000     1    1    0    9  484    74992K     11K  75003K  2203 xcompmgr
5a00000    10   34    1  756  776    47929K     20K  47950K 84159 geeqie
1200000    27    2    1   24  142    47115K      5K  47120K  2304 Terminal
0000000     1    0    2    0  216    32400K      7K  32407K   ?   i3
...

So seems like the window manager it the largest culprit here while other common memory hogs (firefox in particular) onlys shows small footprint in the xrestop but then it has its own 200MB according to nvidia-smi.

Naively, 4k screen is approximately 8Mpixels or 32MB memory if one uses 32bit uncompressed storage. So 30-40 uncompressed screen images might amount to 1GB.

Anyone can enlighten me if the high video memory usage can cause video slowdown (in zoom, not in youtube)? Is there a way to lower it without closing windows and desktops?

3
  • a 1030 seems a bit under-powered for what you're doing with it (esp. 2GB VRAM seems like not enough, esp. at 4K resolution). Unfortunately, now is a terrible time to try to upgrade a video card (and has been for over a year and likely to remain terrible for at least another year or two), otherwise I'd suggest upgrading the video card. If you're lucky, you might be able to find an nvidia 1060 or a radeon 480 or 580 second-hand (but these are also in demand because current/new cards are under-supplied and over-priced and scalped to hell and back).
    – cas
    Oct 18, 2021 at 5:47
  • Radeon 6600s aren't exactly cheap (all GPUs are absurdly over-priced at the moment), but they're supposed to be much easier to get your hands on than other current gen video cards. and nvidia 1650 and 1660 cards are also not too hard to find.
    – cas
    Oct 18, 2021 at 5:48
  • Thanks everyone! I know about the current gpu crunch, otherwise will probably consider a card with more vram.
    – Ott Toomet
    Oct 18, 2021 at 14:29

1 Answer 1

1

The X video driver on modern graphic cards uses the GPU via textures, which in turn needs video memory. Windows also use video memory for the backing buffer.

So yes, potentially low video memory could cause lags, though one would have to investigate if that is the real reason in your case.

And it's easy to test: Reconfigure your number of desktops temporarily, open fewer windows, check memory usage, see if the issue persists.

7
  • You are right. Next time I restart the computer I can just manually experiment by adding windows/desktops and see what is zoom doing. I thought 2GB is plenty for what is mostly static images.
    – Ott Toomet
    Oct 18, 2021 at 14:30
  • It should be plenty, but some applications happen to cache static images through X in video memory, and then that adds up. You can use xrestop to try and find the guilty apps.
    – dirkt
    Oct 18, 2021 at 17:54
  • Thanks. Updated question w/xrestop, nvidia-smi outputs.
    – Ott Toomet
    Oct 19, 2021 at 4:21
  • Note that the Window Manager (i3 in your case) will collect allocated but not freed pixmem by applications that terminate (through crash, or otherwise), so I suspect that's what happened here. IIRC you also restart the WM while the system is running (fvwm can do that, I don't know about i3) to get rid of that pixmem.
    – dirkt
    Oct 20, 2021 at 4:59
  • 1
    I can confirm that after a restart, the desktop switching is almost instantaneous, comparable to what I see on intel UHD630 (intergrated gpu). Currently nvidia-smi only reports 700MB out of 2000 used. So it apparently is a video ram issue.
    – Ott Toomet
    Nov 19, 2021 at 14:19

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.