Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

VRAM Memory Leak on window close #357

Closed
HenrikBGF opened this issue Jul 12, 2022 · 10 comments
Closed

VRAM Memory Leak on window close #357

HenrikBGF opened this issue Jul 12, 2022 · 10 comments
Labels
bug Something isn't working Major This bug has a major impact on the stability or functionality

Comments

@HenrikBGF
Copy link

  • Steps to reproduce
    • Launch terminal with watch -n 1 -d nvidia-smi
    • Launch 2 new kitty instances (or any other terminal) and then close them
  • Expected outcome
    • The VRAM usage should decrease after closing the instances
  • Noted outcome
    • The VRAM usage instead increases, this happens until your GPU runs out of VRAM, freezes and you have to kill Hyprland for it to release the memory.

While I know NVIDIA support isn't directly there, it's more a question for how to properly fix this as I don't use Discord. A reset was also performed, without making any difference.
Tried nvidia-open, nvidia and nvidia-lts drivers (both DKMS and non), all ending in the same memory leak.

Env:

export CLUTTER_BACKEND=wayland
export XDG_SESSION_TYPE=wayland
export QT_QPA_PLATFORM=wayland
export QT_WAYLAND_DISABLE_WINDOWDECORATION=1
export MOZ_ENABLE_WAYLAND=1
export GBM_BACKEND=nvidia-drm
export __GLX_VENDOR_LIBRARY_NAME=nvidia
export WLR_NO_HARDWARE_CURSORS=1

nvidia-smi:
Before opening 2 instances:
0 N/A N/A 918 G Hyprland 294MiB
After opening and closing 2 instances:
0 N/A N/A 918 G Hyprland 314MiB

I've also tried to disable things like blur, which also didn't reduce the leaks. This is using the standard-generated config with changed keybindings and exec-once=dbus-update-activation-environment --systemd WAYLAND_DISPLAY XDG_CURRENT_DESKTOP added at the bottom.

@HenrikBGF HenrikBGF added the bug Something isn't working label Jul 12, 2022
@vaxerski
Copy link
Member

are you sure it's related to hyprland? does sway also leak or no?

@ThatOneCalculator ThatOneCalculator added the nvidia nvidia being nvidia label Jul 12, 2022
@JoshuaFern
Copy link

Reading this issue prompted me to check my own VRAM usage on Nvidia 515.57, for some reason Hyprland is using 1508MiB of VRAM and I'm watching it slowly crawl up higher and higher. Now at 1596MiB before even finishing this post.

Indeed, when starting new instances of foot terminal the memory usage increases, and closing those instances actually increases memory usage as well.

@vaxerski
Copy link
Member

doesn't answer my question

@HenrikBGF
Copy link
Author

are you sure it's related to hyprland? does sway also leak or no?

Tested and it doesn't seem like it, also tested on Weston and no issues there either

@vaxerski
Copy link
Member

Not only NVIDIA, can see it on my rig too.

@vaxerski vaxerski added Major This bug has a major impact on the stability or functionality and removed nvidia nvidia being nvidia labels Jul 12, 2022
@vaxerski vaxerski changed the title NVIDIA: VRAM Memory Leak VRAM Memory Leak on window close Jul 12, 2022
@vaxerski
Copy link
Member

should be fixed with bf762f5 but please verify.

@HenrikBGF
Copy link
Author

Seems to be fixed, opening and closing windows flushes the memory to the value seen here
0 N/A N/A 32831 G Hyprland 53MiB

I'll give it ~3h before I close the issue, just to make sure.

@HenrikBGF
Copy link
Author

Fixed, no more than 200mb of VRAM was ever allocated, and it was instantly freed after closing respective processes.

Thanks for the quick fix!

@MahouShoujoMivutilde
Copy link
Contributor

I don't think it's fully fixed, VRAM / RAM usage still increases on config reload (file save), and never decreases.

Here I just commented -> saved -> uncommented -> saved one option (binding) a bunch of times:
screenshot

System:

  • Arch Linux latest
  • linux-zen 5.19.13
  • nvidia-dkms 515.76-1 (Instructions from the wiki applied except fixes for flickering)
  • Hyprland 0.15.1beta, generated config + few bindings, nothing fancy

@vaxerski
Copy link
Member

vaxerski commented Oct 7, 2022

open a new issue plox

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working Major This bug has a major impact on the stability or functionality
Projects
None yet
Development

No branches or pull requests

5 participants