You are not logged in.

#1 2022-03-25 03:41:18

askreceive
Member
Registered: 2022-03-01
Posts: 48

Tearing with Nvidia proprietary driver

I've been pulling my hair trying to fix tearing without compositor/KWin/KDE. I know this sounds ridiculous, and I should have expected this since compositor is basically v-sync, but since KDE/Kwin has an option to disable compositor whenever a game is launched, I'm wondering if there's a way to retain v-sync.

The reason for this is, for whatever reason, in-game's v-sync does not work or just doesn't sync properly when the compositor is off: I still see one tear or horizontal line whenever I move around in a game. I tried using Picom, and while it worked beautifully, Picom does not have as much effects as Kwin and does not integrate properly with KDE.

I also tried MangoHud's v-sync enabled through its configuration, but the problem persists. And again, this is when the compositor is off. This doesn't occur when it's on, but I prefer to disable compositor since compositor can be demanding when playing a game.

I tried this method, and it works, but my desktop feels choppier or jankier when it's on (might be just me):
https://wiki.archlinux.org/title/NVIDIA … en_tearing
(Kwin's triple buffer or usleep does not work either.)

I would also like to ask for a clarification for this troubleshooting:
1. In the link section above, it states that, in order to make the changes permanent, triple buffering and indirect glx protocol should be added to the xorg.conf, but I'm not sure what "permanent" means in this context, or what it does in general, as I have enabled the full compositor and added metamode into xorg without triple buffering/glx, and the tearing is gone. Other people don't seem to mention this either.

2. When the full compositor is on and KWin's compositor is on, doesn't this essentially enable two v-syncs?

Thank you.

Last edited by askreceive (2022-03-26 16:37:42)

Offline

#2 2022-03-25 08:51:35

V1del
Forum Moderator
Registered: 2012-10-16
Posts: 25,285

Re: Tearing with Nvidia proprietary driver

1. Full composition pipeline has a far bigger impact than triple buffering on what the GPU has to do and might show itself in stuttery gameplay performance. You can enable just triple buffering, without the full composition pipeline. "Permanent" in this context is for the entirety of your X session when X starts.

2. Yes which is why the combination isn't really recommended

FWIW something you could test though I don't have a main card nvidia system at hand right now to give a direct experience report, is check a Wayland session which in theory should work fairly well if you use the latest/current driver. I had similar reasons for testing this on my AMD system as I didn't want to disable the compositor in a multi monitor setup and still avoid the visible perf hit.

Offline

#3 2022-03-25 12:02:20

askreceive
Member
Registered: 2022-03-01
Posts: 48

Re: Tearing with Nvidia proprietary driver

The tearing still occurs even with triple buffering set in xorg.conf hmm

I do use the latest driver with dkms since I use zen kernel. But I'm having doubts with Wayland session due to lack of compatibility or overall instability I'm hearing from other people who use Wayland.  And it looks like I can't use Wayland to begin with (sddm does not show the option to use Wayland) unless if I'm missing something.

I might try this, but I'm not sure what the benefits are over standard Kwin:
https://gitlab.com/kwinft/kwinft

Last edited by askreceive (2022-03-25 14:26:58)

Offline

#4 2022-03-25 14:26:42

askreceive
Member
Registered: 2022-03-01
Posts: 48

Re: Tearing with Nvidia proprietary driver

I apologize, but it looks like I'm too stupid or petty to narrow down problem: it's actually the game's issue, sort of, or launch command priority.

Instead of trying with other games, I only tested with one and immediately deemed it as a system or hardware problem instead of doing more test. I then decided to try in-game's v-sync or MangoHud's with other games. And either option indeed does work, just not with the game I previously tested. I think I can consider this as solved. I decided to keep using v-sync through MangoHud since it works better that way. I configured mangohud to enable vsync = 3

It's either the game's problem or launch option priority. The game I'm having issue with has mangohud %command% at the end instead of the beginning, like the rest of the game.

Last edited by askreceive (2022-03-25 14:27:46)

Offline

#5 2022-03-25 14:56:02

seth
Member
From: Won't reply 2 private help req
Registered: 2012-09-03
Posts: 76,704

Re: Tearing with Nvidia proprietary driver

I still see one tear or horizontal line whenever I move around in a game …  this is when the compositor is off. This doesn't occur when it's on

Some clarifications:
1. The problem isn't related to the (kwin) compositor, but TheGame™?
2. Is the tearline in a static position or does it move across the screen?
3. What is "game™"? Code for "steam"? Do you have similar issues w/ eg. https://archlinux.org/packages/community/x86_64/warsow/ ? Glxgears?

Please post your xorg log and the output of "xrandr -q"
Edit: the beauty of F5 …

You can try to export

__GL_SYNC_TO_VBLANK=1 __GL_SYNC_DISPLAY_DEVICE=hdmi-0 # fix the output name, see xrandr output

to TheGame™

Also, next time please report your thread for to moved to another category.
https://bbs.archlinux.org/viewtopic.php?id=274906

Last edited by seth (2022-03-25 14:56:58)

Offline

#6 2022-03-26 16:48:37

askreceive
Member
Registered: 2022-03-01
Posts: 48

Re: Tearing with Nvidia proprietary driver

I decided to remove the solved tag and add few things.

1. This seems to be the case, yes. The game I'm having troubles with is Payday 2. This is the only game where v-sync doesn't apply at all; both in game's or MangoHud's v-sync options do not work. However, other games' such as Deep Rock Galactic and Payday: The Heist (basically payday 1) does not have tearing with either option.
Strangely enough, using picom compositor with unredir option set to true then Payday's 2 v-sync does eliminate tearing.
https://www.protondb.com/app/218620

(There is a native Linux version for the game, but I run it under Proton-GE as it gives much better performance and modding compatibility. I have not tried it with official versions from Valve.)

2. The latter. It moves across the screen.

3. Refer to number 1

I'm not sure how to export these. I'm assuming this is for steam's launch option?
__GL_SYNC_TO_VBLANK=1 __GL_SYNC_DISPLAY_DEVICE=DVI-I-0 # output configured

Lastly, as far as I'm aware, this issue only occurs in Payday 2, so I consider this issue to be an annoyance rather an actual problem of my hardware or other components. However, I still would like to hear other suggestions if there's any. Other people also suggest setting the drm modeset enabled, but I'm not sure how to do it.

Last edited by askreceive (2022-03-26 16:57:38)

Offline

#7 2022-03-26 21:21:01

seth
Member
From: Won't reply 2 private help req
Registered: 2012-09-03
Posts: 76,704

Re: Tearing with Nvidia proprietary driver

'm assuming this is for steam's launch option?

Yes, see https://wiki.archlinux.org/title/Steam#Launch_options

The moving line means that it's completely unsynced and w/ the environment, the driver will inject that so as long as the game uses buffer swapping, it will end up being synced.
If the game doesn't use buffer swapping, there's no way but relying on the indirection and swap syncing of the compositor.

Offline

#8 2022-03-27 01:49:27

askreceive
Member
Registered: 2022-03-01
Posts: 48

Re: Tearing with Nvidia proprietary driver

__GL_SYNC_TO_VBLANK=1 __GL_SYNC_DISPLAY_DEVICE=DVI-I-0

These options + mangohud/in-game's v-sync worked! I relaunched the game couple of times, just to make sure, and the game is now tear free. I even removed the first option to narrow down the solution/issue, and it looks like the game just doesn't sync properly with my monitor or something. So the solution is to add that second option to steam launch options + game's or mangohud's v-sync.

Thanks for all your help, I really appreciate it.

Last edited by askreceive (2022-03-27 01:50:22)

Offline

#9 2022-03-27 07:01:47

seth
Member
From: Won't reply 2 private help req
Registered: 2012-09-03
Posts: 76,704

Re: Tearing with Nvidia proprietary driver

Please always remember to mark resolved threads by editing your initial posts subject - so others will know that there's no task left, but maybe a solution to find.
Thanks.

Offline

Board footer

Powered by FluxBB