Sky Force Reloaded
Psy-Q Nov 30, 2017 @ 6:49am
Thanks for the day 1 Linux support. Runs smooth as butter at least on Mesa
Thank you, dear developers, I hope many Linux users appreciate the support and buy this. I don't usually buy games on day one, but here I did.

It stutters for me on a GTX 1060, GTX 960 and GTX 860M as long as compositing is enabled in Plasma. If you have the same issue, see comment #15 below for a custom window behavior rule that blocks compositing for Sky Force Reloaded.

Runs smooth as butter on a crappy Intel Iris 540 integrated GPU with Wayland/Mesa on Debian testing. Gonna try it on an AMD RX 580 with Mesa as soon as I can get my hands on one.

Edit: Runs smooth on Intel integrated graphics on a lappy too, but stutters on the same laptop when using the Optimus-driven GTX 860M, even when running from within a Wayland session. So I'm guessing X and/or Nvidia are the problem.
Last edited by Psy-Q; Dec 20, 2017 @ 11:10am
< >
Showing 16-30 of 30 comments
Ouin-Ouin Dec 21, 2017 @ 1:57am 
Hi ! That's an interesting discussion :-)

Yep indeed KDE enables to make custom rules for windows / apps, that's super powerful !

May I ask you if you encounter performance or tearing issues in other apps / games ? Did you apply the little tweak I mention above, that is required not to encounter tearing with Nvidia cards ? (the one line file to add in /etc/profile.d) ?

As far as I can tell, Kwin's automatic composition suspension seems to work for me. It seems most games and movie players trigger it probably by using the relevant API call. I am not 100% sure as it's just my subjective feeling. Also, I had numerous Nvidia cards in several different PCs and several different distros / KDE generations and apart from the tearing issue mentioned above, I never had performance issues, so there is clearly a problem here...

What I mean is... Even if SkyForce is the only game of your library not explicitely blocking composition, it should still be smooth considering your GPU performance. Please allow me to reiterate :-) Are you sure this is not a tearing issue ?

What I appreciate with Martin is that he seems to refuse to implement things he considers as hacks or workarounds. The drawback is obviously that sometimes it makes it (temporarily) more difficult for some users...

Cheers ! (sorry, long & confusing post :)

PS : I read you don't like rolling release distros and I kinda agree with you :-) However KDE Neon is just half rolling : the base is the long term support Ubuntu. Then you choose between Neon LTS with LTS plasma or Neon regular with constantly up to date plasma... 5.12 will be the next LTS so spring might be a good time to switch !
Last edited by Ouin-Ouin; Dec 21, 2017 @ 2:00am
Psy-Q Dec 30, 2017 @ 3:08am 
I'm absolutely certain it's not a tearing issue, as it simply stutters but does not tear at all. And I can now reliably get the stutter to appear via enabling/disabling composition on all three machines, I'm happy we found the core issue :) I can also get it to disappear on GNOME, which points at Kwin's composition yet some more.

I've now tested several games (although without trying __GL_YIELD=USLEEP so far) using a seemingly better approach than before:

  • Disable ForceCompositionPipeline
  • Disable compositing
  • Enable vsync inside the game

That locks me at 60 fps max and adds a tiny bit of latency, but I care more about solid frame timing and getting rid of tearing, so this is great. The good news is that all games I've tested (Dead Island, Borderlands 2, Sky Force Reloaded, Hand of Fate) respond really well to this. No tearing, no stutter.

__GL_YIELD=USLEEP instead of switching compositing off will not change anything. There is tearing and stutter in the Sky Force series and Hand of Fate. As soon as I switch compositing off, there is no more tearing, no more stutter, with or without the __GL_YIELD option doesn't make a difference.

With Neon I'm not a fan that it's based on Ubuntu, so that won't become my daily driver unless they switch to Debian. I prefer distros made by non-profits and other non-commercial entitites because I feel the pressures of money, market and power will otherwise corrupt the product in some way. For example, Ubuntu Server advertises Canonical's Landscape product to you, Ubuntu desktop had sponsoring ties to Amazon in the past, etc. For me this is not the culture I want to see.

