Stuttering in games with high fps and Nvidia

Bug #1029085 reported by Peter Wolf
34
This bug affects 7 people
Affects Status Importance Assigned to Milestone
Compiz
Confirmed
Undecided
Unassigned
compiz (Ubuntu)
Confirmed
Undecided
Unassigned

Bug Description

Problem: While playing a game with high fps (>30), which should be smooth, the game stutters. For example, when I play Minecraft, which usually runs with 40-80fps (you can see the frames per second in the game), the game stutters. 50fps look more like this game in the video http://www.youtube.com/watch?v=5-UpHp_p_8I So 50fps correspond to 15-20fps, with lower fps, such as 30fps, the game runs like with 10fps.

I only see the stuttering with my Nvidia (GT 540m), with my AMD GPU (6850HD) all games run fine, even low fps games (<30) are smooth. I also don't see the problem with other window managers (Mutter and Metacity), the games run fine with Nvidia there.

Refresh rate of Compiz is set to 60fps, VSync is activated and "Force full screen redraw (buffer swap) on repaint" is checked.

I can't remember having this issue with Ubuntu 11.10, so this problem probably came with the newer versions of Compiz. The version of the GPU driver is 302.17, but I had the stuttering with 290.10 and 295.xx too.
---
.proc.driver.nvidia.gpus.0: Error: [Errno 21] Ist ein Verzeichnis: '/proc/driver/nvidia/gpus/0'
.proc.driver.nvidia.registry: Binary: ""
.proc.driver.nvidia.version:
 NVRM version: NVIDIA UNIX x86_64 Kernel Module 302.17 Tue Jun 12 16:03:22 PDT 2012
 GCC version: gcc-Version 4.6.3 (Ubuntu/Linaro 4.6.3-1ubuntu5)
.proc.driver.nvidia.warnings.fbdev:
 Your system is not currently configured to drive a VGA console
 on the primary VGA device. The NVIDIA Linux graphics driver
 requires the use of a text-mode VGA console. Use of other console
 drivers including, but not limited to, vesafb, may result in
 corruption and stability problems, and is not supported.
.tmp.unity.support.test.0:

ApportVersion: 2.0.1-0ubuntu11
Architecture: amd64
CompizPlugins: [core,composite,opengl,decor,mousepoll,gnomecompat,vpswitch,compiztoolbox,resize,wall,regex,grid,place,move,imgpng,text,snap,animation,session,unitymtgrabhandles,fade,expo,workarounds,scale,ezoom,scaleaddon,unityshell]
CompositorRunning: compiz
DistUpgraded: Fresh install
DistroCodename: precise
DistroRelease: Ubuntu 12.04
DistroVariant: ubuntu
DkmsStatus:
 nvidia-current, 302.17, 3.2.0-27-generic, x86_64: installed
 vboxhost, 4.1.18, 3.2.0-26-generic, x86_64: installed
 vboxhost, 4.1.18, 3.2.0-27-generic, x86_64: installed
GraphicsCard:
 NVIDIA Corporation GF108 [GeForce GT 540M] [10de:0df4] (rev a1) (prog-if 00 [VGA controller])
   Subsystem: Acer Incorporated [ALI] Device [1025:0487]
InstallationMedia: Ubuntu 12.04 LTS "Precise Pangolin" - Release amd64 (20120425)
JockeyStatus:
 xorg:nvidia_current - NVIDIA accelerated graphics driver (Proprietary, Enabled, In use)
 xorg:nvidia_current_updates - NVIDIA accelerated graphics driver (post-release updates) (Proprietary, Disabled, Not in use)
Lsusb:
 Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
 Bus 002 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
 Bus 001 Device 002: ID 8087:0020 Intel Corp. Integrated Rate Matching Hub
 Bus 002 Device 002: ID 8087:0020 Intel Corp. Integrated Rate Matching Hub
 Bus 001 Device 003: ID 04fc:2801 Sunplus Technology Co., Ltd
