[kwin] [Bug 387214] Kwin hogs CPU occasionally on fullscreen video playback

2017-11-26 Thread Martin Flöser
https://bugs.kde.org/show_bug.cgi?id=387214

--- Comment #9 from Martin Flöser  ---
Compared to 17.04 you also updated the Nvidia driver. So the problem might also
be there. I'm sorry but you cannot expect any support for the proprietary
driver.

-- 
You are receiving this mail because:
You are watching all bug changes.

[kwin] [Bug 387214] Kwin hogs CPU occasionally on fullscreen video playback

2017-11-26 Thread Lastique
https://bugs.kde.org/show_bug.cgi?id=387214

--- Comment #8 from Lastique  ---
I didn't have that problem with the same driver on Kubuntu 17.04, i.e. it's a
regression. I'm also not having the problem with other WMs like compton or
compiz. So I'm expecting Kwin to at least continue to work in the previous
config the same way it did before and preferably not worse than alternatives.

-- 
You are receiving this mail because:
You are watching all bug changes.

[kwin] [Bug 387214] Kwin hogs CPU occasionally on fullscreen video playback

2017-11-26 Thread Martin Flöser
https://bugs.kde.org/show_bug.cgi?id=387214

Martin Flöser  changed:

   What|Removed |Added

 Resolution|--- |INVALID
 Status|UNCONFIRMED |RESOLVED

--- Comment #7 from Martin Flöser  ---
An increased system usage is to be expected if you disable buffer age. AFAIK
__GL_YIELD="USLEEP" is the recommended way for NVIDIA drivers.

Overall I don't see an issue here. The system doesn't have CPU spikes in the
default setup and only starts to show those spikes when manually modifying KWin
through env variables. I'm sorry to say, but you cannot expect all combinations
to work equally good.

-- 
You are receiving this mail because:
You are watching all bug changes.

[kwin] [Bug 387214] Kwin hogs CPU occasionally on fullscreen video playback

2017-11-26 Thread Lastique
https://bugs.kde.org/show_bug.cgi?id=387214

--- Comment #6 from Lastique  ---
If I remove all environment variables I get tearing and no CPU spikes.

I found that the minimal setup to get CPU spikes is to have
KWIN_USE_BUFFER_AGE=0 in /etc/environment. The average CPU consumption by Kwin
in this setup while playing video fullscreen is noticeable higher (2-3% vs 0-1%
as KSysGuard reports) and there are periodic CPU spikes.

Adding just __GL_YIELD="USLEEP" to /etc/environment solves the CPU spikes.

Other things I've tried:

__GL_THREADED_OPTIMIZATIONS=1 alone does not enable CPU spikes, but together
with KWIN_USE_BUFFER_AGE=0 it seems to make the spikes more prominent (i.e.
more often to appear and longer in duration).

Other mentioned environment variables don't seem to affect the problem.

"Allow applications to block compositing" in Compositor setting doesn't affect
the problem.

During all the testing, Rendering backend was OpenGL 3.1, Tearing prevention
was Automatic.

I cannot permanently remove KWIN_USE_BUFFER_AGE=0 because this is a workaround
for https://bugs.kde.org/show_bug.cgi?id=363500.

-- 
You are receiving this mail because:
You are watching all bug changes.

[kwin] [Bug 387214] Kwin hogs CPU occasionally on fullscreen video playback

2017-11-26 Thread Martin Flöser
https://bugs.kde.org/show_bug.cgi?id=387214

Martin Flöser  changed:

   What|Removed |Added

  Flags||NVIDIA+

--- Comment #5 from Martin Flöser  ---
I fear this are problems caused by the Nvidia driver. Many of those environment
variables are only relevant for the Nvidia driver. My suggestion is to try with
everything on default, maybe even with a new user.

-- 
You are receiving this mail because:
You are watching all bug changes.

[kwin] [Bug 387214] Kwin hogs CPU occasionally on fullscreen video playback

2017-11-25 Thread Lastique
https://bugs.kde.org/show_bug.cgi?id=387214

