Reduce VRAM to increase RAM?

Hello,

I think I came here a few months ago, saying that an incorrect amount of RAM had been detected, and one of you guys told me that it was given away to GPU as VRAM. Is it possible to recover that 2GB RAM?

My memory usage on idle is usually between the high 60s and low 80s. I own an HP 15s-gr0xxx, if that matters.

System:
  Kernel: 6.0.6-zen1-1-zen arch: x86_64 bits: 64 compiler: gcc v: 12.2.0
    parameters: BOOT_IMAGE=/@/boot/vmlinuz-linux-zen
    root=UUID=b035583e-b8e2-48c0-87f9-a0552ffa0e5b rw rootflags=subvol=@
    splash rd.udev.log_priority=3 vt.global_cursor_default=0 loglevel=3
    sysrq_always_enabled=1 resume=UUID=044B5092427CE440
  Desktop: GNOME v: 43.0 tk: GTK v: 3.24.34 wm: gnome-shell dm: GDM v: 43.0
    Distro: Garuda Linux base: Arch Linux
Machine:
  Type: Laptop System: HP product: HP Laptop 15s-gr0xxx
    v: Type1ProductConfigId serial: <filter> Chassis: type: 10 serial: <filter>
  Mobo: HP model: 87D1 v: 38.25 serial: <filter> UEFI: Insyde v: F.32
    date: 08/02/2022
Battery:
  ID-1: BAT1 charge: 36.4 Wh (100.3%) condition: 36.3/40.9 Wh (88.7%)
    volts: 12.9 min: 11.3 model: Hewlett-Packard PABAS0241231 type: Li-ion
    serial: <filter> status: not charging
CPU:
  Info: model: AMD Ryzen 5 3500U with Radeon Vega Mobile Gfx socket: FP5
    bits: 64 type: MT MCP arch: Zen/Zen+ note: check gen: 1 level: v3
    note: check built: 2019 process: GF 12nm family: 0x17 (23)
    model-id: 0x18 (24) stepping: 1 microcode: 0x8108109
  Topology: cpus: 1x cores: 4 tpc: 2 threads: 8 smt: enabled cache:
    L1: 384 KiB desc: d-4x32 KiB; i-4x64 KiB L2: 2 MiB desc: 4x512 KiB
    L3: 4 MiB desc: 1x4 MiB
  Speed (MHz): avg: 2100 min/max: 1400/2100 boost: disabled
    base/boost: 2100/3700 scaling: driver: acpi-cpufreq governor: performance
    volts: 1.2 V ext-clock: 100 MHz cores: 1: 2100 2: 2100 3: 2100 4: 2100
    5: 2100 6: 2100 7: 2100 8: 2100 bogomips: 33539
  Flags: avx avx2 ht lm nx pae sse sse2 sse3 sse4_1 sse4_2 sse4a ssse3 svm
  Vulnerabilities:
  Type: itlb_multihit status: Not affected
  Type: l1tf status: Not affected
  Type: mds status: Not affected
  Type: meltdown status: Not affected
  Type: mmio_stale_data status: Not affected
  Type: retbleed mitigation: untrained return thunk; SMT vulnerable
  Type: spec_store_bypass mitigation: Speculative Store Bypass disabled via
    prctl
  Type: spectre_v1 mitigation: usercopy/swapgs barriers and __user pointer
    sanitization
  Type: spectre_v2 mitigation: Retpolines, IBPB: conditional, STIBP:
    disabled, RSB filling, PBRSB-eIBRS: Not affected
  Type: srbds status: Not affected
  Type: tsx_async_abort status: Not affected