MachineType: Acer TravelMate 5742G
NonfreeKernelModules: nvidia
Package: compiz 1:0.9.7.8-0ubuntu1.2
PackageArchitecture: all
ProcEnviron:
 TERM=xterm
 PATH=(custom, no user)
 LANG=de_DE.UTF-8
 SHELL=/bin/bash
ProcKernelCmdLine: BOOT_IMAGE=/boot/vmlinuz-3.2.0-27-generic root=UUID=94ce6887-112f-4202-8395-07851995c3f8 ro quiet splash acpi=noirq vt.handoff=7
ProcVersionSignature: Ubuntu 3.2.0-27.43-generic 3.2.21
Tags: precise precise ubuntu compiz-0.9
Uname: Linux 3.2.0-27-generic x86_64
UpgradeStatus: No upgrade log present (probably fresh install)
UserGroups: adm cdrom dip lpadmin plugdev sambashare sudo vboxusers
XorgConf:
 Section "Device"
  Identifier "Default Device"
  Option "NoLogo" "True"
  Option "TripleBuffer" "True"
 EndSection
dmi.bios.date: 11/09/2011
dmi.bios.vendor: Acer
dmi.bios.version: V1.27
dmi.board.asset.tag: Base Board Asset Tag
dmi.board.name: TravelMate 5742G
dmi.board.vendor: Acer
dmi.board.version: V1.27
dmi.chassis.type: 10
dmi.chassis.vendor: Acer
dmi.chassis.version: V1.27
dmi.modalias: dmi:bvnAcer:bvrV1.27:bd11/09/2011:svnAcer:pnTravelMate5742G:pvrV1.27:rvnAcer:rnTravelMate5742G:rvrV1.27:cvnAcer:ct10:cvrV1.27:
dmi.product.name: TravelMate 5742G
dmi.product.version: V1.27
dmi.sys.vendor: Acer
version.compiz: compiz 1:0.9.7.8-0ubuntu1.2
version.ia32-libs: ia32-libs 20090808ubuntu36
version.libdrm2: libdrm2 2.4.32-1ubuntu1
version.libgl1-mesa-dri: libgl1-mesa-dri 8.0.2-0ubuntu3.1
version.libgl1-mesa-dri-experimental: libgl1-mesa-dri-experimental N/A
version.libgl1-mesa-glx: libgl1-mesa-glx 8.0.2-0ubuntu3.1
version.nvidia-graphics-drivers: nvidia-graphics-drivers N/A
version.xserver-xorg-core: xserver-xorg-core 2:1.11.4-0ubuntu10.6
version.xserver-xorg-input-evdev: xserver-xorg-input-evdev 1:2.7.0-0ubuntu1.2
version.xserver-xorg-video-ati: xserver-xorg-video-ati 1:6.14.99~git20111219.aacbd629-0ubuntu2
version.xserver-xorg-video-intel: xserver-xorg-video-intel 2:2.19.0-0ubuntu1~xup1
version.xserver-xorg-video-nouveau: xserver-xorg-video-nouveau 1:0.0.16+git20111201+b5534a1-1build2

Peter Wolf (onti)
no longer affects: ubuntu
Revision history for this message
Daniel van Vugt (vanvugt) wrote :

Please try enabling vsync in the nvidia-settings dialog too. Once you've done that, you may not need it enabled in compiz. So disabling vsync in CCSM > General > OpenGL might help.

Please also run this command in a terminal, which will upload information about your system:
    apport-collect 1029085

The vsync and rendering methods are going to change dramatically (for the better) in Ubuntu 12.10. So this might be an issue we've already resolved in development. However that new faster code has not yet even been released in 12.10-alpha for you to test.

Changed in compiz:
status: New → Incomplete
Revision history for this message
Peter Wolf (onti) wrote :

apport-collect doesn't work, I get the message "No further information could be collected" or something like that (it's in German)