--- Comment #4 from Lastique  ---
I've also tested without KWIN_TRIPLE_BUFFER=1 and __GL_YIELD="USLEEP" and I'm
also seeing CPU spikes.

-- 
You are receiving this mail because:
You are watching all bug changes.

[kwin] [Bug 387214] Kwin hogs CPU occasionally on fullscreen video playback

2017-11-25 Thread Lastique
https://bugs.kde.org/show_bug.cgi?id=387214

Lastique  changed:

   What|Removed |Added

Version|unspecified |5.11.3

-- 
You are receiving this mail because:
You are watching all bug changes.

[kwin] [Bug 387214] Kwin hogs CPU occasionally on fullscreen video playback

2017-11-25 Thread Lastique
https://bugs.kde.org/show_bug.cgi?id=387214

Lastique  changed:

   What|Removed |Added

 Status|NEEDSINFO   |UNCONFIRMED
 Resolution|WAITINGFORINFO  |---

--- Comment #3 from Lastique  ---
I have compiled Kwin 5.11.3 on Kubuntu 17.10 (all other packages taket from
Kubuntu repos) and can reproduce the CPU spikes. The spikes seem to happen only
if I have KWIN_TRIPLE_BUFFER=1 in /etc/environment. If I comment that line and
instead put __GL_YIELD="USLEEP" to Kwin startup line I can see no spikes, at
least not for about an hour I tested.

So, to summarize:

1. /etc/environment:

KWIN_TRIPLE_BUFFER=1
KWIN_USE_BUFFER_AGE=0
__GL_SYNC_TO_VBLANK=1
__GL_SYNC_DISPLAY_DEVICE="DFP-0"
__GL_THREADED_OPTIMIZATIONS=1

Kwin startup command:

__GL_THREADED_OPTIMIZATIONS=0 kwin_x11

Problem happens.

2.  /etc/environment:

#KWIN_TRIPLE_BUFFER=1
KWIN_USE_BUFFER_AGE=0
__GL_SYNC_TO_VBLANK=1
__GL_SYNC_DISPLAY_DEVICE="DFP-0"
__GL_THREADED_OPTIMIZATIONS=1

Kwin startup command:

__GL_THREADED_OPTIMIZATIONS=0 __GL_YIELD="USLEEP" kwin_x11

Problem does not happen.

In both cases I'm playing this video fullscreen in mpv:
https://www.youtube.com/watch?v=dFW0BSdR2G4

The video is vp9 1920x1080 60.000fps, fullscreen on a secondary screen that has
resolution 1920x1080. mpv options are:

--cache-initial=2048 --vf-add=gradfun --vf-add="vdpaupp=hqscaling=1"
--ytdl-format="((bestvideo[height<=?1080][vcodec=vp9]/bestvideo[height<=?1080])+(bestaudio[acodec=opus]/bestaudio[acodec=vorbis]/bestaudio[acodec=aac]/bestaudio))/best"
--ytdl-raw-options="socket-timeout=10" --network-timeout=10

-- 
You are receiving this mail because:
You are watching all bug changes.

[kwin] [Bug 387214] Kwin hogs CPU occasionally on fullscreen video playback

2017-11-22 Thread Lastique
https://bugs.kde.org/show_bug.cgi?id=387214

--- Comment #2 from Lastique  ---
I'm not going to be able to test it until it is available in Kubuntu. If it can
be built against Kubuntu 17.10 packages, I can try building it but I will need
instructions.

-- 
You are receiving this mail because:
You are watching all bug changes.

[kwin] [Bug 387214] Kwin hogs CPU occasionally on fullscreen video playback

2017-11-22 Thread Martin Flöser
https://bugs.kde.org/show_bug.cgi?id=387214

Martin Flöser  changed:

   What|Removed |Added

 Status|UNCONFIRMED |NEEDSINFO
 Resolution|--- |WAITINGFORINFO

--- Comment #1 from Martin Flöser  ---
5.10 is no longer supported by us. Please try again with 5.11.

-- 
You are receiving this mail because:
You are watching all bug changes.