Debian, the Arch, even Gentoo don't need to give in to such temptations, they are truly independent. I also appreciate that most of Debian's packages have reproducible builds now.
Last edited by Psy-Q; Dec 30, 2017 @ 3:13am
Ouin-Ouin Dec 30, 2017 @ 8:34am 
Hi ! Well I'm sorry to say I'm clueless regarding your issue :( Never had it on any Nvidia machine on KDE . :(

Regarding Neon, it's true I would also prefer if it were Debian based ! Although, what is good is that it's THE official KDE distribution, based on a stable (LTS) base + with the KDE stack constantly up to date. KDE is moving ahead so fast you do not really have any proper alternative if you don't want a rolling release...

Also it benefits from stuff like the "HWE" kernels from Ubuntu (hardware enablement) which backports drivers over several years and enable to have an LTS working on newer machines. For instance you can keep a stable LTS kernel but with up to date drivers. I was impressed, I didn't know it existed until I realized Neon used them by default.

HMMM... I remember KDE frameworks is now supplied as a SNAP. So maybe, it'll eventually be possible to have an up to date KDE on another distro... I must say I've been distro hopping for almost 2 decades looking exactly for that : LTS distro + up to date KDE + kinda official KDE support.

I'm a bit sad no major distro really considers KDE seriously nowadays... I think there is soooo much more good work put into it than in any other DE... See how much momentum Linux Mint got and compare the features brought in a year in Cinnamon VS KDE ! It's crazy.

Cheers mate !
Last edited by Ouin-Ouin; Dec 30, 2017 @ 8:38am
Psy-Q Feb 7, 2018 @ 12:10am 
I researched this issue quite a lot now and I think I have a definite solution that also happens to fix all tearing and video stutter on KDE+Nvidia.

It still requires turning off compositing to play these games stutter-free. I also tested with other games and saw stutter unless compositing was off, so this isn't even related to the unredirection WM hint anymore. I don't know how GNOME does it under the same circumstances, but I stopped caring now since all is perfect on KDE.

Thanks to the Kwin triple buffering trick mentioned above and some information from the Arch Linux wiki, I found out that there is a long-standing Nvidia driver bug in that the card appears to advertise triple buffering when in reality it's not doing triple buffering. This messes up Kwin's timing calculations (if I understand correctly).

The solution is to tell both the Nvidia driver and Kwin to force triple buffering and to switch Vsync on in the compositor. This gets you stutter-free, tearing-free desktop without needing to use ForceCompositionPipeline, an option that would introduce strong stutter.

Stick this in ~/.config/plasma-workspace/env/kwin.sh:

#!/bin/sh export KWIN_TRIPLE_BUFFER=1

Then make sure to have an xorg.conf.d snippet that tells enables TripleBuffer on Nvidia:

Section "Device" Identifier "Videocard0" Driver "nvidia" Option "TripleBuffer" "true" EndSection

Tried this on Debian and Neon with great success.

And to mahenou, I think KDE will rise to more glory at some point. It's extremely fast even on modest hardware, uses only about 350 MB RAM for me and is the most full-featured and customizable desktop environment I know. This has to count for something. Now if only they got the stability up as well. I get why distros don't put it in as default, it can be overwhelming for new users to have so many options. But as long as there are packagers for it for Debian, Arch and others and as long as Neon exists, I think it will be fine.

I donate every year to the KDE project to help keep things going :)

Cheers!
Ouin-Ouin Feb 7, 2018 @ 12:42am 
Yeah, they are focusing on polishing now. Kde Plasma 5.12 was released yesterday, it's brilliant :)

Regarding the nvidia issues, 3 solutions indeed :

1) yours by forcing triple buffering
2) the one advised by kde team GL_YIELD variable
or in the NVIDIA control panel, 3) force the compositing pipeline and the app does the work of creating the x conf file

