You are not logged in.

#1 2021-10-09 11:13:10

Wild Penguin
Member
Registered: 2015-03-19
Posts: 320

[SOLVED] VRAM usage / bloat of applications and DEs (mainly Firefox)

Hi all forum readers!

Recently I've noticed that from the 8GB of VRAM on my RX Vega 64 only as little as 6GB can be available for running a game. I run some quite demanding games, so this is certainly not optimal.

Investigating this, I noticed quite surprisingly that my Desktop Environment (along with it's applications) can consume up to 2GB of VRAM. I noticed that the main culprit is Firefox - by closing Firefox (with 2-4 windows, with 3-8 tabs open in each, which I would not call a worse case scenario by any stretch) anywhere around 600MB to 1000MB of VRAM will be freed. Closing Firefox certainly reduces microstutter in Games (despite Firefox is not actually used, nor is it doing something actually useful) - so these are not just figures but something which has an actual effect. Seems like background applications don't "free up" the VRAM they are using (at least Firefox doesn't).

I get some numbers with the help of radeontop. Here are some figures I got from a single test:

  • A normal desktop session with applications open: 2035 VRAM used (out of 8112MB)

  • After closing Firefox: 1272M

  • After closing all other applications (Steam, Discord): 951M

  • Logging out of Plasma/KDE (only sddm): 384M

  • Closing sddm: 192M

  • Closing folding@home: 36M

So, we can see here that folding@home can take 160MB, SDDM by itself a little shy of 200MB, KDE/Plasma just by itself ~600MB, some GPU-accelerated desktop applications ~150MB, but worst offender is Firefox with up to 1GB, which I find certainly not optimal, and actually quite bloaty.

Now my questions are: are these figures normal / commonplace? Can you replicate this figures on your setup (or is it just my setup)? I've tried to reduce desktop VRAM usage by shutting down desktop effect in Plasma, but that has no effect on VRAM use. I've enabled hardware video acceleration in Firefox, so that may be one cause of high(er) VRAM use, but I still find hundreds of megabyes of VRAM, yet  alone 1GB of use somewhat weird (for comparison: playing videos with mpv with hardware acceleration enabled uses no noticeable amount of VRAM).

Bottom line: I would like VRAM to be reserved to applications which actually need and benefit from high performance (games, folding when enabled). Applications which are in background should not reserve VRAM. I find it odd in any case they need up to an amount of an AAA+ game from a few years ago (despite mainly displaying 2D content).

EDIT: Made some minor clarifications, edited TYPOs. Here are some possibly significant details:
* My monitor is running at a resolution of 3440x1440
* I have 3 workspaces with 6 virtual desktops each. This means 18 virtual desktops in total. This may have an effect on Plasma VRAM usage.

Cheers!

p.s. If there exists an application which can list VRAM usage on a per-application basis, any tips are welcome. I could not find one for amdgpu, but I know for NVidia there is nvidia-smi, which can display VRAM usage per application.

Last edited by Wild Penguin (2021-11-11 16:15:06)

Offline

#2 2021-10-09 14:31:51

kokoko3k
Member
Registered: 2008-11-14
Posts: 2,393

Re: [SOLVED] VRAM usage / bloat of applications and DEs (mainly Firefox)

Can't help about specific vram usage question, but If you have an integrated gpu too, you can use that as the primary and fire up the discrete one only when playing, via prime.
https://wiki.archlinux.org/title/PRIME# … offloading

Expect a (little) performance hit, but a good tradeoff to have all of the vram available everytime imho.

Last edited by kokoko3k (2021-10-09 14:38:28)


Help me to improve ssh-rdp !
Retroarch User? Try my koko-aio shader !

Offline

#3 2021-11-11 16:14:53

Wild Penguin
Member
Registered: 2015-03-19
Posts: 320

Re: [SOLVED] VRAM usage / bloat of applications and DEs (mainly Firefox)

Using an PRIME sound interesting. However, as you noticed, that is a workaround, not a solution - and for me personally, not applicable since I don't have an IGP. It might work for some users in some situations, though.

However, this is not the reason I'm replying. I did a bit more research and it seems that if the GPU VRAM gets full enough, idle stuff starts to be moved into the GTT part (system memory unless I'm mistaken; I'm having difficulties finding a good source on what does this GTT actually mean). Also, I noticed that some software (firefox) actually uses the GPU if some sites (Youtube, for example) are open (in the background, not playing anything), and this is the more likely cause of microstutter; not VRAM usage per se. I can have "nicer" software (or "nicer" sites in Firefox), which still uses the VRAM to the same extend, and get no microstutter. Seems like I get the issue only if radeontop reports actual GPU usage without a game running and then start a game (the microstutter might be CPU related, too, but with 16 actual cores, that is a bit unlikely).

So, I'm marking as [SOLVED] since it seems things are actually working at least somewhat as designed (and the design is at least somewhat working), and the high VRAM usage is not the source of the microstutter, at least not in some cases. There is still the problem that some games actually detects the amount of VRAM used and refuse to increase settings (Red Dead Redemption 2/Online) in case there is not enough free VRAM in their eyes.

Last edited by Wild Penguin (2021-11-11 16:20:05)

Offline

Board footer

Powered by FluxBB