Deactivating Vync in CCSM and activating it in the Nvidia settings doesn't help, still a lot of stuttering especially with low fps (30-45). I have tested some settings in CCSM and Nvidia (like triple buffering or synchronization between X and GLX), nothing helped, it just reduced tearing.

Revision history for this message
Daniel van Vugt (vanvugt) wrote :

Please try apport-collect 1029085 again.

It might work now that I've fixed up the Affects column.

Changed in compiz (Ubuntu):
status: New → Incomplete
Revision history for this message
Peter Wolf (onti) wrote : .proc.driver.nvidia.params.txt

apport information

tags: added: apport-collected compiz-0.9 precise ubuntu
description: updated
Revision history for this message
Peter Wolf (onti) wrote : BootDmesg.txt

apport information

Revision history for this message
Peter Wolf (onti) wrote : BootLog.gz

apport information

Revision history for this message
Peter Wolf (onti) wrote : CurrentDmesg.txt

apport information

Revision history for this message
Peter Wolf (onti) wrote : Dependencies.txt

apport information

Revision history for this message
Peter Wolf (onti) wrote : DpkgLog.txt

apport information

Revision history for this message
Peter Wolf (onti) wrote : GconfCompiz.txt

apport information

Revision history for this message
Peter Wolf (onti) wrote : LightdmLog.txt

apport information

Revision history for this message
Peter Wolf (onti) wrote : Lspci.txt

apport information

Revision history for this message
Peter Wolf (onti) wrote : NvidiaBugReportLog.txt

apport information

Revision history for this message
Peter Wolf (onti) wrote : ProcCpuinfo.txt

apport information

Revision history for this message
Peter Wolf (onti) wrote : ProcInterrupts.txt

apport information

Revision history for this message
Peter Wolf (onti) wrote : ProcModules.txt

apport information

Revision history for this message
Peter Wolf (onti) wrote : UdevDb.txt

apport information

Revision history for this message
Peter Wolf (onti) wrote : UdevLog.txt

apport information

Revision history for this message
Peter Wolf (onti) wrote : UnitySupportTest.txt

apport information

Revision history for this message
Peter Wolf (onti) wrote : XorgLog.txt

apport information

Revision history for this message
Peter Wolf (onti) wrote : XorgLogOld.txt

apport information

Revision history for this message
Peter Wolf (onti) wrote : Xrandr.txt

apport information

Revision history for this message
Peter Wolf (onti) wrote : nvidia-bug-report.log.gz

apport information

Revision history for this message
Peter Wolf (onti) wrote : nvidia-settings.txt

apport information

Revision history for this message
Peter Wolf (onti) wrote : xdpyinfo.txt

apport information

Revision history for this message
Peter Wolf (onti) wrote :

Ok, it worked. I think you should investigate this issue. With Steam coming to Ubuntu this could be a serious problem for users with Nvidia. The games are really unplayable, see the video as example, although the fps are fine, so this could end with bad gaming experience.

Revision history for this message
Daniel van Vugt (vanvugt) wrote :

In theory you can get maximum performance for fullscreen windows if you set "unredirect fullscreen windows" in CCSM. But beware that option is broken right now and requires a workaround before it's safe to use:
https://bugs.launchpad.net/ubuntu/+source/compiz/+bug/980663

Revision history for this message
Peter Wolf (onti) wrote :

No difference. I have tested it with two games, Minecraft and Trine 2, because you can see the frames per second ingame. You can use them too if you have a Nvidia GPU. When I start Trine 2 with Compiz (Unity or Fallback with Compiz), I have ca. 40fps but it feels more like 15-20. When I start the game with the same settings in Gnome-Shell or Fallback with no effects (Mutter and Metacity) I have the same 40fps as with Compiz but the game runs fine, no stuttering.

With more fps there is still stuttering but you can't really see it. I think, when a game runs with for example 60fps you don't really see stuttering although it's not completely smooth, it feels like 30fps (I can observe it with Minecraft sometimes because the frames per second are not stable there). When a game runs with 40fps, like Trine 2, it feels more like 15-20fps as I already mentioned. So the problem might be that games run like with 1/2 of the real fps.