I used to think the 2) was better but actually my desktop is smoother with 3)

Stll I wonder why you have to disable composition manually... never had or heard of this issue...
Last edited by Ouin-Ouin; Feb 7, 2018 @ 12:49am
Psy-Q Feb 8, 2018 @ 12:34am 
Do you not get stutter (even in video) with 3)? I get heavy stutter in games and video that way, it feels to my poor optic nerves as if the card is delaying some frames for too long before it copies them to the framebuffer in order to really force a full frame update.

I will poke the 2) trick again, last time it didn't do anything but maybe it wasn't picked up by Kwin (now I know more about setting Kwin env vars, so that's something).

Edit: Tried it inside .config/plasma-workspace/env/kwin.sh. I must have done something wrong last time, since now everything is silky-smooth even without manually disabling compositing. I'll go through some more games but in Sky Force it was very easy to determine whether there is stutter or not because it has such delicious scrolling.

Edit 2: ARGH! With only the GL_YIELD trick there is tearing in KDE now. Only triple buffer seems to get rid of that.

Cheers and thanks :)
Last edited by Psy-Q; Feb 8, 2018 @ 1:18am
Ouin-Ouin Feb 8, 2018 @ 2:29am 
Hi ! With any if the three solutions specified above I have no tearing and all games and videos are butter smooth, and I don't have to disable composition either...

The desktop itself is smoother though, with any intel hd graphics !! But that's another subject.

I copy paste from the manjaro forum :

The fix is as easy as making a text file in the terminal:

sudo nano /etc/profile.d/kwin.sh

Inside the text file, you need the following:

#!/bin/bash
export __GL_YIELD=USLEEP

Then hit ctrl+o to save it, ctrl+x to exit out and reboot. Bam, no more tearing with the NVidia driver. :slight_smile:
Ouin-Ouin Feb 8, 2018 @ 2:32am 
It might sound stupid, but did you try with a different screen ? In case some frequencies are incorrectly reported ?
Psy-Q Feb 9, 2018 @ 1:32am 
I tried only the one screen so far, but it's an Eizo Foris and those aren't known to report rubbish. Still, could be that this particular one has issues. The only other reliable display I have is the laptop one, but that's internally connected to the Intel iGPU and doesn't tear anyway.

I know that the __GL_YIELD env var was picked up correctly by Kwin since it shows up in the env where Steam is run and the game itself is smooth, even without disabling compositing. So it's doing something.

