Graphic card memory usage

I have got Intel HD Graphics 520 and generally I am quite happy with its performance under Gnome 42.X. Yet I have noticed that when running KVM/QEMU vms - let me cal them - “application windows” tend to stall when being moved around the screen yet switching between any already open apps and “virtual desktops” is pretty much smooth and flawless. In BIOS I extended the ram assigned to the GPU from 256MB to 512MB which looks to be resolving the problem. However, something I am into is monitoring the graphic card’s ram usage to get an actual proof. Is there a reasonable and convenient way to do it?

While googling for the ideas I came across this:
http://www.gremedy.com/downloadLinux.php

However this is quite old.

If anyone has got some experience in this area and would like to share it that would be great!

Thanks in advance!

Lately I have been running:

  Display: wayland server: X.Org
    v: 1.22.1.3 with: Xwayland
    v: 22.1.3
    compositor: gnome-shell v: 42.4
    driver: gpu: i915
    resolution: 1920x1080~60Hz
  OpenGL: renderer: Mesa Intel HD
    Graphics 520 (SKL GT2) v: 4.6
    Mesa 22.2.0-rc3

1920x1200 display connected on my 24/7 box running 5 web browsers & countless tabs, plus other software. BIOS not checked for preallocated VRAM:

# lspci | grep VGA
00:02.0 VGA compatible controller: Intel Corporation 4th Generation Core Processor Family Integrated Graphics Controller (rev 06) # **Haswell**
# lspci -v -s 00:02.0
00:02.0 VGA compatible controller: Intel Corporation 4th Generation Core Processor Family Integrated Graphics Controller (rev 06) (prog-if 00 [VGA controller])
        Subsystem: Micro-Star International Co., Ltd. [MSI] Device 7850
        Flags: bus master, fast devsel, latency 0, IRQ 32
        Memory at f7800000 (64-bit, non-prefetchable) **size=4M**]
        Memory at e0000000 (64-bit, prefetchable) **size=256M**]
        I/O ports at f000 [size=64]
        [virtual] Expansion ROM at 000c0000 [disabled] [size=128]
        Capabilities: [90] MSI: Enable+ Count=1/1 Maskable- 64bit-
        Capabilities: [d0] Power Management version 2
        Capabilities: [a4] PCI Advanced Features
        Kernel driver in use: i915
        Kernel modules: i915

2560x1440 & 1920x1200 displays connected. Only Konsole running since boot. BIOS setting for pre-allocated VRAM: 128M[/size]:

# lspci | grep VGA
00:02.0 VGA compatible controller: Intel Corporation HD Graphics 630 (rev 04) # **Kaby Lake**
# lspci -v -s 00:02.0
00:02.0 VGA compatible controller: Intel Corporation HD Graphics 630 (rev 04) (prog-if 00 [VGA controller])
        DeviceName:  Onboard IGD
        Subsystem: ASUSTeK Computer Inc. Device 8694
        Flags: bus master, fast devsel, latency 0, IRQ 134
        Memory at f6000000 (64-bit, non-prefetchable) **size=16M**]
        Memory at e0000000 (64-bit, prefetchable) **size=256M**]
        I/O ports at f000 [size=64]
        Expansion ROM at 000c0000 [virtual] [disabled] [size=128]
        Capabilities: [40] Vendor Specific Information: Len=0c <?>
        Capabilities: [70] Express Root Complex Integrated Endpoint, MSI 00
        Capabilities: [ac] MSI: Enable+ Count=1/1 Maskable- 64bit-
        Capabilities: [d0] Power Management version 2
        Capabilities: [100] Process Address Space ID (PASID)
        Capabilities: [200] Address Translation Service (ATS)
        Capabilities: [300] Page Request Interface (PRI)
        Kernel driver in use: i915
        Kernel modules: i915

Same 2560x1440 & 1920x1200 displays connected. Only Konsole running since boot. BIOS setting for pre-allocated VRAM: 64M[/size][/size]:

# lspci | grep VGA
00:02.0 VGA compatible controller: Intel Corporation **RocketLake**-S GT1 [UHD Graphics 730] (rev 04)
# lspci -v -s 00:02.0
00:02.0 VGA compatible controller: Intel Corporation RocketLake-S GT1 [UHD Graphics 730] (rev 04) (prog-if 00 [VGA controller])
        DeviceName: Onboard - Video
        Subsystem: ASUSTeK Computer Inc. Device 8694
        Flags: bus master, fast devsel, latency 0, IRQ 141
        Memory at 6000000000 (64-bit, non-prefetchable) **size=16M**]
        Memory at 4000000000 (64-bit, prefetchable) **size=256M**]
        I/O ports at 3000 [size=64]
        Expansion ROM at 000c0000 [virtual] [disabled] [size=128]
        Capabilities: [40] Vendor Specific Information: Len=0c <?>
        Capabilities: [70] Express Root Complex Integrated Endpoint, MSI 00
        Capabilities: [ac] MSI: Enable+ Count=1/1 Maskable+ 64bit-
        Capabilities: [d0] Power Management version 2
        Capabilities: [100] Process Address Space ID (PASID)
        Capabilities: [200] Address Translation Service (ATS)
        Capabilities: [300] Page Request Interface (PRI)
        Kernel driver in use: i915
        Kernel modules: i915

I rechecked the Rocket Lake with a 1680x1050 display also connected, but result of the two lscpi commands did not change. I rebooted once more and changed VRAM pre-allocation from 64M to 1024M, and again lscpi output did not change.

I’ve never found how to show more than what the above shows about VRAM usage with Intel IGPUs, but I would be interested to know more.[/size][/size][/size]

Hi
Use intel_gpu_top?


zypper in intel-gpu-tools

[/size][/size][/size]

On virtual desktop with only Konsole running intel-gpu-top, on Haswell (gen4 graphics; clears screen):

intel-gpu-top -  188/ 188 MHz;   84% RC6;  0.03 Watts;        1 irqs/s

      IMC reads:        0 MiB/s
     IMC writes:       37 MiB/s

          ENGINE      BUSY                            MI_SEMA MI_WAIT
     Render/3D/0    0.00% |                         |      0%      0%
       Blitter/0    0.00% |                         |      0%      0%
         Video/0    0.00% |                         |      0%      0%
  VideoEnhance/0    0.00% |                         |      0%      0%

IMC reads occasionally jumps into 6 digits. IMC writes stays under 300 MiB/s.

Hi
Try;


glxinfo | grep -E 'device|memory'


glxinfo | grep -E 'device|memory'

Memory info (GL_NVX_gpu_memory_info):
    Dedicated video memory: 2048 MB
    Total available memory: 2048 MB
    Currently available dedicated video memory: 1272 MB

switcherooctl glxinfo | grep -E 'device|memory'

Memory info (GL_NVX_gpu_memory_info):
    Dedicated video memory: 2048 MB
    Total available memory: 2048 MB
    Currently available dedicated video memory: 1993 MB

# lspci | grep VGA
00:02.0 VGA compatible controller: Intel Corporation 4th Generation Core Processor Family Integrated Graphics Controller (rev 06)
# glxinfo | grep -E 'device|memory'
    **Video memory: 1536MB**
    Unified memory: yes
    GL_AMD_performance_monitor, GL_AMD_pinned_memory,
    GL_EXT_framebuffer_object, GL_EXT_framebuffer_sRGB, GL_EXT_memory_object,
    GL_EXT_memory_object_fd, GL_EXT_packed_depth_stencil, GL_EXT_packed_float,
    GL_AMD_performance_monitor, GL_AMD_pinned_memory,
    GL_EXT_gpu_shader4, GL_EXT_memory_object, GL_EXT_memory_object_fd,
    GL_EXT_memory_object, GL_EXT_memory_object_fd, GL_EXT_multi_draw_arrays,

Even multiple of 64/128/256/512, so I doubt it describes actual use, more like reservation for graphics use as required.