Revision history for this message
Daniel van Vugt (vanvugt) wrote :

By the way, when running compiz you should ignore the frame rates reported by applications because they're not real. Compiz is a compositor which kind of means it virtualizes rendering. To get the real frame rate you're seeing, you should try the Benchmark plugin (from the compiz-plugins-extra package).

Revision history for this message
Peter Wolf (onti) wrote :

FPS shown in the benchmark window is the same as the fps of the games, tested with Minecraft and Trine 2, although the fps of Compiz is limited to 60 (because of VSync). So still a lot of stuttering with the identical fps.

Peter Wolf (onti)
Changed in compiz:
status: Incomplete → New
Changed in compiz (Ubuntu):
status: Incomplete → New
Revision history for this message
Daniel van Vugt (vanvugt) wrote :

Please try the workaround listed here, if not already:
https://bugs.launchpad.net/ubuntu/+source/compiz/+bug/92599

Revision history for this message
Peter Wolf (onti) wrote :

Already tried. I also set refresh rate manually and went through some bugs here looking for workarounds, nothing helped. Can you actually reproduce it?

Revision history for this message
Launchpad Janitor (janitor) wrote :

Status changed to 'Confirmed' because the bug affects multiple users.

Changed in compiz (Ubuntu):
status: New → Confirmed
Revision history for this message
Paulo Narciso (p-narciso) wrote :

I have exactly the same performance problems with a gtx680 running ubuntu 12.04.

Running Trine 2 with vsync on gives me 40 fps and 100 without vsync (enabled on nvidia cp). But even at 100 fps gameplay is stuttery.

Also, a curious observation, when unredirect full screen window is enabled I get 40 fps, but when it's disabled I get constant 60 (stuttery), but I can see ubuntu panels.

A free game that you could test, and see how awful compiz is running, is Alien Arena Reloaded. It doesn't matter how much you tweak in ccsm, you'll get terrible stuttering.

And just to add, till now, nothing has changed between ubuntu 12.04 and 12.10 alpha3. Infact, it's even worse performance, because even moving a window experience stuttering.

Running in gnome classic (no effects), no stutter, no tearing, no performance issues, all is fine.

Revision history for this message
Daniel van Vugt (vanvugt) wrote :

Paulo,

Please test Gnome Classic (with effects, which is compiz). If it is better than in Unity then you actually have bug 988079.

Also, if "100 fps gameplay is stuttery" then it sounds like your actual physical frame rate is much lower than 100. Please using CCSM to enable and configure the Benchmark plugin to get the actual physical frame rate.

Revision history for this message
Peter Wolf (onti) wrote :

I have observed it a little playing Trine 2. I don't think that the games run with low fps, fps are fine as shown in game and in the compiz benchmark. I think compiz skips a lot of frames. Usually when a game runs with low fps the input is a little laggy because it's delayed but in this case the input (mouse and keyboard) works fine. But when you move a character in the game, he just "teleports" a little many times per second and the game looks like it's stuttering. It looks the same as in the video which I posted in the description. You can see the capturing tool skipping the frames and the character teleports...

Daniel, could you reporduce the issue? You can take every game which is demanding and test it. Run a game with 30 fps with compiz and then with Mutter/Metacity.

Revision history for this message
Daniel van Vugt (vanvugt) wrote :

namelezz,

No I cannot reproduce the issue. And I am too busy to test games. I know Metacity renders much faster than Compiz and that's something I hope we'll have time to look at before 12.10.

As per comment #35, please test Gnome Classic (with effects, which is compiz).

Revision history for this message
Peter Wolf (onti) wrote :

I tested it with Gnome Classic as already mentioned in the description, so that's why I set it as a Compiz issue, because I have it there too. And I tested it with Gnome Shell with Mutter, no problems there.

I think the priority should be high on this one because Steam is coming to Ubuntu. And if Ubuntu sucks, many players will go back to Windows to play the games.

