Hi DRC,

I use VirtualGL / TurboVNC to play multiple instances of the game EVE 
Online through a web interface.  The web interfaces makes it real easy 
to "multi-box".  The backend server (where the games all run) does all 
the heavy lifting and the lightweight client (netbook, laptop, etc) just 
displays the game via the web interface.

The game has several settings related to syncing with the monitor 
refresh rate.  They are 'Interval {immediate,one,two,three,four}'.  
Interval immediate disables "sync to vblank".  Intervals 
one/two/three/four enable "sync to vblank" and run at 1, 1/2, 1/3, and 
1/4 the monitor refresh rate.

When I run the game natively, I get the following performance marks:
  Interval      FPS     CPU
  Immediate     230     100%
  One           60      18%
  Two           30      10%
  Three         20      7-8%
  Four          15      6%


VirtualGL does not support the "sync to vblank" GLX extensions, which 
causes the game to be unable to limit its FPS.  Here are the performance 
marks for the same intervals when running under VirtualGL without my 
patch added.
  Interval      FPS     CPU
  Immediate     36      93%
  One           36      93%
  Two           36      93%
  Three         36      93%
  Four          36      93%

The patch I posted to the mailing list earlier today, allows the user 
to specify what the desired FPS should be.  Here are the performance 
marks for the same intervals when running under VirtualGL with my patch 
added and the fps3d option set to 20.
  Interval      FPS     CPU
  Immediate     20      56%
  One           20      56%
  Two           20      56%
  Three         20      56%
  Four          20      56%

As you can see, the patch has made the first step forward towards 
allowing the user to run the game at a lower FPS and reclaim some of 
that CPU power for other tasks (in my case, more game instances).

Surprise!  In documenting the performance marks tonight, I see my patch 
needs a lot more work before I feel comfortable declaring it optimal.  I 
would have expected to see similar breaks in FPS / CPU that the native 
test shows (obviously there will be some differences due to VirtualGL 
overhead).  Regardless, I was hoping for some feedback.  I guess the 
artist is his own worst critic!



---
Thanks,
Dyweni


