开发者

Opengl Hardware Accelerator Sleeping After Period of Inactivity

开发者 https://www.devze.com 2023-01-21 04:05 出处:网络
I am working on a Opengl based 2D CAD software which requires heavy us开发者_开发技巧e of hardware OpenGL acceleator (pushing 250 million vertex per second at times). Here is my problem.... whenever t

I am working on a Opengl based 2D CAD software which requires heavy us开发者_开发技巧e of hardware OpenGL acceleator (pushing 250 million vertex per second at times). Here is my problem.... whenever the viewport is stagnant for more than 10 seconds, the Opengl accelerator (Geforce 9800 GT in this case) goes to a inactive mode. When the viewport is being rendered again after the inactive period, I am getting 1/4th the normal framerate and this will last for 3-4 seconds before the 3D accelerator wakes up and kicks into full speed.

Question :

  1. How do I prevent this from happening ?
  2. Is there an Opengl way to prevent GPus from going into inactive mode?

Thank you for your replies.

Gary


There are several ways you can keep a GPU busy but the most sure fire way to guarantee it is doing something and not just deferring your commands is to actually draw something. glClear() and every glDraw* command constitute actual drawing commands. Throw in a glFinish() at the end of the draw to guarantee execution of the gl command stream.

Presumably you don't want to see this drawing so create a new framebuffer object, create a small RGBA texture (say 256 on a side), then attach the texture to color attachment point 0.

When you want to keep the GPU busy draw to this offscreen buffer.

This is all with the assumption that you can't, for instance, just change your boot-args or control panel settings to modulate power management behavior on the card. Every OS has different semantics here.

0

精彩评论

暂无评论...
验证码 换一张
取 消