Graphics:
  Device-1: AMD Picasso/Raven 2 [Radeon Vega Series / Radeon Mobile Series]
    vendor: Hewlett-Packard driver: amdgpu v: kernel arch: GCN-5 code: Vega
    process: GF 14nm built: 2017-20 pcie: gen: 3 speed: 8 GT/s lanes: 16
    ports: active: eDP-1 empty: HDMI-A-1 bus-ID: 04:00.0 chip-ID: 1002:15d8
    class-ID: 0300 temp: 58.0 C
  Device-2: Luxvisions Innotech HP TrueVision HD Camera type: USB
    driver: uvcvideo bus-ID: 3-2.1:3 chip-ID: 30c9:0035 class-ID: fe01
    serial: <filter>
  Display: server: X.Org v: 22.1.4 with: Xwayland v: 22.1.4
    compositor: gnome-shell driver: X: loaded: radeon unloaded: modesetting
    alternate: fbdev,vesa gpu: amdgpu display-ID: :0 screens: 1
  Screen-1: 0 s-res: 1920x1080 s-dpi: 96 s-size: 508x286mm (20.00x11.26")
    s-diag: 583mm (22.95")
  Monitor-1: eDP-1 mapped: XWAYLAND0 model: ChiMei InnoLux 0x153b
    built: 2020 res: 1920x1080 hz: 60 dpi: 143 gamma: 1.2
    size: 340x190mm (13.39x7.48") diag: 394mm (15.5") ratio: 16:9 modes:
    max: 1920x1080 min: 640x480
  OpenGL: renderer: AMD Radeon Vega 8 Graphics (raven LLVM 14.0.6 DRM 3.48
    6.0.6-zen1-1-zen) v: 4.6 Mesa 22.2.2 direct render: Yes
Audio:
  Device-1: AMD Raven/Raven2/Fenghuang HDMI/DP Audio vendor: Hewlett-Packard
    driver: snd_hda_intel v: kernel pcie: gen: 3 speed: 8 GT/s lanes: 16
    bus-ID: 04:00.1 chip-ID: 1002:15de class-ID: 0403
  Device-2: AMD ACP/ACP3X/ACP6x Audio Coprocessor vendor: Hewlett-Packard
    driver: snd_pci_acp3x v: kernel
    alternate: snd_rn_pci_acp3x,snd_pci_acp5x,snd_pci_acp6x,snd_acp_pci,snd_rpl_pci_acp6x,snd_sof_amd_renoir
    pcie: gen: 3 speed: 8 GT/s lanes: 16 bus-ID: 04:00.5 chip-ID: 1022:15e2
    class-ID: 0480
  Device-3: AMD Family 17h/19h HD Audio vendor: Hewlett-Packard
    driver: snd_hda_intel v: kernel pcie: gen: 3 speed: 8 GT/s lanes: 16
    bus-ID: 04:00.6 chip-ID: 1022:15e3 class-ID: 0403
  Sound API: ALSA v: k6.0.6-zen1-1-zen running: yes
  Sound Server-1: PulseAudio v: 16.1 running: no
  Sound Server-2: PipeWire v: 0.3.59 running: yes
Network:
  Device-1: Realtek RTL8111/8168/8411 PCI Express Gigabit Ethernet
    vendor: Hewlett-Packard driver: r8169 v: kernel pcie: gen: 1
    speed: 2.5 GT/s lanes: 1 port: 3000 bus-ID: 01:00.0 chip-ID: 10ec:8168
    class-ID: 0200
  IF: eno1 state: down mac: <filter>
  Device-2: Realtek RTL8821CE 802.11ac PCIe Wireless Network Adapter
    vendor: Hewlett-Packard driver: rtl8821ce v: N/A
    modules: rtw88_8821ce,8821ce pcie: gen: 1 speed: 2.5 GT/s lanes: 1
    port: 2000 bus-ID: 02:00.0 chip-ID: 10ec:c821 class-ID: 0280
  IF: wlo1 state: up mac: <filter>
  IF-ID-1: anbox0 state: down mac: <filter>
Bluetooth:
  Device-1: Realtek Bluetooth 4.2 Adapter type: USB driver: btusb v: 0.8
    bus-ID: 3-2.3:4 chip-ID: 0bda:b00a class-ID: e001 serial: <filter>
  Report: bt-adapter ID: hci0 rfk-id: 1 state: up address: <filter>
Drives:
  Local Storage: total: 476.94 GiB used: 125.09 GiB (26.2%)
  SMART Message: Required tool smartctl not installed. Check --recommends
  ID-1: /dev/nvme0n1 maj-min: 259:0 vendor: Western Digital model: PC SN530
    SDBPNPZ-512G-1006 size: 476.94 GiB block-size: physical: 512 B
    logical: 512 B speed: 31.6 Gb/s lanes: 4 type: SSD serial: <filter>
    rev: HPS2 temp: 51.9 C scheme: GPT
Partition:
  ID-1: / raw-size: 200 GiB size: 200 GiB (100.00%) used: 91.92 GiB (46.0%)
    fs: btrfs block-size: 4096 B dev: /dev/nvme0n1p1 maj-min: 259:1
  ID-2: /boot/efi raw-size: 1024 MiB size: 1022 MiB (99.80%) used: 72.1 MiB
    (7.1%) fs: vfat block-size: 512 B dev: /dev/nvme0n1p3 maj-min: 259:3
  ID-3: /home raw-size: 200 GiB size: 200 GiB (100.00%) used: 91.92 GiB
    (46.0%) fs: btrfs block-size: 4096 B dev: /dev/nvme0n1p1 maj-min: 259:1
  ID-4: /var/log raw-size: 200 GiB size: 200 GiB (100.00%) used: 91.92 GiB
    (46.0%) fs: btrfs block-size: 4096 B dev: /dev/nvme0n1p1 maj-min: 259:1
  ID-5: /var/tmp raw-size: 200 GiB size: 200 GiB (100.00%) used: 91.92 GiB
    (46.0%) fs: btrfs block-size: 4096 B dev: /dev/nvme0n1p1 maj-min: 259:1
Swap:
  Kernel: swappiness: 133 (default 60) cache-pressure: 100 (default)
  ID-1: swap-1 type: zram size: 5.73 GiB used: 4.54 GiB (79.2%)
    priority: 100 dev: /dev/zram0
Sensors:
  System Temperatures: cpu: 58.4 C mobo: N/A gpu: amdgpu temp: 58.0 C
  Fan Speeds (RPM): N/A
Info:
  Processes: 385 Uptime: 20m wakeups: 1 Memory: 5.73 GiB used: 4.31 GiB
  (75.2%) Init: systemd v: 251 default: graphical tool: systemctl
  Compilers: gcc: 12.2.0 clang: 14.0.6 Packages: 1632 pm: pacman pkgs: 1621
  libs: 458 tools: gnome-software,pamac,paru,yay pm: flatpak pkgs: 11
  Shell: fish (sudo) v: 3.5.1 running-in: kitty inxi: 3.3.22
Garuda (2.6.9-1):
  System install date:     2022-10-27
  Last full system update: 2022-10-30
  Is partially upgraded:   No
  Relevant software:       NetworkManager
  Windows dual boot:       Yes
  Snapshots:               Snapper
  Failed units:            systemd-networkd-wait-online.service 

vram is necessary for your screen display. Without it, your screen can't display stuff.

I guess this should be handled at BIOS level (make sure yours is up-to-date and advanced features or the like are enabled, if applicable), if possible at all, depending on the available BIOS and possible architecture limitations.
See e g. here

But as said this depends also on the architecture. See this example here

Maybe you could enter an enquiry in both those forums.

6 Likes

Both of these methods, unfortunately do not work for me. Is there are alternate way, like to create a swap on vram, if that is even possible?

This is not necessarily indicative of an issue. Due to the way Linux uses RAM, it is altogether possible that even if you managed to release that 2GB of memory from VRAM to RAM you would end up with the same idle memory usage. Read more here: https://www.linuxatemyram.com/

3 Likes

I see the OOM-Killer in my dmesg log about twice or thrice a day.

My system uses 2.3GB/7.6GB on a fresh boot.
If I do some work(browsing, Spotify, text editing, pdfs ...) and then log out and log back in some time later, the system uses 3.2GB/7.6GB(with no apps running).

These readings are from the gnome-system-monitor app.

Whereas htop seems to show different readings(In htop the total memory available in 7.12GB)

I think gnome-system-monitor takes into account the memory used as VRAM(by the GPU) as well, whereas htop only displays the memory used by the CPU.

By the way, my integrated GPU has its own 512MB of dedicated VRAM.
image

That could be the reason why my htop memory is 7GB and yours 6GB.
(dedicated VRAM is more efficient than shared VRAM)

So everything is normal here for you.

You could check out the reading in gnome-system-monitor.

1 Like

Ah, okay then. Thanks!

By the way what did you get in system monitor?

Apart from the CPU usage on System Monitor and Bottom, which fluctuates from time-to-time, these are the results


I usually run VSCode, < 5 Firefox tabs, Spotify, > 10 PDF Files concurrently opened, Telegram, Signal and Discord at any given time.

EDIT: Just realized something. Is 11% CPU usage normal on KSwapd?

Interesting regarding the RAM in the system monitor.

Take a look here regarding kswapd:

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.