On 2013-06-02 20:53, DRC wrote:
> I am still unclear why the normal mechanism of setting VGL_FPS and
> disabling frame spoiling wouldn't work for you. Have you tried that?
> It's not that I'm opposed to this feature, but I also don't want to
> implement something that isn't actually necessary. Please make a case
> for why VGL_3DFPS solves a problem that couldn't be solved by using
> VGL_FPS with frame spoiling disabled.
> 
> On Jun 2, 2013, at 3:58 PM, Dyweni - VirtualGL-Users
> <t7nhgfds7...@dyweni.com> wrote:
> 
>> Hi DRC/All,
>> 
>> I have mucked around with the VirtualGL 2.3.2 code and have come up 
>> with a solution that seems to work well.  I have to mention that the 
>> solution is rather rough around the edges.  Some of the code / ideas 
>> were drawn from Mesa's GLXGEARS program (i.e. calculating and 
>> reporting the current FPS and the location to do so in).
>> 
>> Here is how this works:
>> 1. User provides -fps3d <n> argument to vglrun.  N is any double 0 or 
>> greater.
>> 2. The function 'glXSwapBuffers' (server/faker-glx.cpp) continually 
>> monitors the current fps and adjusts 'delay' to keep the fps around 
>> the requested fps value (the fps3d argument).
>> 3. User can tweak the fps3d value via the vglconfig (CTRL+SHIFT+F9) 
>> GUI utility.
>> 
>> I am sure that the algorithm for adjusting the delay can be improved. 
>> It was what I could come up with in the limited time I had today.
>> 
>> I have attached a patch that applies to VirtualGL 2.3.2.  Please feel 
>> free to review / test and provide feedback.
>> 
>> ---
>> Thanks,
>> Dyweni
>> 
>> 
>> On 2012-07-26 13:41, DRC wrote:
>>> Since VirtualGL redirects the 3D rendering into offscreen buffers, 
>>> there
>>> is no concept of VSync, because there is no monitor involved until 
>>> the
>>> pixels are drawn on the client machine, and by that time, the 3D
>>> rendering is already done.
>>> In the current implementation, there is no way to limit the 3D 
>>> rendering
>>> rate except to disable frame spoiling.  Disabling frame spoiling 
>>> couples
>>> the 3D rendering and compress/send stages of the pipeline, so the 
>>> frame
>>> rate will be the lesser of (a) the VGL_FPS setting or (b) the rate 
>>> at
>>> which the client can process frames.  However, that's probably not 
>>> what
>>> you want, because you may experience "mouse lag" when frame spoiling 
>>> is
>>> disabled.
>>> This issue has never come up, because in visualization apps, the 
>>> frame
>>> rate is ultimately limited by the sampling rate of the mouse, which 
>>> is
>>> generally 40-60 Hz.  I'm honestly not sure what would be the best
>>> approach to applying a frame rate governor on the 3D side (a 
>>> VGL_3DFPS
>>> option, if you will.)  It might be as simple as putting a delay into 
>>> the
>>> buffer swap function.
>>> What I'm wondering, however, is whether our long-term plans to 
>>> replace
>>> Pbuffers with FBO's and hidden windows might magically fix this, 
>>> since
>>> VSync might still work when rendering to a hidden window.
>>> If anyone else has further insight, please share.
>>> On 7/26/12 12:56 PM, Dyweni - VirtualGL-Users wrote:
>>>> Hi All,
>>>> I'm wondering if VirgualGL has support for VSync?  I know that 
>>>> VirtualGL
>>>> has support to output only x frames per second, but that is 
>>>> different
>>>> from VSync.
>>>> I have a game (EVE Online) that can limit itself to the VSync.  In
>>>> normal X, it limits itself to 60 FPS (my monitor refresh rate) 
>>>> thanks to
>>>> VSync, and that keeps the CPU usage low.  However, when running on
>>>> VirtualGL, it does not limit its FPS and they skyrocket to 120+ FPS
>>>> which drives the CPU usage high.
>>>> I would like to be able to lock the game to the VSync (say 60 FPS, 
>>>> to
>>>> keep the CPU usage low) and then export x frames per second (as I 
>>>> do
>>>> know with the -fps) switch.
>>>> Is this possible?
>>>> --
>>>> Thanks,
>>>> Dyweni
>>>> ------------------------------------------------------------------------------
>>>> Live Security Virtual Conference
>>>> Exclusive live event will cover all the ways today's security and
>>>> threat landscape has changed and how IT managers can respond. 
>>>> Discussions
>>>> will include endpoint security, mobile security and the latest in 
>>>> malware
>>>> threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
>>>> _______________________________________________
>>>> VirtualGL-Users mailing list
>>>> VirtualGL-Users@lists.sourceforge.net
>>>> https://lists.sourceforge.net/lists/listinfo/virtualgl-users
>>> ------------------------------------------------------------------------------
>>> Live Security Virtual Conference
>>> Exclusive live event will cover all the ways today's security and
>>> threat landscape has changed and how IT managers can respond. 
>>> Discussions
>>> will include endpoint security, mobile security and the latest in 
>>> malware
>>> threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
>>> _______________________________________________
>>> VirtualGL-Users mailing list
>>> VirtualGL-Users@lists.sourceforge.net
>>> https://lists.sourceforge.net/lists/listinfo/virtualgl-users
>> <0001-Support-limiting-3D-application-framerate-into-Virtu.patch>
>> ------------------------------------------------------------------------------
>> Get 100% visibility into Java/.NET code with AppDynamics Lite
>> It's a free troubleshooting tool designed for production
>> Get down to code-level detail for bottlenecks, with <2% overhead.
>> Download for free and get started troubleshooting in minutes.
>> http://p.sf.net/sfu/appdyn_d2d_ap2
>> _______________________________________________
>> VirtualGL-Users mailing list
>> VirtualGL-Users@lists.sourceforge.net
>> https://lists.sourceforge.net/lists/listinfo/virtualgl-users
> 
> ------------------------------------------------------------------------------
> Get 100% visibility into Java/.NET code with AppDynamics Lite
> It's a free troubleshooting tool designed for production
> Get down to code-level detail for bottlenecks, with <2% overhead.
> Download for free and get started troubleshooting in minutes.
> http://p.sf.net/sfu/appdyn_d2d_ap2
> _______________________________________________
> VirtualGL-Users mailing list
> VirtualGL-Users@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/virtualgl-users

------------------------------------------------------------------------------
Get 100% visibility into Java/.NET code with AppDynamics Lite
It's a free troubleshooting tool designed for production
Get down to code-level detail for bottlenecks, with <2% overhead.
Download for free and get started troubleshooting in minutes.
http://p.sf.net/sfu/appdyn_d2d_ap2
_______________________________________________
VirtualGL-Users mailing list
VirtualGL-Users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/virtualgl-users

Reply via email to