ValveSoftware / steam-for-linux

Issue tracking for the Steam for Linux beta client
4.26k stars 175 forks source link

vram memory leak with hardware acceleration #6715

Open at46 opened 4 years ago

at46 commented 4 years ago

Your system information

amd radeon 570 4gb with mesa 19.2.4 on kernel 5.3.9

Steam system information: https://gist.github.com/at46/51134de8e41a8aa24351b8a47a1344f4

Please describe your issue in as much detail as possible:

Steam seems to have a vram memory leak with hardware acceleration enabled. When resizing a chat window the vram usage goes up and up. I used GALLIUM_HUD="VRAM-usage" glxgears to watch vram usage. After starting steam the vram usage is 200 MB. With constantly resizing the chat window I can fill the vram up to 3.5 gb of 4 gb vram.

Steps for reproducing this issue:

  1. open steam
  2. make sure you have Enable GPU accelerated rendering in web views (requires restart) enabled
  3. open a chat window
  4. constantly resize the chat window
  5. see vram usage increase and never decrease as long as the chat window is open
NoXPhasma commented 4 years ago

This was also discovered a while a go in #6593, it still needs to be fixed.

kisak-valve commented 4 years ago

Thanks for pointing out the existing issue report. Let's use this issue issue report to track the vram leak because the original issue described in #6593 has been resolved.

Leopard1907 commented 4 years ago

This is hw , driver indepented btw. I have the same problem on Nvidia for a long time. Disabled gpu accel because it easily fills up more than half of my vram.

xpander69 commented 4 years ago

Confirming this issue. Managed to fill all my 11GB that my 1080Ti has with just around 30-40 resizes of the Steam window.

Myrddin-Wyllt commented 4 years ago

I'll add that the chat window is an unnecessary specificity; this issue also affects the Steam Library. Restarting Steam empties the VRAM as expected. I'd avoid window resizing until this issue can be fixed.

I'm tempted to turn GPU acceleration off again though...

WhiteSp1rit commented 4 years ago

Can confirm that this is still happening, just resizing Steam window adds several hundred MB of memory use, this memory does not get freed.

at46 commented 3 years ago

I just tested the hardware acceleration again but the memory leak is still there. It's a little disappointing that after over a year nothing happens with such easily reproducible errors.

xpander69 commented 3 years ago

Confirming that it still happens when resizing chat window: Steam window resizing will do that also, but with lower pace.

alex4321 commented 3 years ago

Ubuntu 21.10

nvidia-smi gives me the next output:

NVIDIA-SMI 470.74       Driver Version: 470.74       CUDA Version: 11.4
...
+-----------------------------------------------------------------------------+
| Processes:                                                                  |
|  GPU   GI   CI        PID   Type   Process name                  GPU Memory |
|        ID   ID                                                   Usage      |
|=============================================================================|
|    0   N/A  N/A      1332      G   /usr/lib/xorg/Xorg                910MiB |
|    0   N/A  N/A      1628      G   /usr/bin/gnome-shell              363MiB |
|    0   N/A  N/A     52909      G   ...AAAAAAAAA= --shared-files       61MiB |
|    0   N/A  N/A    128671      G   ...AAAAAAAAA= --shared-files      157MiB |
|    0   N/A  N/A    960652      G   ...e/Steam/ubuntu12_32/steam       90MiB |
|    0   N/A  N/A    960877      G   ./steamwebhelper                    3MiB |
|    0   N/A  N/A    961129      G   ./steamwebhelper                 5433MiB |
|    0   N/A  N/A   1160503      G   ...1/usr/lib/firefox/firefox      213MiB |
|    0   N/A  N/A   1170627      G   ...AAAAAAAAA= --shared-files       28MiB |
|    0   N/A  N/A   1911015      G   ...b/thunderbird/thunderbird       43MiB |
|    0   N/A  N/A   3358357      G   telegram-desktop                    2MiB |
+-----------------------------------------------------------------------------+

So it consumed ~5.5 Gb memory.

Steam package version 1634158817 (build from Oct 13 2021)

Bug exists with enabled GPU-accelerated webviews (including resizing-related behaviour), going to check if it exists with disabled (btw, I was sure that I disabled it previously a few days ago, when I noticed this issue first time, but now I can see it enabled in settings)

gardotd426 commented 3 years ago

@alex4321 what's your hardware and driver version? (EDIT: I see now you're on 470.74)