Maybe the tearing in the desktop is the result of an Nvidia driver that's too new and doesn't gel with the older KDE, it's 384.111 from the short-lived branch. I'll revert to the old 375.82 that's in the repos and see what happens.
Last edited by Psy-Q; Feb 9, 2018 @ 1:32am
Ouin-Ouin Feb 9, 2018 @ 1:45am 
I dunno, haven't seen this issue for a while.
I use Nvidia driver 390.x and Plasma 5.12 (but didn't have the issue with the former versions of each).
There is definitely something special with your cofiguration that nobody else seems to encounter, but what is it ?
Psy-Q Feb 9, 2018 @ 2:16am 
I can reproduce it on 3 PCs, so it's something that this exact combination of stuff will always produce. But here's news: It appears to be fixed in Nvidia driver 390.25.

I decided to go to 390.25 before trying 375.82 again, and this one is smooth with either __GL_YIELD="USLEEP" or with triple buffering. In better news, compositing doesn't have to be disabled by hand anymore. I'm 99% sure that 375.82 had problems so I'm not too motivated to test this against that.

I'll try without those options now, maybe a miracle happened and some long-standing issue in Nvidia's driver was fixed that miraculously cures the tearing that happens by default as well.

Edit: Fortunately (because I'm going crazy here), tearing is back on the desktop even with 390.25 unless I set one of those options.

But Sky Force is smooth as silk with 390.25 in any situation, compositing on or off, triple buffer on or off, GL_YIELD set to USLEEP or not, it's always perfect. No tearing, no stutter. So if I meet someone else with Plasma on Debian stable, I'll recommend to use nothing older than 390.25 and hope for the best.

My next card is an AMD, as soon as the cryptocurrency miners stop driving prices up :)
Last edited by Psy-Q; Feb 9, 2018 @ 2:23am
Ouin-Ouin Feb 9, 2018 @ 2:56am 
Pfew, great news then !
Indeed, I'll definitely consider AMD for my next card... Although it seems they seem to consume / heat more than their NVIDIA counterpart... :-) Having no need to install a proprietary driver + butter smooth KDE + no tweak to apply sounds like a dream ;)
Ouin-Ouin Feb 9, 2018 @ 3:04am 
BTW, if you happen to compare the different solutions, let me know ! For some reason, when Forcing the compositing pipeline (not full, dunno if it makes a difference), my 3D performance is slightly better. For instance, it's constantly butter smooth in Bioshock infinity while I can feel some microstutter with GL_YIELD. It seems slightly better for the desktop too. So I don't know why this is not the preferred solution usually. Tell me if you find it adds some lag as some pretend.

So, all in all, that's pretty good, although, artificially not perfect due to silly drivers issues :-)
Substryder May 8, 2020 @ 2:25pm 
Originally posted by Psy-Q:
I researched this issue quite a lot now and I think I have a definite solution that also happens to fix all tearing and video stutter on KDE+Nvidia.

It still requires turning off compositing to play these games stutter-free. I also tested with other games and saw stutter unless compositing was off, so this isn't even related to the unredirection WM hint anymore. I don't know how GNOME does it under the same circumstances, but I stopped caring now since all is perfect on KDE.

Thanks to the Kwin triple buffering trick mentioned above and some information from the Arch Linux wiki, I found out that there is a long-standing Nvidia driver bug in that the card appears to advertise triple buffering when in reality it's not doing triple buffering. This messes up Kwin's timing calculations (if I understand correctly).

The solution is to tell both the Nvidia driver and Kwin to force triple buffering and to switch Vsync on in the compositor. This gets you stutter-free, tearing-free desktop without needing to use ForceCompositionPipeline, an option that would introduce strong stutter.

Stick this in ~/.config/plasma-workspace/env/kwin.sh:

#!/bin/sh export KWIN_TRIPLE_BUFFER=1

Then make sure to have an xorg.conf.d snippet that tells enables TripleBuffer on Nvidia:

Section "Device" Identifier "Videocard0" Driver "nvidia" Option "TripleBuffer" "true" EndSection

Tried this on Debian and Neon with great success.

And to mahenou, I think KDE will rise to more glory at some point. It's extremely fast even on modest hardware, uses only about 350 MB RAM for me and is the most full-featured and customizable desktop environment I know. This has to count for something. Now if only they got the stability up as well. I get why distros don't put it in as default, it can be overwhelming for new users to have so many options. But as long as there are packagers for it for Debian, Arch and others and as long as Neon exists, I think it will be fine.

I donate every year to the KDE project to help keep things going :)

Cheers!


Hi there,

thanks so far for this info! I've got Debian 10 and did it how you said but itś not working :(

in /.config/plasma-workspace/env/ i created a new file kwin.sh

also added in the xorg file in the "device" section

Option "TripleBuffer" "true"

Did I made something wrong?


What worked is, that (because i have gsync with 75hz) in the /.config/kwinrc file, in the [Compositing] section add

MaxFPS=75
RefreshRate=75

so i've got smooth windowmoving right now.
But tearing at movies is still there :(

Hope u can help me

Psy-Q May 9, 2020 @ 4:05am 
I've switched to an AMD card and since then I never had any problems with stuttering or tearing anymore in any game :(

You should be able to see if the TripleBuffer option was accepted by looking into /var/log/Xorg.0.log. But I don't know if that trick is even still relevant.
< >
Showing 16-30 of 30 comments
Per page: 1530 50