Bug 468895 - Desktop freezes when Night Color feature kicks in running Wayland with NVIDIA proprietary drivers.
Summary: Desktop freezes when Night Color feature kicks in running Wayland with NVIDIA...
Status: RESOLVED FIXED
Alias: None
Product: kwin
Classification: Plasma
Component: wayland-generic (show other bugs)
Version: 5.27.4
Platform: Arch Linux Linux
: NOR normal
Target Milestone: ---
Assignee: KWin default assignee
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2023-04-24 09:35 UTC by Damian C
Modified: 2023-05-24 14:26 UTC (History)
3 users (show)

See Also:
Latest Commit:
Version Fixed In: 6.0


Attachments
drm_info1 (70.88 KB, application/octet-stream)
2023-04-28 21:14 UTC, Damian C
Details
journalctl (19.97 KB, text/x-log)
2023-05-03 21:41 UTC, Damian C
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Damian C 2023-04-24 09:35:01 UTC
SUMMARY
***
With the Night Color feature enabled, running Wayland with NVIDIA proprietary drivers, one or more monitors freezes momentarily. If left unattended the whole kwin session freezes on all monitors.

On the logs, the message : "kwin_wayland_drm: Failed to create gamma blob! Invalid argument" can be seen at each time the desktop freezes.

After a few seconds it will unfreeze and let you continue for maybe a minute more before going at it again, I'm guessing it is the Night Color feature attempting to start again.



***


STEPS TO REPRODUCE
1. Be running a Kwin Wayland session using Nvidia proprietary drivers.
2. Have the Night Color feature enabled.
3. At the time the Night Color feature is supposed to kick in, the issue is observed.

OBSERVED RESULT
One or more monitors freezes momentarily. If left unattended the whole kwin session freezes on all monitors.

EXPECTED RESULT
Night Color works as expected.

SOFTWARE/OS VERSIONS
Operating System: Arch Linux 
KDE Plasma Version: 5.27.4
KDE Frameworks Version: 5.105.0
Qt Version: 5.15.9
Kernel Version: 6.2.12-zen1-1-zen (64-bit)
Graphics Platform: Wayland
Processors: 12 × Intel® Core™ i7-8700K CPU @ 3.70GHz
Memory: 15.6 GiB of RAM
Graphics Processor: NVIDIA GeForce GTX 1070/PCIe/SSE2

Nvidia Drivers: 530.41.03-1


ADDITIONAL INFORMATION

3 monitors: One Display Port, one HDMI and one DVI.

It seems to favor freezing the DVI monitor first, but the rest will follow soon.

To avoid this issue and continue to have a working system through the night hours, the workaround has been to disable Night Color completely.

Seems related to #450327.
Comment 1 Zamundaaa 2023-04-24 21:08:24 UTC
Please attach the output of drm_info (https://gitlab.freedesktop.org/emersion/drm_info) when the screen is frozen
Comment 2 Damian C 2023-04-28 21:14:58 UTC
Created attachment 158525 [details]
drm_info1
Comment 3 Zamundaaa 2023-04-30 10:32:00 UTC
There's still no GAMMA_LUT property, so I'm not sure how night color would be related. Can you attach your full KWin log? So
> journalctl --user-unit plasma-kwin_wayland --boot 0
after causing the issue again
Comment 4 Damian C 2023-05-03 21:41:40 UTC
Created attachment 158675 [details]
journalctl
Comment 5 Damian C 2023-05-03 21:55:35 UTC
(In reply to Zamundaaa from comment #3)
> There's still no GAMMA_LUT property, so I'm not sure how night color would
> be related. Can you attach your full KWin log? So
> > journalctl --user-unit plasma-kwin_wayland --boot 0
> after causing the issue again

Attached!
I don't expect Night Color to work since the property is not there, but it seems to cause the issue when it attempts to kick in.
And the only way to stop it from happening so far is to disable Night Color.
Comment 6 Bug Janitor Service 2023-05-23 18:37:48 UTC
A possibly relevant merge request was started @ https://invent.kde.org/plasma/kwin/-/merge_requests/4130
Comment 7 Zamundaaa 2023-05-24 14:18:57 UTC
Git commit cdafbbbd6f80d6ca0639660ed4ec121754553f54 by Xaver Hugl.
Committed on 24/05/2023 at 13:48.
Pushed by zamundaaa into branch 'master'.

backends/drm: always do color management on NVidia GPUs

This comes with a small performance hit but ensures that night color works
Related: bug 450327

M  +1    -1    src/backends/drm/drm_egl_cursor_layer.cpp
M  +1    -1    src/backends/drm/drm_egl_layer.cpp
M  +3    -3    src/backends/drm/drm_egl_layer_surface.cpp
M  +1    -1    src/backends/drm/drm_egl_layer_surface.h
M  +7    -2    src/backends/drm/drm_output.cpp
M  +1    -0    src/backends/drm/drm_output.h

https://invent.kde.org/plasma/kwin/-/commit/cdafbbbd6f80d6ca0639660ed4ec121754553f54