steam-for-linux icon indicating copy to clipboard operation
steam-for-linux copied to clipboard

Huge VRAM Usage, Increases Until Steam Is Closed

Open ghost opened this issue 3 years ago • 51 comments

Your system information

  • Steam client version (build number or date): 1686880776
  • Distribution (e.g. Ubuntu): Flatpak/NixOS
  • Opted into Steam client beta?: Yes
  • Have you checked for system updates?: Yes
  • Sysinfo Gist

Please describe your issue in as much detail as possible:

I've been getting errors in my games because I'm running out of VRAM. On further examination, I discovered via nvtop that xorg was using most of my VRAM, which was only freed again after closing Steam. Note that I have GPU Accelerated Rendering turned off.

May be related to https://github.com/ValveSoftware/steam-for-linux/issues/9516

Reproducing this issue:

I'm running the window manager i3 and I found repeatedly switching between the workspace with Steam and the workspace with the terminal running nvtop resulted in ever increasing VRAM on my machine. Starting a game also increases VRAM usage by approximately 50MB.

ghost avatar Jun 16 '23 19:06 ghost

I have the same problem on Pop!_OS.

One easy reproduction for me is to just resize the steam client (dragging the mouse in circles). After just a few second of resizing all 6GB of vram is eaten up by xorg and the desktop environment crashes, dropping me to the login screen.

I use the debian package of the steam-client (from the pop shop) and am not subscribed to the steam client beta

heikomat avatar Jun 17 '23 11:06 heikomat

Running on Arch Linux, having the same problem. Changing workspace and resizing the steam client increases the xorg vram usage by a crazy amount. I use the steam package from the aur and am not subscribed to the steam client beta.

xjunko avatar Jun 17 '23 11:06 xjunko

I am also on Arch with i3wm and use the steam package from Multilib. I started seeing it late in the beta but wasn't able to narrow down when / why it happened. Currently not using the Beta client.

System info gist: https://gist.github.com/husjon/97c4cebf276b66038aaea621034b3981 Quick video showing how quickly it balloons: https://youtu.be/FCXA31aTlRw Keep an eye on the Xorg Memory usage in the bottom right window.

husjon avatar Jun 17 '23 16:06 husjon

get the same issue on arch + my usual i3wm or even gnome(just for testing) when resizing the window/swapping workspaces or going from the library->store page , also got as much hw accelleration turned off as possible to save vram nvidia Driver Version: 530.41.03

FredrikHson avatar Jun 20 '23 15:06 FredrikHson

Same issue here, after a few seconds of resizing the window, Steam fills up all of my 12GB of VRAM.

As a workaround, Steam can be started with the -vgui flag to revert back to the old UI until there is a proper fix.

Olexorus avatar Jun 22 '23 12:06 Olexorus

I've had the same issue for some time now. I'm running latest Debian with i3wm and Nvidia GPU. Switching windows in i3wm to and from a steam window also seems to produce this increase in VRAM usage by Steam. For some games I really feel the need to kill steam while playing to avoid lag, which has not been the case before. The -vgui workaround means I can't log in to 'Friends' Could add more information but I think most of it has already been said by others.

KarlHornell avatar Jul 02 '23 22:07 KarlHornell

This is also happening for me. I'm on arch linux using awesome as my window manager and an Nvidia GPU.

Syvraa avatar Jul 19 '23 18:07 Syvraa

-vgui stopped working in the latest beta, making me very unhappy, my game stutters like crazy when I hit VRAM limit, and, you know, it's Steam-only now, it absolutely has to be launched by Steam.

But check this out, I'm in game, can't restart Steam:

+---------------------------------------------------------------------------------------+
| Processes:                                                                            |
|  GPU   GI   CI        PID   Type   Process name                            GPU Memory |
|        ID   ID                                                             Usage      |
|=======================================================================================|
|    0   N/A  N/A      1895      G   /usr/libexec/Xorg                          1597MiB |
|    0   N/A  N/A     75851      G   ...ling,SpareRendererForSitePerProcess       31MiB |
|    0   N/A  N/A    300059      G   /usr/lib64/seamonkey/seamonkey                5MiB |
|    0   N/A  N/A    711116      G   ...local/share/Steam/ubuntu12_32/steam       18MiB |
|    0   N/A  N/A    711178      G   ...re/Steam/ubuntu12_64/steamwebhelper       16MiB |
|    0   N/A  N/A    723173      G   /usr/lib64/firefox/firefox                   23MiB |
|    0   N/A  N/A    841566    C+G   ...ns\client\bin\pc\QuakeChampions.exe     3907MiB |
+---------------------------------------------------------------------------------------+
# kill -9 711178
# nvidia-smi 
(...)
+---------------------------------------------------------------------------------------+
| Processes:                                                                            |
|  GPU   GI   CI        PID   Type   Process name                            GPU Memory |
|        ID   ID                                                             Usage      |
|=======================================================================================|
|    0   N/A  N/A      1895      G   /usr/libexec/Xorg                           384MiB |
|    0   N/A  N/A     75851      G   ...ling,SpareRendererForSitePerProcess       24MiB |
|    0   N/A  N/A    300059      G   /usr/lib64/seamonkey/seamonkey                5MiB |
|    0   N/A  N/A    711116      G   ...local/share/Steam/ubuntu12_32/steam       18MiB |
|    0   N/A  N/A    723173      G   /usr/lib64/firefox/firefox                   23MiB |
|    0   N/A  N/A    841566    C+G   ...ns\client\bin\pc\QuakeChampions.exe     3907MiB |
|    0   N/A  N/A    845410      G   ...re/Steam/ubuntu12_64/steamwebhelper        7MiB |
+---------------------------------------------------------------------------------------+

I can kill steamwebhelper while the game is on. The Steam window closes, new one loads on the current desktop, but the game continues running.

Oh, and of course I have DISABLED "Enable GPU accelerated rendering in web views" as well as "Enable hardware video decoding" (just in case) whenever this started, which never helped, but -vgui did. RIP -vgui [*]

Nvidia 535.54.03, MATE (marco is the WM), Xorg 1.20.14

Lamieur avatar Jul 22 '23 15:07 Lamieur

So I've noticed nvidia driver 535.86.05 is out, promising fixes for memory leaks. It only mentioned leaks during VT switching and Wayland, so neither is our case, but it was worth a try. I'm sad to report, 535.86.05 does NOT help the Steam VRAM leak.

Steam also updated to newer beta (from yesterday), no change in this behavior (now Store goes full black when you look at it the wrong way, but even in the black state, it still leaks :))

I've tested replacing the WM (marco --replace &) - no change to VRAM usage. It's just between the embedded Chromium and Xorg, the WM doesn't matter.

I've also noticed the leak in normal usage happens when I switch desktops (specifically, when going to/from the desktop with Steam). That's why it takes me a day or so to actually achieve the 1,5 GB that breaks my game (already set to medium textures as a partial work-around).

So I tested other means of making it leak VRAM very fast:

  1. You can minimize/restore the Steam window. For me it's -5 MB when minimizing, +30 when restoring, +25 MB on average.
  2. You can simply grab the Steam window's edge and swipe around, so it resizes continuously. Way faster than minimizing/restoring.
  3. You can do Alt-F6/F5 (maximize/restore binds if you don't have them) repeatedly, I think this is even faster than mouse dragging (that has a delay and refreshes less often).

With Alt-F6/F5 smashing, I can eat up full 10 GB of VRAM in less than 40 seconds :) Compare that to 55 seconds by dragging the mouse - who would think I'll be speedrunning VRAM exhaustion of Steam client today! :))

Again: the workaround is killing steamwebhelper. PS. Steam will restart hundreds of those after a while, ~15 more each time, doesn't matter if you kill -9 the main one, or killall steamwebhelper, they will multiply :)

Lamieur avatar Jul 22 '23 16:07 Lamieur

I have another workaround, you can run Steam in software rendering mode with the following environment variables:

__GLX_VENDOR_LIBRARY_NAME=mesa
GALLIUM_DRIVER=softpipe
MESA_LOADER_DRIVER_OVERRIDE=softpipe
LIBGL_ALWAYS_SOFTWARE=1

Then just unset those variables in the launch option for the game, so that the game doesn't run in software mode.

There's some other options for software drivers, swr and llvmpipe. See what works best for you.

ghost avatar Jul 22 '23 20:07 ghost

As a quick test I installed Gnome to try out a more traditional desktop environment (which is shipped with f.ex Ubuntu). It seem to run on Wayland as default and I was not able to replicate this issue there at all, no matter how much I was resizing the window or switching desktop / workspaces. Switching Gnome to run on Xorg however the issue is there once again and it does not take long for Steam to gobble up the available VRAM.

husjon avatar Jul 23 '23 10:07 husjon

