Gloss freezes on OSX 10.8.3

96 views
Skip to first unread message

Simon Voordouw

unread,
Apr 30, 2013, 7:29:25 PM4/30/13
to haskel...@googlegroups.com
Gloss (1.7.8.2) freezes after rendering a few frames on my MBP. On my desktop machine (Arch linux) it seems to work fine. I tried both my application and gloss-examples. Anyone got an idea what might cause this or instructions on how to find it?

Ben Lippmeier

unread,
Apr 30, 2013, 8:46:25 PM4/30/13
to haskel...@googlegroups.com, Simon Voordouw

On 01/05/2013, at 9:29 AM, Simon Voordouw wrote:

> Gloss (1.7.8.2) freezes after rendering a few frames on my MBP. On my desktop machine (Arch linux) it seems to work fine. I tried both my application and gloss-examples. Anyone got an idea what might cause this or instructions on how to find it?

I've had another report of this happening on a recent Retina mac, but other people have used the same hardware / OS and it's been fine. I don't know what causes it. I haven't reproduced the problem myself.

Is it a Retina macbook? If so, what version of OSX?

Does it happen with static pictures as well as animations? You can check this by running gloss-hello and resizing the window to make sure the picture redraws properly

It it works with static pictures but not animations you could try commenting out the following lines in Graphics.Gloss.Internals.Interface.Animate.Timing. This code does the frame rate limiting, and might be getting confused for some reason.

71 when (gateTimeElapsed < timeClamp)
72 $ do sleep backendRef (timeClamp - gateTimeElapsed)


You could also try upgrading your copy of freeglut.

Please let us know if you can work out what causes this, and I'll fix it or add an entry to the FAQ.

Thanks,
Ben.



Ben Lippmeier

unread,
Apr 30, 2013, 9:07:54 PM4/30/13
to Simon Voordouw, haskel...@googlegroups.com

On 01/05/2013, at 10:46 AM, Ben Lippmeier wrote:

>
> On 01/05/2013, at 9:29 AM, Simon Voordouw wrote:
>
>> Gloss (1.7.8.2) freezes after rendering a few frames on my MBP. On my desktop machine (Arch linux) it seems to work fine. I tried both my application and gloss-examples. Anyone got an idea what might cause this or instructions on how to find it?
>
> I've had another report of this happening on a recent Retina mac, but other people have used the same hardware / OS and it's been fine. I don't know what causes it. I haven't reproduced the problem myself.

> If so, what version of OSX?

Sorry, I see the subject said OSX 10.8.3. I tested it on my Mac Air with 10.8.3 and it works fine. This is gloss built with GHC 7.6.2.

What version of GHC are you using?

Ben.


Simon Voordouw

unread,
Apr 30, 2013, 9:13:00 PM4/30/13
to haskel...@googlegroups.com, Simon Voordouw
 I'm using GHC 7.6.1. I just tried your suggestions, and they don't seem to work. I upgraded freeglut and GLFW with homebrew, but that doesn't seem to make a difference. My macbook is retina yes.

Ben Lippmeier

unread,
Apr 30, 2013, 9:29:22 PM4/30/13
to Simon Voordouw, haskel...@googlegroups.com

On 01/05/2013, at 11:13 AM, Simon Voordouw wrote:

> I'm using GHC 7.6.1. I just tried your suggestions, and they don't seem to work. I upgraded freeglut and GLFW with homebrew, but that doesn't seem to make a difference. My macbook is retina yes.

Gloss is built to use GLUT by default, and doesn't run GLFW unless you rebuild it. You could try rebuilding to use GLFW:

ghc-pkg unregister gloss
cabal install gloss --flags="GLFW -GLUT"
cabal install gloss-examples

Then run something like gloss-zen and use the "About" menu to ensure it's not still using GLUT.

Ben.

Simon Voordouw

unread,
Apr 30, 2013, 10:00:43 PM4/30/13
to haskel...@googlegroups.com, Simon Voordouw
Compiling with GLFW and deleting line 71-72 seems to have solved the problem. Thanks for your help 

Simon Voordouw

unread,
May 1, 2013, 3:56:36 PM5/1/13
to haskel...@googlegroups.com, Simon Voordouw
The problem appeared again, so i figured it must be something different. I tried switching off dynamic gpu switching (forcing discrete) and now it works smoothly. I think what's happening is that gloss freezes when the graphics switches from integrated to discrete. I can successfully reproduce this by manually switching while gloss is running.

Ben Lippmeier

unread,
May 3, 2013, 2:15:09 AM5/3/13
to haskel...@googlegroups.com, Simon Voordouw

On 02/05/2013, at 5:56 AM, Simon Voordouw wrote:

> The problem appeared again, so i figured it must be something different. I tried switching off dynamic gpu switching (forcing discrete) and now it works smoothly. I think what's happening is that gloss freezes when the graphics switches from integrated to discrete. I can successfully reproduce this by manually switching while gloss is running.

Thanks, this also solved the other reported instance of the problem. I've updated the FAQ on the gloss wiki.

Ben.


Qing Xu

unread,
Mar 22, 2014, 7:49:30 AM3/22/14
to haskel...@googlegroups.com, Simon Voordouw
Hi Simon,
Can you tell me how to switch off the dynamic gpu?

Thx

Ben Lippmeier

unread,
Mar 22, 2014, 7:59:28 AM3/22/14
to haskel...@googlegroups.com, Qing Xu, Simon Voordouw

On 22 Mar 2014, at 22:49 , Qing Xu <nflsc...@gmail.com> wrote:

> Hi Simon,
> Can you tell me how to switch off the dynamic gpu?
>

Disable "Automatic GPU Switching" in System Preferences / Energy Saver.

It's in the FAQ at http://gloss.ouroborus.net

Ben.

Reply all
Reply to author
Forward
0 new messages