Bug 462551 - After update to 5.26.4 second screen rating on WAYLAND is like 60hz :(
Summary: After update to 5.26.4 second screen rating on WAYLAND is like 60hz :(
Status: RESOLVED WORKSFORME
Alias: None
Product: kwin
Classification: Plasma
Component: platform-drm (show other bugs)
Version: 5.26.4
Platform: Fedora RPMs Linux
: NOR major
Target Milestone: 5
Assignee: KWin default assignee
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2022-12-02 16:27 UTC by shinjii
Modified: 2023-01-02 13:49 UTC (History)
4 users (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments
DRM_INFO (148.97 KB, text/plain)
2022-12-03 18:13 UTC, shinjii
Details
DRM_INFO 5.26.2 (148.97 KB, text/plain)
2022-12-05 10:24 UTC, shinjii
Details

Note You need to log in before you can comment on or make changes to this bug.
Description shinjii 2022-12-02 16:27:46 UTC
STEPS TO REPRODUCE
1. Just update Plasma from 5.26.3 to 5.26.4 (in Fedora repository by dnf update)

OBSERVED RESULT
Second screen is now like 60hz even if in system settings it's 240hz... before update it was fine.... and it's JUST ON WAYLAND, if I change to X11 it's good....

EXPECTED RESULT
240hz instead of 50-60hz

SOFTWARE/OS VERSIONS
Linux/KDE Plasma: Fedora 37
(available in About System)
KDE Plasma Version: 5.26.4
KDE Frameworks Version: 5.100.0
Qt Version: 5.15.7
Comment 1 shinjii 2022-12-02 16:52:05 UTC
I don't know if it's KWin or something with Wayland or what so I don't know which product I have to set in details of this bug :P
Comment 2 shinjii 2022-12-02 19:56:46 UTC
It looks like sometimes for few seconds on Main Screen refreshing rate is also changing to lower (from 144hz) and after few seconds it's again 144.... I don't know why and when? It's not my CPU or something... I have good hardware (i7 10750H, 32gb DDR4, NVME) 
 Before update it worked perfectly.
Comment 3 shinjii 2022-12-02 20:09:56 UTC
If you need any more details just tell me what to do and how :P
Comment 4 Zamundaaa 2022-12-03 14:59:50 UTC
Please attach the output of drm_info (https://gitlab.freedesktop.org/emersion/drm_info)
Comment 5 shinjii 2022-12-03 18:13:27 UTC
Created attachment 154286 [details]
DRM_INFO

Here you go, drm_info
Comment 6 Zamundaaa 2022-12-03 21:14:43 UTC
I see, it's falling back to CPU copy to make it work on the secondary GPU, which is it pretty slow. You should be able to verify that by looking at the CPU usage: when you put a video on the external monitor, it'll go up.

I'm not sure how this could be cause by this update though; there's no commits related to multi gpu in 5.26.4 that weren't also in 5.26.3, and NVidia has never supported the fast path that KWin uses to make multi-gpu work well.

Did you maybe also change the boot GPU somewhere? NVidia as primary and Intel as secondary should be fast, only the reverse will be slow.
Comment 7 shinjii 2022-12-04 11:24:44 UTC
(In reply to Zamundaaa from comment #6)
> I see, it's falling back to CPU copy to make it work on the secondary GPU,
> which is it pretty slow. You should be able to verify that by looking at the
> CPU usage: when you put a video on the external monitor, it'll go up.
> 
> I'm not sure how this could be cause by this update though; there's no
> commits related to multi gpu in 5.26.4 that weren't also in 5.26.3, and
> NVidia has never supported the fast path that KWin uses to make multi-gpu
> work well.
> 
> Did you maybe also change the boot GPU somewhere? NVidia as primary and
> Intel as secondary should be fast, only the reverse will be slow.

I upgraded Fedora 36 to 37 and it worked fine till there was that update 5.26.3 to 5.26.4.
To be honest - on fedora 36 it was working like now... only X11 was working fine... but after upgrade to fedora 37 suddenly I checked Wayland and I was working on it for few days until upgrade... now again it's slow as before in F36 :P 
I didn't change GPU boot etc.

That what you're saying about video and CPU - I played it and on main screen and it was 0-1%, after move to second screen now kwin-wayland is 4-6%.

It won't be a problem for me because X11 is working fine (refresh rate) but... after upgrade from F36 to F37 something is broken and I can't use it on X11 because icons disappeared and many other weird things happens - because of that X11 is for me not usable, Wayland is usable but that refresh rate on second screen is getting me nervous because that screen has 240hz ;D
Comment 8 Zamundaaa 2022-12-04 17:51:02 UTC
Can you downgrade KWin to 5.26.3 again and see if that does fix it? If it does, please attach the output of drm_info with 5.26.3
Comment 9 shinjii 2022-12-05 10:24:19 UTC
Created attachment 154326 [details]
DRM_INFO 5.26.2

I have only 5.26.2.1-1 in my repos :/ so I did downgrade to that and it's still the same.... I don't know why I don't have now 5.26.3 in repositories.
Comment 10 Zamundaaa 2022-12-05 16:32:46 UTC
Are you really certain that you changed no GPU settings? Some NVidia driver setting (performance mode, discrete-only, something in that direction) may change the boot gpu tag, which KWin then picks up on after a reboot.

As a test, you can make KWin always pick the NVidia GPU for rendering by putting
> KWIN_DRM_DEVICES="/dev/dri/card1:/dev/dri/card0"
into /etc/environment
As a downside, the GPU will never fully power down, but if you're plugged in that might be a tradeoff worth it for you.
Comment 11 shinjii 2022-12-05 18:52:20 UTC
(In reply to Zamundaaa from comment #10)
> Are you really certain that you changed no GPU settings? Some NVidia driver
> setting (performance mode, discrete-only, something in that direction) may
> change the boot gpu tag, which KWin then picks up on after a reboot.
> 
> As a test, you can make KWin always pick the NVidia GPU for rendering by
> putting
> > KWIN_DRM_DEVICES="/dev/dri/card1:/dev/dri/card0"
> into /etc/environment
> As a downside, the GPU will never fully power down, but if you're plugged in
> that might be a tradeoff worth it for you.

No, I didn't change anything about drivers/gpu settings, just updated packages with dnf update and that's all... 
1. KWIN_DRM_DEVICES="/dev/dri/card1:/dev/dri/card0" - not working, after reboot I can't login to KDE Wayland (screen freezes and I have to shut down system with button) -  but I can login to X11 and Gnome (Wayland) ;) 
2. Why 240hz on my second screen is working on KDE X11 and even on Gnome Wayland ?? I don't get it... what's difference between Gnome Wayland and KDE Wayland?....
Comment 12 shinjii 2022-12-08 19:54:37 UTC
Anyone can help? :D 
One more thing what I see, probably I did it few months ago in that /etc/environment file:
"KWIN_X11_REFRESH_RATE=240000
KWIN_X11_NO_SYNC_TO_VBLANK=1" - maybe because of that X11 have 240hz? :D
Comment 13 shinjii 2022-12-13 20:24:56 UTC
After delete nvidia drivers and install nouveau everything works fine....
Comment 14 Zamundaaa 2022-12-13 22:43:54 UTC
That's because Nouveau has full support for dmabuf.
Do you want to investigate why KWIN_DRM_DEVICES="/dev/dri/card1:/dev/dri/card0" doesn't work with the proprietary driver?
Comment 15 shinjii 2022-12-14 12:04:46 UTC
(In reply to Zamundaaa from comment #14)
> That's because Nouveau has full support for dmabuf.
> Do you want to investigate why
> KWIN_DRM_DEVICES="/dev/dri/card1:/dev/dri/card0" doesn't work with the
> proprietary driver?

Not really... if it's now working good with noveau I don't care about nvidia official drivers :P i'm not playing games on linux etc., just working... so... you know, waste of time :D
Comment 16 Zamundaaa 2022-12-14 12:40:54 UTC
That's good too, let's close this then
Comment 17 shinjii 2023-01-02 13:49:53 UTC
Hi again,
I bought new laptop which has now nvidia rtx 3060 - so I just put on my old disk with system which has that problem here and I installed nvidia official drivers + kernel from https://asus-linux.org and it's looks like it's working now so I can tell that problem was because of drivers or something around :P