I am experiencing this issue on Debian 11.7, kernel 5.10.0-23-amd64. The impact is that, if I don't restart Steam, a launched game will lag horribly due to a lack of VRAM.

Steam About info:

Steam Version:  1689034492
Steam Client Build Date:  Mon, Jul 10 4:59 PM UTC -08:00
Steam Web Build Date:  Mon, Jul 10 10:48 AM UTC -08:00
Steam API Version:  SteamClient020

I use the i3 window manager (Airblader gaps fork built from source). After a few hours usage I routinely see Xorg VRAM usage (as reported by nvidia-smi) at ~5GB+. This memory usage seems to trend upwards whether I'm interacting with Steam or not. Quitting Steam sends Xorg VRAM usage down to ~313MB on my system.

I have a GeForce GTX 1070, nvidia-smi version info:

NVIDIA-SMI 470.182.03   Driver Version: 470.182.03   CUDA Version: 11.4

Happy to add any info if useful.

Update: it appears interacting with Steam (circling my mouse around the screen so that it hovers over lots of different elements) makes the usage increase rapidly. Like ~200MB in 10 seconds of interaction rapid.

jwhear avatar Jul 27 '23 04:07 jwhear

Same issue. I can get to INSANE 7 GB + xorg VRAM allocation in less than 2 minutes, just switching between workplace with steam and any other. env: Steam client version (build number or date): 1689034492 Distribution (e.g. Ubuntu): Arch (steam from multilib, official repo, FYI) Opted into Steam client beta?: No Have you checked for system updates?: Yes Short system info: arch linux, zen kernel, nvidia + nvidia closed source driver, i3wm

System info : Computer Information:

Manufacturer: ASUSTeK COMPUTER INC. Model: P8H67 Form Factor: Desktop No Touch Input Detected Processor Information: CPU Vendor: GenuineIntel CPU Brand: Intel(R) Xeon(R) CPU E31240 @ 3.30GHz CPU Family: 0x6 CPU Model: 0x2a CPU Stepping: 0x7 CPU Type: 0x0 Speed: 3700 MHz 8 logical processors 4 physical processors Hyper-threading: Supported FCMOV: Supported SSE2: Supported SSE3: Supported SSSE3: Supported SSE4a: Unsupported SSE41: Supported SSE42: Supported AES: Supported AVX: Supported AVX2: Unsupported AVX512F: Unsupported AVX512PF: Unsupported AVX512ER: Unsupported AVX512CD: Unsupported AVX512VNNI: Unsupported SHA: Unsupported CMPXCHG16B: Supported LAHF/SAHF: Supported PrefetchW: Unsupported Operating System Version: "Arch Linux" (64 bit) Kernel Name: Linux Kernel Version: 6.4.5-zen1-1-zen X Server Vendor: The X.Org Foundation X Server Release: 12101008 X Window Manager: i3 Steam Runtime Version: steam-runtime_0.20230509.49499 Video Card: Driver: NVIDIA Corporation NVIDIA GeForce GTX 1070/PCIe/SSE2 Driver Version: 4.6.0 NVIDIA 535.86.05 OpenGL Version: 4.6 Desktop Color Depth: 24 bits per pixel Monitor Refresh Rate: 164 Hz VendorID: 0x10de DeviceID: 0x1b81 Revision Not Detected Number of Monitors: 1 Number of Logical Video Cards: 1 Primary Display Resolution: 2560 x 1440 Desktop Resolution: 2560 x 1440 Primary Display Size: 23.50" x 13.23" (26.97" diag), 59.7cm x 33.6cm (68.5cm diag) Primary Bus: PCI Express 16x Primary VRAM: 8192 MB Supported MSAA Modes: 2x 4x 8x 16x Sound card: Audio device: Realtek ALC887-VD Memory: RAM: 15960 Mb VR Hardware: VR Headset: None detected Miscellaneous: UI Language: English LANG: en_US.UTF-8 Total Hard Disk Space Available: 89888 MB Largest Free Hard Disk Block: 59526 MB Storage: Number of SSDs: 3 SSD sizes: 1000G,500G,128G (pay attention, detected definetily wrong, i have 1TB hdd + 500GB ssd + 128GB system ssd, all space allocated) Number of HDDs: 0 Number of removable drives: 0

nvidia-smi cub@archlinux ~/tmp> nvidia-smi

Tue Aug 1 07:15:18 2023
+---------------------------------------------------------------------------------------+ | NVIDIA-SMI 535.86.05 Driver Version: 535.86.05 CUDA Version: 12.2 | |-----------------------------------------+----------------------+----------------------+ | 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 GTX 1070 Off | 00000000:01:00.0 On | N/A | | 14% 56C P0 45W / 151W | 7306MiB / 8192MiB | 3% Default | | | | N/A | +-----------------------------------------+----------------------+----------------------+

+---------------------------------------------------------------------------------------+ | Processes: | | GPU GI CI PID Type Process name GPU Memory | | ID ID Usage | |=======================================================================================| | 0 N/A N/A 30597 G /usr/lib/Xorg 7078MiB | | 0 N/A N/A 30801 G ...144 --enable-features=WebUIDarkMode 78MiB | | 0 N/A N/A 38691 G kitty 4MiB | | 0 N/A N/A 50809 G kitty 3MiB | | 0 N/A N/A 124822 G kitty 5MiB | | 0 N/A N/A 151051 G ...local/share/Steam/ubuntu12_32/steam 4MiB | | 0 N/A N/A 151059 G ...re/Steam/ubuntu12_64/steamwebhelper 22MiB | | 0 N/A N/A 151117 G ...eam/logs/cef_log.txt --shared-files 91MiB | +---------------------------------------------------------------------------------------+

kaarelen avatar Aug 01 '23 05:08 kaarelen

A new version of Steam has just been released and now neither beta or stable can be used with -vgui and we need to restart Steam a few times a day :frowning_face:

Stable:

Steam Version:  1690583737
Steam Client Build Date:  Fri, Jul 28 8:44 PM UTC -08:00
Steam Web Build Date:  Sat, Jul 29 12:21 AM UTC -08:00
Steam API Version:  SteamClient020

husjon avatar Aug 01 '23 21:08 husjon

Also having this issue as well.

J-Pai avatar Aug 02 '23 04:08 J-Pai

It's possible to downgrade back to the old build and continue using -vgui with this guide: https://steamcommunity.com/discussions/forum/0/6516193260168294059/

Basically it uses an archive.org link to force Steam to downgrade, and then disables updates. Of course this is a very ugly workaround, but at least it's usable, unlike the current version.

Olexorus avatar Aug 03 '23 15:08 Olexorus

It's possible to downgrade back to the old build and continue using -vgui with this guide

I've followed that 30 times (archive.org throttled me to 20 Mbps after a few tries), disabling beta participation, entering either "false" or "disabled" (because the guide has 3 different versions!) into ~/.local/share/Steam/steam.cfg - nothing helped.

What I was missing was: rm -rf ~/.local/share/Steam/package/*

It finally worked. Thanks for pointing me in that direction. I have steam -vgui working again. But it's ummm... not so good.

Of course current Steam is bonkers, yesterday I had a black screen (100% reproducible if you're in the Store and switch desktops) while trying to buy a game. But I managed to buy it (you can go Store->Library->Store, refresh, it doesn't forget your order), then took screenshots of a game and the new GUI can't even display them (actually any screenshots at all). This old version with -vgui has no VRAM leak, no black screens (but a white screen when going to the Store for the first time, OBVIOUSLY :D)... but of course you can't do anything with it because of issue #9237.

I don't know what's worse, having to killall -9 steamwebhelper every hour, or having to ctrl-click everything, otherwise no menus work... I'll think about it.

Lamieur avatar Aug 06 '23 20:08 Lamieur

With Alt-F6/F5 smashing, I can eat up full 10 GB of VRAM in less than 40 seconds :) Compare that to 55 seconds by dragging the mouse - who would think I'll be speedrunning VRAM exhaustion of Steam client today! :))

I got inspired by this post, so here's my first PB :)

https://youtu.be/0XB9hnADQkY

grrbhen avatar Aug 08 '23 04:08 grrbhen

@grrbhen AHAHAHAHHA, you're genius!

kaarelen avatar Aug 08 '23 10:08 kaarelen

With the current Beta and Nvidia drivers I see no issues with VRAM leak, more testing needed. :crossed_fingers: https://youtu.be/wE9gmSnlr-0

Steam Version:  1692318383
Steam Client Build Date:  Fri, Aug 18 2:07 AM UTC -08:00
Steam Web Build Date:  Thu, Aug 17 11:01 PM UTC -08:00
Steam API Version:  SteamClient020
❯ pacman -Q nvidia
nvidia 535.98-1

husjon avatar Aug 18 '23 22:08 husjon