Bug 503114

Summary: Window manager keeps forgetting my display configuration
Product: [Plasma] KScreen Reporter: drwootton
Component: commonAssignee: kscreen-bugs-null <kscreen-bugs-null>
Status: RESOLVED DOWNSTREAM    
Severity: normal CC: kdedev, nate, xaver.hugl
Priority: NOR Keywords: multiscreen
Version First Reported In: 6.3.4   
Target Milestone: ---   
Platform: Fedora RPMs   
OS: Linux   
Latest Commit: Version Fixed/Implemented In:
Sentry Crash Report:
Attachments: Requested screen-doctor -o output

Description drwootton 2025-04-21 14:19:59 UTC
SUMMARY
The kwin_x11 window manager (or plasmashell, not sure which) keeps forgetting my display configuration. This has been going on with Ubuntu 24.02 then Ubuntu 24.10 win NVidia driver 565.56.1
Someone on discuss.kde.org suggest I install current Fedora since there was a newer version of KDE which might work better.

It did, for about a week. Now I'm running current Fedora 42 with KDE Plasma 6.3.4 X11 and NVidia driver 570.133.07 and the problem is back.

I had been running Fedora for many years until last year when I thought should install Ubuntu since that was the more widely supported distribution and software levels were more stable.

The problem is that I set up a display configuration using X11 plasmashell with 4 displays, which works find for a while then something decides to reconfigure my display config such that one display is disabled. Then I have to spend a couple hours trying to figure out how to get my displays back.

My system has a RTX 4070TI Super  GPU and a RTX 4070 installed. The RTX 4070 TI Super is my main GPU which has all my displays connected to it. The RTX 4070 is used only for AI software.

I have 4 displays connected, 2 Acer B326HK 4K displays, and Acer H213H 1920x1080 display and a USD Artist 13.2 1920x1080 drawing tablet connected. The drawing tablet uses the HDMI port and the remaining displays are connected by Display Port.

So, on random bootup, my 2nd 4K display is gone, does not enavble even if I switch it off and on. It does not show up in nvidia-settings either.

I discovered that if I log in using Gnome window manager and start nvidia-settings there, I see the second 4K display but it is 'off'. I redo my nvidia-settings configuration to get all 4 displays running again and then redo my Gnome dispal setup again.