Revision history for this message
Daniel van Vugt (vanvugt) wrote :

namelezz,

Sorry, I can't see where you mention Gnome Classic at all. But you can confirm that the same problem exists in Gnome Classic (compiz without unity)?

Could you please log in to Gnome Classic, retest, and run "pidof compiz" to verify compiz is running?

Revision history for this message
Peter Wolf (onti) wrote :

pidof compiz gives 3075 and yes, I can verify it. Gnome Classic = Gnome Fallback, I mentioned it already to exclude Unity3D as the problem. Just take a look at every 3D game you can find which runs with 30-60fps what should be actually smooth. But it's not with Compiz. To compare Compiz with other window managers or compositors you can take Metacity/Mutter.

Revision history for this message
Peter Wolf (onti) wrote :

I have played a little with the settings again and I found the cause. You can get stuttering with activated Vsync in Compiz or with "Force fullscreen redraws on repaint". It's a dilemma. With Vsync on tearing is gone and without the second option Compiz has graphical glitches and stuttering. But both of them cause this ugly stuttering in games. Activating Vsync in the Nvidia settings has no effect on Compiz or games.

Revision history for this message
James Christie (james-aaron-christie) wrote :

I have this issue in a GeForce 460 and a 660M, my experience on both machines matches namelezz *exatly*.

tags: added: nvidia-is-slow
Revision history for this message
Peter Wolf (onti) wrote :

I need to revise my last observation. After some tests I think that deactivating of Vsync or "Force fullscreen redraws on repaint" doesn't help. But I think the stuttering is somehow bound to the refresh rate set in Compiz. I have tested Trine 2 with the following settings...

Gnome-Classic with no effects (Metacity): The game is set up to run with ca. 30 fps and I don't see any stuttering.

Gnome-Classic with Compiz, Vsync and "Force fullscreen redraws on repaint" are deactivated...
Refresh rate = 15: A lot of stuttering although the game is running with the same 30 fps as before. So this means that Compiz is the cause of the problem but not Unity...
Refresh rate = 60: Almost no visible stuttering and still the same 30 fps. The game is playable but a pro gamer with a good eye wouldn't play for example Counter Strike with this kind of stuttering.
Refresh rate = 120: I don't see any stuttering but the game doesn't look right, probably just a subjective thing. Playable for sure.

Unity3D with the same Compiz settings as Gnome-Classic....
Refresh rate = 15: A lot of stuttering, you can also see warping of the character (because of skipping frames?)
Refresh rate = 60: Way less stuttering than with refresh rate set to 15 but surprisingly more than with Gnome-Classic and refresh rate set to 60 there. So Unity is some kind of a factor and makes the stuttering a little worse. The game is not playable in my opinion.
Refresh rate = 120: Less stuttering than before but still clearly visible. I think it's playable for someone who doesn't care about a little stuttering.

So as you can see refresh rate of Compiz is a huge factor. Unity is also a factor. I have provided all the information I could, so... Are there any news on this bug?

Changed in compiz:
status: New → Confirmed
Revision history for this message
James Christie (james-aaron-christie) wrote :

I'd like to again echo namelezz on the refresh rate settings. I think the most annoying is the slight stuttering that can occur at what should be very playable framerates. Nothing new to add, just confirming the same behavior, though I'm down to just my 660m and could not test on the 460.

Revision history for this message
Daniel van Vugt (vanvugt) wrote :

All,

Please remember, if you're using Ubuntu 12.10 or later, and have Compiz 0.9.8.2 or later then the recommended way to get optimal graphics performance in fullscreen games is:
  CCSM > Composite > Unredirect Fullscreen Windows = ON.

But make sure you have compiz 0.9.8.2 or later. Otherwise it will not work very reliably and could cause serious problems.

Unredirect mode is going to improve dramatically again in 0.9.8.4. Later when it is considered stable and reliable, those new features will be backported to compiz 0.9.7 for precise.

Revision history for this message
James Christie (james-aaron-christie) wrote :

