hyprwm / xdg-desktop-portal-hyprland

xdg-desktop-portal backend for Hyprland
BSD 3-Clause "New" or "Revised" License
307 stars 49 forks source link

VRAM leak ? #129

Closed rainD4X closed 1 year ago

rainD4X commented 1 year ago

OS: Arch Kernel: 6.6.1-zen1-1-zen mesa version: 1:23.2.1 Hyprland version: 0.30.0 xdg-desktop-portal-hyprland version: 1.2.4 GPU: AMD Radeon RX 5500 XT (navi14)

After screen-sharing for about an hour on armcord, I noticed that xdph was using more than 2.5GB of VRAM. Happened multiple times already. I do not know if this is relevant but I was screen-sharing windows, not entire screen.

Current workaround is to restart xdph after sharing.

Screenshot_from_2023-11-12_21_11_45

ashbir commented 1 year ago

OS: Nobara 38 Kernel: 6.5.9-201.fsync.fc38.x86_64 Mesa: 23.2.1 Hyprland: 0.32.3 xdg-desktop-portal-hyprland: 1.2.4 GPU: AMD Radeon Vega 8 Graphics I have similar issue with vram memory leak. I use zoom web app on firefox to share my screen, after I stop the screen sharing, the xdph vram is not decreased. If I shared again, the vram keep increasing. I need to kill xdph to reduce the vram

image

`[LOG] [screencopy] | /org/freedesktop/portal/desktop/request/1_89/webrtc_1406270146 [LOG] [screencopy] | /org/freedesktop/portal/desktop/session/1_89/webrtc_session440420559 [LOG] [screencopy] | appid: [LOG] [screencopy] SelectSources: [LOG] [screencopy] | /org/freedesktop/portal/desktop/request/1_89/webrtc740643776 [LOG] [screencopy] | /org/freedesktop/portal/desktop/session/1_89/webrtc_session440420559 [LOG] [screencopy] | appid: [LOG] [screencopy] option persist_mode to 1 [LOG] [screencopy] unused option multiple [LOG] [screencopy] unused option types [LOG] [screencopy] restore data invalid / missing, prompting [LOG] execAndGet: WAYLAND_DISPLAY=wayland-1 QT_QPA_PLATFORM="wayland" XCURSOR_SIZE=24 HYPRLAND_INSTANCE_SIGNATURE=9afdd61adeaf413afbe853dbc5fdf6853c8bde21_1699934465 XDPH_WINDOW_SHARING_LIST="1923575840[HC>]Alacritty[HT>]fadila@rta-t495:~[HE>]1923576192[HC>]Alacritty[HT>]fadila@rta-t495:~[HE>]1923580016[HC>]firefox[HT>]Ashbir Aviat Fadila's Zoom Meeting — Mozilla Firefox[HE>]" hyprland-share-picker 2>&1 [LOG] [sc] Selection: /screen:HDMI-A-1

[LOG] [screencopy] SHAREDATA returned selection 0 [LOG] [screencopy] Start: [LOG] [screencopy] | /org/freedesktop/portal/desktop/request/1_89/webrtc188442598 [LOG] [screencopy] | /org/freedesktop/portal/desktop/session/1_89/webrtc_session440420559 [LOG] [screencopy] | appid: [LOG] [screencopy] | parent_window: [LOG] [pw] Building modifiers for dma [LOG] [screencopy] Sharing initialized [LOG] [pw] Building modifiers for dma [LOG] [pw] Building modifiers for dma [LOG] [pw] Building modifiers for dma [LOG] [pw] Building modifiers for dma [ERR] [pipewire] no buffer in enqueue [LOG] [screencopy] New session: [LOG] [screencopy] | /org/freedesktop/portal/desktop/request/1_89/webrtc_861353360 [LOG] [screencopy] | /org/freedesktop/portal/desktop/session/1_89/webrtc_session1491184973 [LOG] [screencopy] | appid: [LOG] [screencopy] SelectSources: [LOG] [screencopy] | /org/freedesktop/portal/desktop/request/1_89/webrtc1897266116 [LOG] [screencopy] | /org/freedesktop/portal/desktop/session/1_89/webrtc_session1491184973 [LOG] [screencopy] | appid: [LOG] [screencopy] option persist_mode to 1 [LOG] [screencopy] unused option multiple [LOG] [screencopy] unused option types [LOG] [screencopy] restore data invalid / missing, prompting [LOG] execAndGet: WAYLAND_DISPLAY=wayland-1 QT_QPA_PLATFORM="wayland" XCURSOR_SIZE=24 HYPRLAND_INSTANCE_SIGNATURE=9afdd61adeaf413afbe853dbc5fdf6853c8bde21_1699934465 XDPH_WINDOW_SHARING_LIST="1923575840[HC>]Alacritty[HT>]fadila@rta-t495:~[HE>]1923576192[HC>]Alacritty[HT>]nvtop[HE>]1923580016[HC>]firefox[HT>]Ashbir Aviat Fadila's Zoom Meeting — Mozilla Firefox[HE>]" hyprland-share-picker 2>&1 [LOG] [sc] Selection: /screen:eDP-1

[LOG] [screencopy] SHAREDATA returned selection 0 [LOG] [screencopy] Start: [LOG] [screencopy] | /org/freedesktop/portal/desktop/request/1_89/webrtc2124915951 [LOG] [screencopy] | /org/freedesktop/portal/desktop/session/1_89/webrtc_session1491184973 [LOG] [screencopy] | appid: [LOG] [screencopy] | parent_window: [LOG] [pw] Building modifiers for dma [LOG] [screencopy] Sharing initialized [LOG] [pw] Building modifiers for dma [LOG] [pw] Building modifiers for dma [LOG] [pw] Building modifiers for dma [LOG] [pw] Building modifiers for dma [ERR] [pipewire] no buffer in enqueue [LOG] [screencopy] New session: [LOG] [screencopy] | /org/freedesktop/portal/desktop/request/1_89/webrtc_168127308 [LOG] [screencopy] | /org/freedesktop/portal/desktop/session/1_89/webrtc_session401694660 [LOG] [screencopy] | appid: [LOG] [screencopy] SelectSources: [LOG] [screencopy] | /org/freedesktop/portal/desktop/request/1_89/webrtc1197054280 [LOG] [screencopy] | /org/freedesktop/portal/desktop/session/1_89/webrtc_session401694660 [LOG] [screencopy] | appid: [LOG] [screencopy] option persist_mode to 1 [LOG] [screencopy] unused option multiple [LOG] [screencopy] unused option types [LOG] [screencopy] restore data invalid / missing, prompting [LOG] execAndGet: WAYLAND_DISPLAY=wayland-1 QT_QPA_PLATFORM="wayland" XCURSOR_SIZE=24 HYPRLAND_INSTANCE_SIGNATURE=9afdd61adeaf413afbe853dbc5fdf6853c8bde21_1699934465 XDPH_WINDOW_SHARING_LIST="1923575840[HC>]Alacritty[HT>]fadila@rta-t495:~[HE>]1923576192[HC>]Alacritty[HT>]nvtop[HE>]1923580016[HC>]firefox[HT>]Ashbir Aviat Fadila's Zoom Meeting — Mozilla Firefox[HE>]" hyprland-share-picker 2>&1 [LOG] [sc] Selection: /screen:eDP-1

[LOG] [screencopy] SHAREDATA returned selection 0 [LOG] [screencopy] Start: [LOG] [screencopy] | /org/freedesktop/portal/desktop/request/1_89/webrtc550583936 [LOG] [screencopy] | /org/freedesktop/portal/desktop/session/1_89/webrtc_session401694660 [LOG] [screencopy] | appid: [LOG] [screencopy] | parent_window: [LOG] [pw] Building modifiers for dma [LOG] [screencopy] Sharing initialized [LOG] [pw] Building modifiers for dma [LOG] [pw] Building modifiers for dma [LOG] [pw] Building modifiers for dma [LOG] [pw] Building modifiers for dma [ERR] [pipewire] no buffer in enqueue`

