pop-os / cosmic-comp

Compositor for the COSMIC desktop environment
GNU General Public License v3.0
476 stars 85 forks source link

NVIDIA external output is blank except cursor #497

Closed flukejones closed 4 months ago

flukejones commented 4 months ago

Tested a few driver versions, kernels (550, 555, 6.8+) and the result of an Nvidia external output is only a blank screen which shows the cursor.

If I move the cursor around it looks quite smooth. But if I drag a window over it begins to stutter very badly (and is still blank except for mouse cursor).

jacobgkau commented 4 months ago

Weird, does it look like what VirtualBox is doing in pop-os/cosmic-panel#207?

flukejones commented 4 months ago

No.

jacobgkau commented 4 months ago

Oh, you mean it's black with a cursor on top, sorry.

Assuming you have an internal display that's not connected to the NVIDIA GPU, the stuttering part sounds similar to https://github.com/pop-os/cosmic-comp/issues/281.

ids1024 commented 4 months ago

I'm seeing the same behavior with external outputs on the gaze15, using the 555 driver. Not sure when this started happening.

ids1024 commented 4 months ago

Looking at journalctl -o json-pretty:

"F_ERR" : "Failed to submit result for display\n\nCaused by:\n    0: The underlying drm surface encountered an error: DRM access error: Page flip commit failed on device `Some(\"/dev/dri/card0\")` (Operation not permitted (os error 1))\n    1: DRM access error: Page flip commit failed on device `Some(\"/dev/dri/card0\")` (Operation not permitted (os error 1))\n    2: Operation not permitted (os error 1)",

I would have thought the cursor plane wouldn't show up either if the page flip commit failed...

ids1024 commented 4 months ago

Doesn't seem to be related to the version of cosmic-comp. And Anvil also has this issue, but prints an error and exits instead of continuing.

Seems to no longer happen downgrading to 550.

@flukejones You see this with 550 as well? Is that what nvidia-smi lists?

flukejones commented 4 months ago

I thought I did but I can't be sure now. I'm not in my office to test ATM sorry.

ids1024 commented 4 months ago

I happened to be looking at the IN_FENCE_FD code in kwin, and noticed it is disabled for Nvida cards: https://invent.kde.org/plasma/kwin/-/commit/50899f3f

It seems modifying Smithay to not set IN_FENCE_FD fixes this. So IN_FENCE_FD, at least in the way we're using it here (are we using an Intel fence, currently, with an Intel/Nvidia system?) isn't working properly with the Nvidia 555 driver.

lureedo commented 4 months ago

I happened to be looking at the IN_FENCE_FD code in kwin, and noticed it is disabled for Nvida cards: https://invent.kde.org/plasma/kwin/-/commit/50899f3f

It seems modifying Smithay to not set IN_FENCE_FD fixes this. So IN_FENCE_FD, at least in the way we're using it here (are we using an Intel fence, currently, with an Intel/Nvidia system?) isn't working properly with the Nvidia 555 driver.

Do we need to wait for a fix? Or it is something we can fix on our own? If yes, how?

Thanks in advance.

ids1024 commented 4 months ago

The workaround is to remove the section of code in https://github.com/Smithay/smithay/blob/8f132ecded5705e55fc1ce6cfa4b59850c6b038e/src/backend/drm/surface/atomic.rs#L884-L895. And point cosmic-comp's Smithay dependency to that version.

Or downgrade to the stable Nvidia driver, since this seems to just be a problem with the 555 beta driver. At least in my testing. (If anyone sees the issue on a different driver version, it may be helpful to see what version and card is listed by nvidia-smi.)

For a more correct solution... we could test for Nvidia here, like Kwin does. Though it may be good to narrow down exactly what IN_FENCE_FDs work and which do not with the Nvidia driver.

ahoneybun commented 4 months ago

I'm also seeing this on a desktop with a GTX 1050 Ti with the 555 beta driver. I did notice that if I move between TTY's that I can see the desktop just smaller then I would expect.

flukejones commented 4 months ago

I think this may be an Nvidia issue. Not 100% sure since this is an area I do little with (except for supergfxctl). I've replicated the issue in Gnome across multiple laptops also.

flukejones commented 4 months ago

:heart:

4ndv commented 4 months ago

Did a clean build of cosmic (on Arch), issue is still present for me on 555. Revert to 550 seems to have fixed the problem