# [SOLVED] Vsync not working in opengl games

## epsilon72

I recently acquired a new monitor (Dell u2410) and I'm having problems with screen tearing in games.  I have vsync enabled in nvidia-settings, but it doesn't work in game.  I think it may work in desktop environments and in video playback, but I need to do more testing to be sure of this.

The vsync problem in games though is quite annoying.  I should add that with vsync off I get MASSIVE screen tearing, and with vsync on the tearing is reduced but still very visible.  I've tested games in windows and vsync works fine, so I know it's not entirely the new monitor's fault.  In linux, the screen tearing happens regardless of whether I have composite enabled or not.

Info:

Nvidia gtx 460

Dell u2410 monitor (1920x1200@60hz via DVI-D)Last edited by epsilon72 on Mon Feb 28, 2011 5:07 am; edited 1 time in total

----------

## PaulBredbury

vsync is in 2 places:

"X Server XVideo Settings" for 2D

"OpenGL Settings" for 3D

And also in bash:

export __GL_SYNC_TO_VBLANK=1

Then run your game from bash.

----------

## epsilon72

vsync is enabled in both of those places.  I tried "export __GL_SYNC_TO_VBLANK=1" yesterday, but the problem persisted.

I neglected to post driver information and my xorg.conf...here it is:

nvidia-drivers-260.19.29

relevant sections of xorg.conf:

```

Section "ServerLayout"

    Identifier     "X.org Configured"

    Screen      0  "Screen0" 0 0

    InputDevice    "Mouse0" "CorePointer"

    InputDevice    "Keyboard0" "CoreKeyboard"

    Option         "Xinerama" "0"

EndSection

Section "Module"

    Load           "glx"

    Load           "record"

    Load           "extmod"

    Load           "dbe"

EndSection

Section "Monitor"

    Identifier     "Monitor0"

    VendorName     "Unknown"

    ModelName      "DELL U2410"

    HorizSync       30.0 - 81.0

    VertRefresh     56.0 - 76.0

EndSection

Section "Device"

    Identifier     "Card0"

    Driver         "nvidia"

    Option         "NoLogo" "true"

    BusID          "PCI:2:0:0"

EndSection

Section "Device"

    Identifier     "Device0"

    Driver         "nvidia"

    VendorName     "NVIDIA Corporation"

    BoardName      "GeForce GTX 460"

EndSection

Section "Screen"

    Identifier     "Screen0"

    Device         "Device0"

    Monitor        "Monitor0"

    DefaultDepth    24

    Option         "TwinView" "0"

#    Option   "DynamicTwinView"   "0"

    Option         "metamodes" "1920x1200_60 +0+0"

    SubSection     "Display"

        Depth       24

    EndSubSection

EndSection

Section "Extensions"

    Option         "Composite" "enable"

    Option         "RENDER" "true"

    Option         "RenderAccel" "true"

    Option         "AllowGLXWithComposite" "true"

    Option         "AddRGBGLXVisuals" "true"

#   Option   "TripleBuffer"   "true"

EndSection

```

Strange, I didn't realize I had two device sections.

----------

## PaulBredbury

 *epsilon72 wrote:*   

> two device sections.

 

Can only vsync to one display. E.g. in bash:

export __GL_SYNC_DISPLAY_DEVICE=DFP-0

Also I think your RenderAccel etc. is in the wrong section - check /var/log/Xorg.0.log

----------

## epsilon72

After further investigation I have found that this problem is only apparent in certain games (enemy territory and openarena, for example).  I'm going to go ahead and marked this as [SOLVED] because this is not a graphics/hardware issue.

----------