shvedes commented 1 year ago

OS: Arch Linux Kernel: 6.6.1-arch1-1 Mesa: 23.2.1 Hyprland: 0.32.3 xdg-desktop-portal-hyprland: 1.2.4-1 GPU: RX 6700XT

Same problem here I noticed this when playing with MangoHud enabled. I played DeathStranding, so I didn’t believe that with this game my system could consume more than 10 GB of video memory, after I opened nvtop I realized that the problem was xdph.

UPD: Before I noticed the problem, I enabled screen sharing for long periods of time many times

image

vaxerski commented 1 year ago

has this improved with 8d3538e113341f586682e5a996ba5f015a22ecdd ?

ashbir commented 1 year ago

@vaxerski, I have tried https://github.com/hyprwm/xdg-desktop-portal-hyprland/commit/8d3538e113341f586682e5a996ba5f015a22ecdd and the screenshare doesn't leak vram anymore

rainD4X commented 1 year ago

Thanks @vaxerski, on https://github.com/hyprwm/xdg-desktop-portal-hyprland/commit/8d3538e113341f586682e5a996ba5f015a22ecdd The vram is now freed when the screenshare is over.

Still another bug, less annoying tho, is that xdph use an insane amount a vram when sharing a window and resizing it, should I open another issue for this one?

vaxerski commented 1 year ago

na, thats connected to this one most likely, I'll see later today.

vaxerski commented 1 year ago

fixed in 716da5e0f3756df9ad0edf948e10d80aecf9019b