Then I log out and log in to X11 plasmashell and the second 4K display is still gone. I run nvidia-settings again and see that display is marked disabled. I enable it anbd mess with configuration settings again to get my setup, but something (kwin or plasmashell, don't know which) decides it wants to fight with nvidia-settings because I start getting popups from nvidia-settings that a display configuration can't be saved because the running X server was modified.

Finally, I get the KDE window configuration set up to match what I have in nvidia-settings and things are fine for a while. Then something gets bored and decides to break my config again.

I don't like gnome window manager because it's desktop is far to basic and limited. I've used plasma X11 for years and have been happy with it until the last few months.

It's bad enough that there's two places where display config seems to live, wherever nvidia-settings decides to keep it besides xorg.conf and wherever KDE decides to keep it. It's even worse because KDE keeps it's config somewhere different that Gnome, so I end up having to fix several configs.

I tried Wayland plasma and it's just not ready for prime time. I have other problems with that, and there's at least one person who claims that Wayland will be work in progress with NVidia for another couple years.

STEPS TO REPRODUCE
1. I have no idea how to reproduce it, what log to look at because Linux developers decided to move it somewhere again, and no idea what to even look at in the log with all the noise in the log. The system just decides to randomly decide to scrap my desktop config.

OBSERVED RESULT
Broken display config.

EXPECTED RESULT
Once I set a display config, the system should not decide to randomly change it to something else resulting in me wasting several hours fixing it again.


SOFTWARE/OS VERSIONS 
Linux/KDE Plasma:  6.3.4
KDE Plasma Version: 
KDE Frameworks Version:  6.13.10 
Qt Version: 6.8.2
Nvidia driver 570.133.07

ADDITIONAL INFORMATION
Comment 1 TraceyC 2025-04-21 21:54:45 UTC
To summarize the technical details:

The kwin_x11 window manager keeps forgetting the display configuration
nvidia proprietary drivers 570.133.07
Problem has occured on Ubuntu 24.02, 24.10 and Fedora 42
KDE Plasma and GNOME installed on the same system

RTX 4070TI Super GPU (main display running all displays) and a RTX 4070 installed (only used for AI software)

4 displays connected
 2 Acer B326HK 4K displays
 Acer H213H 1920x1080 display
 USD Artist 13.2 1920x1080 drawing tablet
 The tablet uses an HDMI port and the remaining displays are connected by Display Port.

On random bootup, the 2nd 4K display is gone, does not enable even if  switched off and on. It does not show up in nvidia-settings either.

It won't work again until experimenting with the display config through nvidia-settings and system settings at the same time.
Comment 2 TraceyC 2025-04-21 21:58:59 UTC
Thanks for the bug report. So that we can investigate this, can I ask you to run 'kscreen-doctor -o' in a terminal, and paste the output into a reply in this report? Thanks.
Comment 3 drwootton 2025-04-21 22:46:30 UTC
Created attachment 180501 [details]
Requested screen-doctor -o output
Comment 4 drwootton 2025-04-21 22:52:25 UTC
I added the screen-doctor -o output as an attachment.
In addition to your summary, I will add:
Once the display is dropped in plasma desktop, nvidia-settings does not seem to see it at all, at least I cannot find it,  and I can do nothing with the display until I log out and log back using Gnome desktop
After I login with Gnone desktop, I start nvidia-settings and then see the missing display but it is in disabled state.
Then I clean up the display config so I have all 4 displays, log out and log back into plasma desktop.
The display is again missing, but when I run nvidia-settings I can find the display, get it back to working state and reconfigure my display layout in plasma desktop settings.
Then it works until the next time the display disappears.
Comment 5 Zamundaaa 2025-04-22 14:36:41 UTC
KWin doesn't deal with display settings on X11. If it doesn't appear in the NVidia settings either though, then I don't think this issue is something KScreen is responsible for either - it rather sounds like a driver issue
Comment 6 Nate Graham 2025-04-22 15:32:24 UTC
nvidia-settings will conflict with what we set; it's not recommended to use it for configuring your screens. If you do, then you should disable KScreen in `kcmshell6 kcm_kded`. Any problems that persist are then NVIDIA's fault.

Or alternatively, allow KScreen to manage screens, and discontinue use of nvidia-settings.
Comment 7 drwootton 2025-04-23 13:56:42 UTC
(In reply to Zamundaaa from comment #5)
> KWin doesn't deal with display settings on X11. If it doesn't appear in the
> NVidia settings either though, then I don't think this issue is something
> KScreen is responsible for either - it rather sounds like a driver issue

It definitely makes a difference whether I run nvidia-settings from a Gnome desktop or a plasmashall desktop. Once the display disappears, it is not visible in nvdia-settings under plasmashell and the only way I can get the display back is to switch to Gnome desktop, clean it up, then go back to plasmashell and reset my configuration.

kwin or plasmashell also seems to be keeping its display configuration somewhere separate from what either nvidia-settings or Gnomne desktop see.
I don't understand why there needs to be more than one place where configuration settings are kept.

Pick something that is the one source of the configuration and use that. Then don't decide to randomly write over it because it's Monday or something.

I learned long ago as a software developer that keeping  two different sets of data for the same thing (display layout for example) is a bad idea.
Comment 8 Nate Graham 2025-04-23 13:59:28 UTC
You're right that it's a bad idea, which is why we recommend only using one source of settings truth: either KScreen (our thing) or nvidia-settings (NVIDIA's thing). There is no option for both of them to use the same source of truth, so you should just choose one.
Comment 9 drwootton 2025-04-24 02:07:14 UTC
I have no idea where nvidia-settings was keeping display configuration or if it even was keeping it. It wasn't in any of /etc/X11/xorg.conf, /etc/X11/xorg.conf.d or ~/.nvidia-settings-rc. In fact I did not have an xorg.conf file.  

I did have one when I was running Fedora 39 and manually installing nvidia-drivers. But after clean installs of Ubuntu then back to Fedora, the driver install process for dealing with signed drivers apparently doesn't generate xorg.conf any more.

I do know that running nvidia-settings seemed to be the only way to get my display back.

So now I'm not sure what was going on to cause my display to disappear.

I figured out that kcmshell6 kcm_kded was a command I needed to run, so I ran it and disabled KScreen2. Then I ran nvidia-settings, configured the displays and saved to xorg.conf and rebooted my system.

Once I did that I still have the display config I wanted and Kscreen 2 is still disabled. I guess I'll go with using nvidia-settings and see what happens next.

I don't know what kscreen does or what goes wrong if I don't run it, but hopefully nothing goes wrong.
Comment 10 Nate Graham 2025-04-24 07:07:16 UTC
Now that you've disabled KScreen, you have one source of truth which is why things work better.

Just don't forget to re-enable it should you ever switch GPUs or discontinue the use of nvidia-settings!