I can't get this issue to show up on Arch w/ 495 on my 3090. I've had Steam open on a store page for hours:

+-----------------------------------------------------------------------------+
| NVIDIA-SMI 495.44       Driver Version: 495.44       CUDA Version: 11.5     |
|-------------------------------+----------------------+----------------------+
| 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:0F:00.0  On |                  N/A |
| 60%   44C    P0   116W / 366W |   1488MiB / 24260MiB |     16%      Default |
|                               |                      |                  N/A |
+-------------------------------+----------------------+----------------------+

+-----------------------------------------------------------------------------+
| Processes:                                                                  |
|  GPU   GI   CI        PID   Type   Process name                  GPU Memory |
|        ID   ID                                                   Usage      |
|=============================================================================|
|    0   N/A  N/A    370674      G   /usr/lib/Xorg                     679MiB |
|    0   N/A  N/A    371153      G   ...AAAAAAAAA= --shared-files       31MiB |
|    0   N/A  N/A    371154      G   ...gAAAAAAAAA --shared-files        9MiB |
|    0   N/A  N/A    372902      G   plasmashell                        45MiB |
|    0   N/A  N/A    372956      G   kwin_x11                          157MiB |
|    0   N/A  N/A    373107      G   /usr/bin/kitty                      8MiB |
|    0   N/A  N/A    374332      G   ...gl=desktop --shared-files      249MiB |
|    0   N/A  N/A    377091      G   latte-dock                         32MiB |
|    0   N/A  N/A    379003      G   /usr/bin/kitty                      7MiB |
|    0   N/A  N/A    379861      G   /usr/bin/kitty                      8MiB |
|    0   N/A  N/A    397229      G   ...eamroot/ubuntu12_32/steam       32MiB |
|    0   N/A  N/A    397242      G   ./steamwebhelper                    4MiB |
|    0   N/A  N/A    397300      G   ...ef_log.txt --shared-files      147MiB |
+-----------------------------------------------------------------------------+

And it's only using 4MB of VRAM. And acceleration is definitely enabled.

at46 commented 2 years ago

While I can still increase the used VRAM with resizing a window, it now empties itself after a few seconds (Steam Client from March 5 2022).

at46 commented 2 years ago

Can anyone confirm that the VRAM empties itself now?

NoXPhasma commented 2 years ago

It does it for me, sometmes not every time. When I move the chat window it jumps from 21% up to 29% VRAM usage and then drops down to 28% when I let go and after a while it drops to 26%. And then it stays there.

To free the ram every time entirely, I have to close the offending process and reopen it. Why is this still not fixed and yet Valve adds more and more stuff which needs HW acceleration?

h1z1 commented 2 years ago

Curious.. does restarting your window manager free it too? ( kwin --replace , xfwm4 --replace etc). Just noticing a lot of memory is tied to X which for me is related to an old bug. xrestop can help determine what in X is eating it.

DekosAnjo commented 10 months ago

Three years and this bug still exists. Resizing the Steam window has become a big no-no for me, as I go to great lengths to never even maximize the window to avoid losing my precious VRAM. This is an issue for newcomers to Linux; they may not know how to identify the VRAM leakage from Steam and sometimes wrongly blame Linux when games don't run well. before resize: image After resize: image

xpander69 commented 10 months ago

Yeah. Can confirm this still happens. Posted on other issue also: https://github.com/ValveSoftware/steam-for-linux/issues/9638

kodatarule commented 10 months ago

Indeed the issue hasn't been resolved yet, also posted in https://github.com/ValveSoftware/steam-for-linux/issues/9638

Zi7ar21 commented 10 months ago

I am having the same problem, this and #9638 are indeed the same problem (except it's not just the chat window, it is any Steam window).

+---------------------------------------------------------------------------------------+ | Processes: | | GPU GI CI PID Type Process name GPU Memory | | ID ID Usage | |=======================================================================================| | 0 N/A N/A 1007 G /usr/lib/Xorg 3033MiB | | 0 N/A N/A 1334 G xfwm4 2MiB | | 0 N/A N/A 2827 G ...,WinRetrieveSuggestionsOnlyOnDemand 72MiB | | 0 N/A N/A 5958 G ...seed-version=20231218-080113.411000 224MiB | | 0 N/A N/A 6417 G ...local/share/Steam/ubuntu12_32/steam 2MiB | | 0 N/A N/A 6423 G ...re/Steam/ubuntu12_64/steamwebhelper 3MiB | | 0 N/A N/A 6464 G ...eam/logs/cef_log.txt --shared-files 96MiB | +---------------------------------------------------------------------------------------+