I gave 12.10 with the latest compiz available from the updater a try, though I do not know the exact version number. Everything on the system ran very slowly even after installing any version of the nvidia driver package (current/current-updates/current-experimental). I know it's an early beta, but it only performed worse across the board. I'll try again as the beta gets further along in the dev cycle.

Revision history for this message
Daniel van Vugt (vanvugt) wrote :

All,

Compiz 0.9.8.0 - 0.9.8.2 in Ubuntu 12.10 contains a regression of nvidia bug 92599 which will cause slow/stuttering screen redraws. Please look at bug 92599 for a workaround.

Revision history for this message
James Christie (james-aaron-christie) wrote :

Thanks very much for that heads up. I'll try again as soon as I can, but since my laptop with nVidia graphics is also my main work computer it may be awhile before I have another good opportunity to test a full install of 12.10. =(

Revision history for this message
James Christie (james-aaron-christie) wrote :

I just installed the latest daily of the beta, and the problem persists just as before on 12.04. The desktop performance with the latest updates has improved things back to the point of being equal to 12.04.

Revision history for this message
James Christie (james-aaron-christie) wrote :

Unredirect fullscreen windows fixes the issue for fullscreen applications. However, somewhat sluggish desktop performance persists, however I have yet to reproduce uneven screen redraws in windowed games that I can see in the Unigine Heaven demo.

Revision history for this message
James Christie (james-aaron-christie) wrote :

(Apologies for the broken up posts.) The workaround of turning off vsync, detection of refresh rate, and setting the refresh rate of compiz to 120+ no longer has any visible effect.

Revision history for this message
James Christie (james-aaron-christie) wrote :

An odd observation, performance on some minor effects, like window expansion in the alt-tab switcher (where it blows up the icon into the animated window preview) runs very smoothly all the time. Window expo will sometimes be smooth and other time run very poorly; the same applies to the workspace expo effect.

Revision history for this message
Peter Wolf (onti) wrote :

> The workaround of turning off vsync, detection of refresh rate, and setting the refresh rate of compiz to 120+ no longer has any visible effect.

That was't really a workaround, it just reduced the stuttering a little. Probably Compiz has become even worse. A real workaround is to dump Unity and Compiz and use something else. Sad to see it with Steam coming this month...

Revision history for this message
Sam Spilsbury (smspillaz) wrote :

Hi James,

Note that the smoothness here comes from the fact that your GPU is probably upclocking on some of the more intense effects, this will lead to a visible framerate boost.

Revision history for this message
James Christie (james-aaron-christie) wrote :

Games are running *GREAT* at the moment. It's only desktop effects that are the problem. I'm going to keep using 12.10 now since games run even better than on Unity2D in 12.04, but the sluggish desktop effects continue to persist.

Revision history for this message
James Christie (james-aaron-christie) wrote :

Off what Mr. Spilsbury said, I tried setting the nVidia drivers to "prefer maximum performance" and the desktop is 100% silky smooth. When left on the default of adaptive the sluggishness returns. Not sure if that's significant. The only effect that runs smoothly on adaptive is the alt-tab switcher doing the window preview.

Revision history for this message
James Christie (james-aaron-christie) wrote :

Swapping speed settings appears to only work some of the time. When a game is running, the desktop effects become incredibly slugging (5-10fps range), but the game will continue at an uninterrupted framerate.

Revision history for this message
Peter Wolf (onti) wrote :

Allright. I have tested with 12.10 a little. The problem is still there but the games run ways better than in 12.04. With "redirect fullcreen windows" fullscreen games run with no stuttering at all. Without this option there is still stuttering but it's as I said much better, same for games which don't run in fullscreen.

Well, at least the games are playable now although fullscreen mode in Minecraft doens't work in 12.10.

Revision history for this message
Lysenko Denis (pharmasolin) wrote :

Hello, do you tested this in some latest distros? If it is ok now close this bug please due this program https://wiki.ubuntu.com/BigDesktopBugScrub

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.