@amrits This issue still exists. Can we get a timeline on a fix
still happening. starting to think this bug report has been thrown in the bin.
Hello @amrits can we get an update on this matter?
Seems like this is never going to get fixed. Which is a real shame.
Its been 2 Years now with not so much of an Mention. Seems like the AI Money is to good to pay any attention to the normal customers. Next GPU is going to be AMD again for sure.
Would love to get an update on this issue. Currently using bazzite-deck-nvidia 43 (stable) and do not experience this issue for the most part except sometimes when waking the machine. Can render at 4K 120Hz HDR fine - this with 50 series GPUs and 9800x3D + 595 drivers.
After updating to bazzite-deck-nvidia 44 where 610 drivers are present - this is issue is now present and severe making the machine unusable. I’ve reverted back to Bazzite 43 with 595 drivers which has resolved the problem for now. There seems to be a real regression somewhere.
hi @amrits
I did some further debugging on my side today, and I think I found where the issue is coming from.
In gamescope, scanout buffers are allocated through Vulkan and exported as dmabufs, rather than through GBM like most Wayland compositors. The Vulkan driver backs these dmabuf-exported buffers with physically scattered vidmem pages, and nvidia-drm/NVKMS registers them for scan-out without validating contiguity (ValidateSurfaceAllocation in nvkms-surface.c checks only size and address space).
The display engine requires contiguous memory, so once a scan-out surface lands on scattered pages, it walks past the first contiguous run and starts scanning out unrelated allocations. That is the corruption in the videos above. It is also why other compositors are unaffected: NVKMS forces SCANOUT-type allocations (the GBM/dumb buffer path) to be physically contiguous (nvkms-kapi.c, _PHYSICALITY_CONTIGUOUS + _ISO_YES), while imported memory keeps whatever physicality the Vulkan UMD chose.
On my 5090, I debugged this by:
-
I instrumented
nvEvoRegisterSurfaceto queryGET_SURFACE_PHYS_ATTRand logcontigSegmentSizefor every ISO surface registration. In every corrupt session, gamescope’s 32 MiB output buffers register with contigSegmentSize=4096 (scattered). Every clean surface, including all GBM-allocated desktop buffers, is contiguous. HDR toggles produce new scattered registrations in real time. Notably, the buffers come back scattered even on a freshly loaded module with a near-empty heap, so on Blackwell the UMD appears to request noncontiguous memory outright rather than falling back to it. -
I tried
RMDisableNoncontigAlloc=1. It loaded but had no effect, because the regkey is only honored by the legacy heapAlloc path._vidmemPmaAllocatenever consultsbAllowNoncontiguousAllocation, so the key is currently inert on every PMA-managed framebuffer heap. That seems like its own bug, and I submitted Honor RMDisableNoncontigAlloc in the PMA vidmem path by matte-schwartz · Pull Request #1305 · NVIDIA/open-gpu-kernel-modules · GitHub to fix it. -
With that patch plus
RMDisableNoncontigAlloc=1set, every surface registers contiguous and the corruption is completely gone. This was my first fully clean gamescope session ever on this machine, through repeated HDR toggles and resolution changes.
Forcing all vidmem contiguous is only a mitigation, since large allocations can fail outright under fragmentation instead of scattering, but at the very least this lets me toggle between 4K resolutions and HDR state without any corruption. Using GBM is not something gamescope is going to support, so this remains the only viable workaround I’ve been able to find for now.
Thank you for this. It’s been one of the only things that has made me consider going back to windows lately. Hopefully it is implemented in the next driver release.
Great find - really hoping this info will help lead to a fix here. Interesting that my Bazzite Deck 33 installation with 5090 + 595 drivers did not have this corruption which has unfortunately returned with Bazzite Deck 44 + 610 drivers.
Ah nice one.
Then I was pretty close yesterday myself. Only never dared to venture into the Driver.
Took a diffrent route and simply started building a GBM Route into Gamescope instead.
I have an experiment here that forces Scanout to be done over GBM if gamescope_drm_gbm_scanout=1 is set. Seems completly fine on my end now in everything that was Clownvomit before. It is modeled after how KWin dows everything.
Best used with forced composition on for Games that directly scan out. It currently does not force it.
@amrits Can we get any update? It’s been a year and a half. @matt-schwartz seems to have most of a solution for you.
no need for further pings about my post, they’re aware of it.
After testing continuesly the whole weekend, I find the Driver Patch route rather unstable. Many Games Crashing outright. Most notably X4 Foundations refused to start completly on both a 5080 and a 5070.
Half-Life 2 crashes in consistently in the Red Letter Day Mission across two Hardware configurations.
None of those crash on the GBM Route.
I would hardly call this a Bandaid. And Gamescope should really consider using GBM instead of forcing the Playerbase to wait another 3 Years until Nvidia gets its ass of AI to give a Damn about Consumers again.
Its 262 Lines of clean applicable code that would fix this while Nvidia drags their feet to a fix.
Really dont understand why we rather push people towards a crash prone situation. Ship it gated behind a config and remove it again once the full Driver fix is here that cleanly accepts Vulkan Scanout.
I really don’t understand what you mean by pushing people towards a crash-prone solution. I literally mentioned in my comment that what I shared was not a solution, and it should not be taken as such. I shared it so the information would be public as to what the issue is.
People are free to open PRs to gamescope.
Acknowledged, I have relayed the information to engineering team.
Confirming that NightHammer’s experimental GBM scanout route fixes the high-resolution Gamescope corruption on my system.
Hardware / software
- GPU: NVIDIA RTX 4080 16 GB
- Driver: NVIDIA 610.57.04
- SteamOS Main
- Gamescope base: 3.16.26
- Display: Samsung 5120×1440 240 Hz ultrawide
Stock Gamescope behaviour
2560×1440 works cleanly, but higher-width modes such as 3840×1080 and 5120×1440 produce severe flickering/corruption.
I also forced 5120×1440 at only 60 Hz and the corruption was still present, so in my case it was not simply a 240 Hz / bandwidth / VRR issue.
GBM test
I built:
NightHammer1000/gamescope
branch:
poc/gamescope-gbm-route
and enabled:
gamescope_drm_gbm_scanout=1
I also tested with forced composition enabled.
Result
5120×1440 @ 60 Hz: completely clean
5120×1440 @ 240 Hz: completely clean
This is on the exact same hardware/driver/session that corrupts with the normal Gamescope scanout path.
The journal also confirms the experimental GBM path is being exercised. I do see repeated messages such as:
CreateScanoutBuffer: GBM allocation failed for 24x24 format 0x34325241
and similar 32x32 allocations, but these do not appear to affect the main display scanout. The 5120×1440 output itself remains completely stable.
So this looks like another strong confirmation that routing the display scanout buffers through GBM avoids the NVIDIA corruption seen with the existing Vulkan-allocated scanout path.
Happy to provide additional logs or test patches if useful.