How to disable vsync on i915 (xfce)

New to Debian (Or Linux in general)? Ask your questions here!
Post Reply
Message
Author
ChiefBigFeather
Posts: 24
Joined: 2023-06-28 13:17
Has thanked: 4 times

How to disable vsync on i915 (xfce)

#1 Post by ChiefBigFeather »

Dear Community,

I'm having trouble with very inconsistent framerates in a game I recently installed. What's causing this is a little uncertain, but I'd like to try to disable vsync and triple buffering on my integrated graphics (intel i915). Could you point me in the right direction?
My install is the latest debian 12 with xfce.

Thanks in advance!

User avatar
ruwolf
Posts: 896
Joined: 2008-02-18 05:04
Location: Banovce nad Bebravou
Has thanked: 86 times
Been thanked: 65 times

Re: How to disable vsync on i915 (xfce)

#2 Post by ruwolf »

Intel graphics wrote: If you use a compositor (the default in modern desktop environment like GNOME, KDE Plasma, Xfce, etc.), then TearFree, TripleBuffer and SwapbuffersWait can usually be disabled to improve performance and decrease power consumption.

Code: Select all

Option      "TearFree"        "false"
Option      "TripleBuffer"    "false"
Option      "SwapbuffersWait" "false"

The intel-driver uses Triple Buffering for vertical synchronization; this allows for full performance and avoids tearing. To turn vertical synchronization off (e.g. for benchmarking) use this .drirc in your home directory:

Code: Select all

~/.drirc

<device screen="0" driver="dri2">
	<application name="Default">
		<option name="vblank_mode" value="0"/>
	</application>
</device>

ChiefBigFeather
Posts: 24
Joined: 2023-06-28 13:17
Has thanked: 4 times

Re: How to disable vsync on i915 (xfce)

#3 Post by ChiefBigFeather »

Thanks!

Do I understand correctly, that I can set the setting specifically for some applications?

User avatar
ruwolf
Posts: 896
Joined: 2008-02-18 05:04
Location: Banovce nad Bebravou
Has thanked: 86 times
Been thanked: 65 times

Re: How to disable vsync on i915 (xfce)

#4 Post by ruwolf »

1st configuration is in X.org setting, which will apply to all applications running under Xfce.
2nd conf. is for DRI, which X.org should use by default , too, so, IMHO, it would apply to all apps, too.

ChiefBigFeather
Posts: 24
Joined: 2023-06-28 13:17
Has thanked: 4 times

Re: How to disable vsync on i915 (xfce)

#5 Post by ChiefBigFeather »

I edited /home/user/ .drirc adding:

Code: Select all

<device screen="0" driver="dri2">
    <application name="Default">
        <option name="vblank_mode" value="0"/>
        <option name="swapbuffers_wait" value="0"/>
        <option name="triple_buffer" value="false"/>
    </application>
</device>
But I don't think it worked. I filmed my screen with the camera of my cellphone (supposedly 240 Hz) and scrolled through some documents. I didn't see any tearing.

User avatar
stevepusser
Posts: 13014
Joined: 2009-10-06 05:53
Has thanked: 44 times
Been thanked: 88 times

Re: How to disable vsync on i915 (xfce)

#6 Post by stevepusser »

Any Intel iGPU newer than second-gen Haswell (2012?) will use the kernel's modesetting driver by default in Debian, where those settings did nothing the last time I looked.

Installing inxi from the repos, then running

Code: Select all

inxi -Gx
in a terminal should tell you what driver is being used: (example on my AMD laptop with external monitor):

Code: Select all

$ inxi -Gx
Graphics:
...
  Device-2: AMD Cezanne [Radeon Vega Series / Radeon Mobile Series]
    vendor: Dell driver: amdgpu v: kernel arch: GCN-5 bus-ID: 05:00.0
    temp: 54.0 C
...
  Display: x11 server: X.Org v: 1.21.1.7 with: Xwayland v: 22.1.9 driver: X:
    loaded: amdgpu,nvidia dri: radeonsi gpu: amdgpu resolution: 1: 2560x1440
    2: N/A
  API: OpenGL v: 4.6 Mesa 23.1.2-1~mx23ahs renderer: AMD Radeon Graphics
    (renoir LLVM 15.0.6 DRM 3.57 6.10.6-2-liquorix-amd64) direct-render: Yes
MX Linux packager and developer

ChiefBigFeather
Posts: 24
Joined: 2023-06-28 13:17
Has thanked: 4 times

Re: How to disable vsync on i915 (xfce)

#7 Post by ChiefBigFeather »

Inxi returns this:

Code: Select all

Graphics:
  Device-1: Intel Alder Lake-UP4 GT2 [Iris Xe Graphics] vendor: Dell
    driver: i915 v: kernel arch: Gen-12.2 bus-ID: 00:02.0
  Display: x11 server: X.Org v: 1.21.1.7 driver: X: loaded: modesetting
    unloaded: fbdev,vesa dri: iris gpu: i915 resolution: 1920x1200~60Hz
  API: OpenGL v: 4.6 Mesa 22.3.6 renderer: Mesa Intel Graphics (ADL GT2)
    direct-render: Yes
I tried editing /etc/X11/xorg.conf.d/20-intel.conf. That seemed to do something but also produced bugs like flickering and the game wouldn't launch when I tried to start it.
This is what I tried:

Code: Select all

Section "Device"
    Identifier "Intel Graphics"
    Driver "intel"
    Option "TearFree" "false"
    Option "TripleBuffer" "false"
EndSection

User avatar
stevepusser
Posts: 13014
Joined: 2009-10-06 05:53
Has thanked: 44 times
Been thanked: 88 times

Re: How to disable vsync on i915 (xfce)

#8 Post by stevepusser »

Yes, back when I had a laptop with an Intel iGPU, the 3D support was flaky with the "intel" driver--Google Earth and on 0ad, for example.

Isn't there a vSync setting in the xfce settings manager now? It's in the window manager tweaks--compositor section

You can also try a couple other compositors in the repos other than xfce's native one, but the name escapes me...ahh, compton and its successor, picom.
MX Linux packager and developer

ChiefBigFeather
Posts: 24
Joined: 2023-06-28 13:17
Has thanked: 4 times

Re: How to disable vsync on i915 (xfce)

#9 Post by ChiefBigFeather »

Thanks!

I tried finding it and failed. But that may just be incompetence...

How do I try other compositors with xfce?

Post Reply