Bug 471809

Summary: [Wayland] [NVIDIA] Compositing fails under vram exhaustion, nv_gbm_bo_create fails, Failed to allocate NVKMS memory for GEM object
Product: [Plasma] kwin Reporter: spryor
Component: wayland-genericAssignee: KWin default assignee <kwin-bugs-null>
Status: RESOLVED UPSTREAM    
Severity: normal CC: kde, nate, xaver.hugl
Priority: NOR    
Version First Reported In: 5.27.6   
Target Milestone: ---   
Platform: Other   
OS: Linux   
Latest Commit: Version Fixed/Implemented In:
Sentry Crash Report:

Description spryor 2023-07-01 02:53:15 UTC
SUMMARY

Under vram exhaustion scenarios, windows, menus, etc, will all fail to render. Windows show only titlebar and become completely transparent. The following errors in the log:

Jun 30 21:37:51 graviton.localdomain kwin_wayland_wrapper[50295]: src/nv_gbm.c:99: GBM-DRV error (nv_gbm_bo_create): DRM_IOCTL_NVIDIA_GEM_ALLOC_NVKMS_MEMORY failed (ret=-1)
Jun 30 21:37:51 graviton.localdomain kernel: [drm:nv_drm_gem_alloc_nvkms_memory_ioctl [nvidia_drm]] *ERROR* [nvidia-drm] [GPU ID 0x00000100] Failed to allocate NVKMS memory for GEM object
Jun 30 21:37:51 graviton.localdomain kwin_wayland_wrapper[50295]: Error getting buffer



STEPS TO REPRODUCE
1. Run KDE Wayland with Nvidia driver
2. Open applications/games/etc to exhaust vram
3. Attempt to manipulate other windows, minimize/maximize, attempt to open the start menu, etc, they won't render on the screen

OBSERVED RESULT
Windows render only titlebar, no content. Start menu on the desktop gains the blue tick like it's opened, but not visible


EXPECTED RESULT
Windows/menus/etc work and are visible


SOFTWARE/OS VERSIONS
Linux/KDE Plasma: Fedora 38 KDE Plasma Wayland
KDE Plasma Version: plasma-workspace-wayland-5.27.6-1.fc38.x86_64
KDE Frameworks Version: kde-runtime-17.08.3-26.fc38.x86_64
Qt Version: qt5-qtwayland-5.15.10-1.fc38.x86_64

ADDITIONAL INFORMATION
Even after vram is freed up, the windows need to be minimized/maximized again for them to be visible. Not sure if other stuff is broken elsewhere in the stack by this behavior. The windows still accept input, despite the broken compositing.
Comment 1 Zamundaaa 2023-07-02 21:57:41 UTC
> Windows/menus/etc work and are visible

I don't think that's possible. If an application can't allocate buffers, there's nothing for KWin to show. I'm a bit confused how you get invisible windows though - without new buffers, applications can't resize windows.
Comment 2 spryor 2023-07-02 21:59:47 UTC
Yeah, it's really weird, I get the titlebar and border, but everything else is invisible for chrome, might be due to it being a GTK application. The start menu just doesn't render anything though
Comment 3 David Edmundson 2023-07-07 09:47:24 UTC
This is now quite old and very driver centric. Please reopen if an issue remains.
Comment 4 spryor 2023-07-07 11:08:44 UTC
Wait, what? What version did you attempt with?
Comment 5 spryor 2023-07-07 13:43:57 UTC
Please elaborate on the configuration you used, I'm using the current versions in the Fedora repos, but I would like to retest with your environment
Comment 6 Zamundaaa 2023-09-19 12:28:59 UTC
There's nothing we can do about this. Please report the problem to NVidia
Comment 7 spryor 2023-09-19 18:17:58 UTC
Gotcha, ty!