Steam also doesn't output anything to the console when I resize (`<username>` is a placeholder):

steam.sh[8119]: Running Steam on arch rolling 64-bit steam.sh[8119]: STEAM_RUNTIME is enabled automatically setup.sh[8191]: Steam runtime environment up-to-date! steam.sh[8119]: Steam client's requirements are satisfied [2023-12-29 22:01:26] Startup - updater built Dec 8 2023 00:32:59 [2023-12-29 22:01:26] Startup - Steam Client launched with: '/home//.local/share/Steam/ubuntu12_32/steam' 12/29 22:01:26 Init: Installing breakpad exception handler for appid(steam)/version(1702079146)/tid(8243) [2023-12-29 22:01:26] Loading cached metrics from disk (/home//.local/share/Steam/package/steam_client_metrics.bin) [2023-12-29 22:01:26] Using the following download hosts for Public, Realm steamglobal [2023-12-29 22:01:26] 1. https://client-update.akamai.steamstatic.com, /, Realm 'steamglobal', weight was 1000, source = 'update_hosts_cached.vdf' [2023-12-29 22:01:26] 2. https://cdn.cloudflare.steamstatic.com, /client/, Realm 'steamglobal', weight was 1, source = 'update_hosts_cached.vdf' [2023-12-29 22:01:26] 3. https://cdn.steamstatic.com, /client/, Realm 'steamglobal', weight was 1, source = 'baked in' [2023-12-29 22:01:26] Verifying installation... [2023-12-29 22:01:26] Verification complete

Steam logging initialized: directory: /home//.local/share/Steam/logs

XRRGetOutputInfo Workaround: initialized with override: 0 real: 0xf0833dc0 XRRGetCrtcInfo Workaround: initialized with override: 0 real: 0xf0832500 /usr/share/themes/Adwaita-dark/gtk-2.0/main.rc:733: error: unexpected identifier 'direction', expected character '}' /usr/share/themes/Adwaita-dark/gtk-2.0/hacks.rc:28: error: invalid string constant "normal_entry", expected valid string constant steamwebhelper.sh[8249]: Runtime for steamwebhelper: defaulting to /home//.local/share/Steam/ubuntu12_64/steam-runtime-heavy steamwebhelper.sh[8249]: glibc >= 2.34, partially disabling sandbox until CEF supports clone3() CAppInfoCacheReadFromDiskThread took 63 milliseconds to initialize Steam Runtime Launch Service: starting steam-runtime-launcher-service Steam Runtime Launch Service: steam-runtime-launcher-service is running pid 8350 bus_name=com.steampowered.PressureVessel.LaunchAlongsideSteam BRefreshApplicationsInLibrary 1: 1ms BuildCompleteAppOverviewChange: 222 apps RegisterForAppOverview 1: 16ms RegisterForAppOverview 2: 16ms


Do you guys have a similar configuration (indicating it may be an issue with Steam's interactions with external components) or are we all using different distros, desktop environments, graphics, etc. (indicating it is an issue with Steam's internals)
Zi7ar21 commented 10 months ago

Disabling Hardware Acceleration fixes the VRAM leak

kaarelen commented 10 months ago

2024, bug is still here

Your system information Steam client version (build number or date): Steam Version: 1702079146 Distribution (e.g. Ubuntu): Arch Opted into Steam client beta?: [Yes/No] No Have you checked for system updates?: [Yes/No] Yes, everything is up-to-date

Please describe your issue in as much detail as possible: Same issue as described before. Huge VRAM leaks after any interactions with Steam client windows. (it easily can consume all 8gb on my rtx1070). Turning off GPU acceleration fixes it, but without it, steam is slow and laggy & "Big Picture" mode is unusable at all.

@kisak-valve issue making steam totally unusable, is there any chance to finish abandonment of this task?

Zi7ar21 commented 8 months ago

I haven't forgotten about this issue, as of 2024-03-03 it appears to be fixed, and I can now enable GPU acceleration once again and resize the Steam window like mad without the VRAM sky-rocketing :)

DekosAnjo commented 8 months ago

Nope, it still happens for me. What exactly did you change from back then to now?

kodatarule commented 3 months ago

Hello, are there any updates on this? I can still notice that it still leaks VRAM.