Bug 508308 - Direct Scanout not working on DGPU (Radeon + Nvidia)
Summary: Direct Scanout not working on DGPU (Radeon + Nvidia)
Status: RESOLVED UPSTREAM
Alias: None
Product: kwin
Classification: Plasma
Component: compositing (other bugs)
Version First Reported In: 6.4.4
Platform: Other Linux
: NOR normal
Target Milestone: ---
Assignee: KWin default assignee
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2025-08-15 19:58 UTC by Syntist
Modified: 2025-09-25 19:56 UTC (History)
4 users (show)

See Also:
Latest Commit:
Version Fixed In:
Sentry Crash Report:
syed.talha.khalid: Mesa+
syed.talha.khalid: NVIDIA+


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Syntist 2025-08-15 19:58:25 UTC
SUMMARY
Direct scanout not working when i render using DGPU (nvidia) but works if i play the game with igpu.
Using Show Compositing Effect, and it doesn't go when i run the game using DGPU

I am not sure if it's nvidia bug or kde.

STEPS TO REPRODUCE
1. Run game in fullscreen using dgpu
2. Enable show compositing in Display Effects
3. Compositing still shows

While using IGPU (AMD) it doesn't show

OBSERVED RESULT
Showing compositing

EXPECTED RESULT
Should not show compositing, mean direct scanout working

SOFTWARE/OS VERSIONS

(available in the Info Center app, or by running `kinfo` in a terminal window)
pci id for fd 16: 10de:25a2, driver (null)
kmsro: driver missing
Operating System: CachyOS Linux 
KDE Plasma Version: 6.4.4
KDE Frameworks Version: 6.17.0
Qt Version: 6.9.1
Kernel Version: 6.16.0-7-cachyos (64-bit)
Graphics Platform: Wayland
Processors: 12 × AMD Ryzen 5 6600H with Radeon Graphics
Memory: 64 GiB of RAM (62.0 GiB usable)
Graphics Processor 1: AMD Radeon 660M
Graphics Processor 2: NVIDIA GeForce RTX 3050 Laptop GPU

ADDITIONAL INFORMATION

https://imgur.com/a/jtwQtBJ
Comment 1 Enes 2025-08-21 15:08:48 UTC
Not working for me either.

https://youtu.be/MXVbSsszIa4
https://imgur.com/a/Y6xAfkA

Operating System: Arch Linux 
KDE Plasma Version: 6.4.4
KDE Frameworks Version: 6.17.0
Qt Version: 6.9.1
Kernel Version: 6.16.1-arch1-1 (64-bit)
Graphics Platform: Wayland
Processors: 32 × AMD Ryzen 9 5950X 16-Core Processor
Memory: 48 GiB of RAM (47.0 GiB usable)
Graphics Processor: NVIDIA GeForce RTX 5090
Comment 2 Enes 2025-08-21 18:25:05 UTC
I noticed if the game doesn't use a cursor, Compositing text dissapear.
If the game has a "hardware cursor" setting and it is disabled Compositing text dissapear.
World of Warcraft and Witcher 3 has that option.

But... even when the Compositing text goes away, there is still input lag and there is no screen tear.
Vsync is off and fps is capped at 60 by DXVK_FRAME_RATE env variable, there should be screen tear.
Or maybe direct scanout and allow tear are not related?

I also noticed that if Color profile in display settings is not None, Compositing text never goes away.
Comment 3 Syntist 2025-08-31 07:02:01 UTC
I tried everything, it just doesn't work when I run the game using dgpu (nvidia), not sure why it does that. 

On my other laptop which has IGPU (intel) it works fine, when i run the game on dgpu (nvidia)

Something with AMD + Nvidia. Wish someone could check this issue out.
Comment 4 Syntist 2025-09-05 07:35:54 UTC
I have tried Forcing SW Cursor and same issue, I think it's related to driver, because even on gnome when the game is being run on nvidia (offloading) it doesn't go in direct scanout mode, just like in kde. 

But would be great if there's any update on it.
Comment 5 Enes 2025-09-05 09:21:49 UTC
I noticed, if there is a rule forcing "Allow tearing" direct scanout doesnt work 🤷‍♂️
At 30th second in the video i sent in my first post, i had that rule as well, removing it makes direct scanout work.

But I couldnt see any improvement over input delay in games, vsync is still forced on, tear never worked for me.
Comment 6 Syntist 2025-09-05 10:41:14 UTC
(In reply to Enes from comment #5)
> I noticed, if there is a rule forcing "Allow tearing" direct scanout doesnt
> work 🤷‍♂️
> At 30th second in the video i sent in my first post, i had that rule as
> well, removing it makes direct scanout work.
> 
> But I couldnt see any improvement over input delay in games, vsync is still
> forced on, tear never worked for me.

Your issue is different then mine, you are on a desktop with one GPU (nvidia) while mine is laptop and it has igpu and dgpu, nvidia-offloading is being used, and that's why Direct scanout is not working, but works fine if i run the game on igpu.
Comment 7 Enes 2025-09-05 10:46:15 UTC
(In reply to Syntist from comment #6)
> (In reply to Enes from comment #5)
> > I noticed, if there is a rule forcing "Allow tearing" direct scanout doesnt
> > work 🤷‍♂️
> > At 30th second in the video i sent in my first post, i had that rule as
> > well, removing it makes direct scanout work.
> > 
> > But I couldnt see any improvement over input delay in games, vsync is still
> > forced on, tear never worked for me.
> 
> Your issue is different then mine, you are on a desktop with one GPU
> (nvidia) while mine is laptop and it has igpu and dgpu, nvidia-offloading is
> being used, and that's why Direct scanout is not working, but works fine if
> i run the game on igpu.

I see, sorry for the confusion.
Comment 8 Syntist 2025-09-18 09:53:57 UTC
sad no news on this :( 
I think it's related to AMD Driver maybe.
Comment 9 Zamundaaa 2025-09-25 19:51:28 UTC
Direct scanout is an optional optimization that simply doesn't always work. One GPU being able to (efficiently) do direct scanout from another GPU would be a rare thing, not something you can expect.

More specifically in this case however, the NVidia driver almost certainly already does a copy from the dGPU to the integrated one, and it would need to allocate these buffers on the integrated GPU in a way that they're suitable for scanout. You can report that not working at https://forums.developer.nvidia.com/c/gpu-graphics/linux

(In reply to Enes from comment #2)
> Or maybe direct scanout and allow tear are not related?
They're pretty much completely unrelated.
Comment 10 Syntist 2025-09-25 19:56:09 UTC
(In reply to Zamundaaa from comment #9)
> Direct scanout is an optional optimization that simply doesn't always work.
> One GPU being able to (efficiently) do direct scanout from another GPU would
> be a rare thing, not something you can expect.
> 
> More specifically in this case however, the NVidia driver almost certainly
> already does a copy from the dGPU to the integrated one, and it would need
> to allocate these buffers on the integrated GPU in a way that they're
> suitable for scanout. You can report that not working at
> https://forums.developer.nvidia.com/c/gpu-graphics/linux
> 
> (In reply to Enes from comment #2)
> > Or maybe direct scanout and allow tear are not related?
> They're pretty much completely unrelated.

Okay, although It does work on the laptop with Intel iGPU and Nvidia dGPU, but just doesn't work with Radeon iGPU and Nvidia dGPU combo. 

Intel + Nvidia (works)
Radeon + Nvidia (doesn't work)

I'll make a report on nvidia forum related this.