freezing with an nvidia card

40 views
Skip to first unread message

Gabriele Lanaro

unread,
Nov 6, 2012, 5:49:49 PM11/6/12
to pyglet...@googlegroups.com
If I run a test code like the following I experience a window freeze (the close button not working anymore). The application displays the current fps for some time and if I, for example, click on the window I experience a freeze.

- The problem is reproduced also on a larger scale with a complex application (ie this is not related to the fps display thing).
- The problem seems to be solved (there is a performance drop) if at the end of the on_draw method I put a pyglet.gl.glFinish() call or, I schedule some call that sleeps for some time.
- It happens only on a system (Ubuntu) with a [GeForce GTX 550 Ti] (rev a1), using the nvidia driver version 304.51

Am I doing something wrong? This is a known bug?

--------------------
import pyglet

w = pyglet.window.Window()
ds = pyglet.clock.ClockDisplay()
@w.event
def on_draw():
    w.clear()
    ds.draw()
   
pyglet.app.run()
--------------------

Richard Jones

unread,
Nov 6, 2012, 7:03:17 PM11/6/12
to pyglet...@googlegroups.com
On 7 November 2012 09:49, Gabriele Lanaro <gabriel...@gmail.com> wrote:
> If I run a test code like the following I experience a window freeze (the
> close button not working anymore). The application displays the current fps
> for some time and if I, for example, click on the window I experience a
> freeze.
>
> - The problem is reproduced also on a larger scale with a complex
> application (ie this is not related to the fps display thing).
> - The problem seems to be solved (there is a performance drop) if at the end
> of the on_draw method I put a pyglet.gl.glFinish() call or, I schedule some
> call that sleeps for some time.
> - It happens only on a system (Ubuntu) with a [GeForce GTX 550 Ti] (rev a1),
> using the nvidia driver version 304.51
>
> Am I doing something wrong?

I don't believe so. Either pyglet's doing something wrong or the
driver is doing something wrong and it'd be nice if pyglet could be
more robust in the face of that.


> This is a known bug?

I think we can classify this as a "previously-unknown" bug :-)


> import pyglet
>
> w = pyglet.window.Window()
> ds = pyglet.clock.ClockDisplay()
> @w.event
> def on_draw():
> w.clear()
> ds.draw()
>
> pyglet.app.run()

That's a great, concise example of bad behaviour (it works fine on my
Mac.) It'd be great if we could nail down exactly what the problem is.
Even if it is indeed a missing glFinish - though whether that should
be included in the standard pyglet app run loop is probably
contentious.


Richard

Gabriele Lanaro

unread,
Nov 6, 2012, 8:35:51 PM11/6/12
to pyglet...@googlegroups.com
Thank you very much for your answer, I'm currently gathering more information about this bug, even if it's quite difficult to nail down. What I suspect is that the application issue too much commands in a really short time filling the "command buffer" of the GPU. I can workaround the freezing thing by:

disabling double_buffering
disabling vsync
scheduling a slow function
using the glFinish function (glFlush does NOT work)

I'm not sure if this is pyglet-specific, other opengl applications seem to work (but I'm not sure that they're updating so fast as I am, I've tried glxgears and Avogadro, a molecular editor).



--
You received this message because you are subscribed to the Google Groups "pyglet-users" group.
To post to this group, send email to pyglet...@googlegroups.com.
To unsubscribe from this group, send email to pyglet-users...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/pyglet-users?hl=en.


Richard Jones

unread,
Nov 6, 2012, 8:48:38 PM11/6/12
to pyglet...@googlegroups.com
It's actually a little worrying that it's updating so frequently. In
the absence of any other program timed activity (eg. scheduled
updates) or events (mouse moves, etc.) the update frequency should be
very low.


Richard
Reply all
Reply to author
Forward
0 new messages