Re: [osg-users] OSG CPU Utilization
Hi all, I've just received some comments from the NVIDIA driver team. If we didn't CPU spin in the driver and instead use the OS-provided waitforvblank function, when you drive OpenGL from two threads, you get an awful stutter performance because one thread is inside the OS blocking the other one from progressing until the vblank happens. Also note that this CPU consumption by the driver is very artificial and you will only notice on apps that do very little work per frame. It's not like we are hogging the CPU, we do yield to other threads in that spin loop. Bottom line: the CPU will only get used if it's idle. Can anyone proficient regarding drivers/threading provide some feedback on this? I'm not quite sure why a micro-sleep wouldn't work instead of a spinlock. Thanks everyone. Regards, Kim. From: k.che...@live.com To: osg-users@lists.openscenegraph.org Date: Mon, 21 Sep 2009 00:49:01 -0400 Subject: Re: [osg-users] OSG CPU Utilization Hi J-S, Thanks. I've just sent them an email now. Regards, Kim. Date: Sun, 20 Sep 2009 19:51:33 -0400 From: jean-sebastien.g...@cm-labs.com To: osg-users@lists.openscenegraph.org Subject: Re: [osg-users] OSG CPU Utilization Hi Kim, What does everyone suggest the way for me to make progress the fastest would be? I'm assuming I will have to send them the system specs of the systems that are affected, and the minimum set of files that is required to reproduce the bug, along with some other miscellaneous information. I've had good results e-mailing devsupp...@nvidia.com with an example that reproduces the problem (binary executable, data files, and with the least amount of steps necessary on their part to see the problem). I've reported two bugs this way and each time it took about a week to get a first response and then it went quickly from there, getting responses generally the day after I answered their questions, until they confirmed the bug was fixed in the next driver (and I could confirm it too). Hope this helps, J-S -- __ Jean-Sebastien Guayjean-sebastien.g...@cm-labs.com http://www.cm-labs.com/ http://whitestar02.webhop.org/ ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org Microsoft brings you a new way to search the web. Try Bing™ now _ Your E-mail and More On-the-Go. Get Windows Live Hotmail Free. http://clk.atdmt.com/GBL/go/171222985/direct/01/___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] OSG CPU Utilization
Hi all, I did not have time to test the performance on Ubuntu on my machine, but I spent some time debugging/profiling and I can confirm that this is an NVIDIA vsync spinlock. I think the name of the thread was named OpenThreads::StartPrivateAction::StartThread only because that was the function that started the thread, and had nothing to do with the functions that were using it. I ran AMD's CodeAnalyst and found that nvlddmkm.sys was using roughly 75x more of the amount of CPU clocks than it was when I had ran it with --run-max-frame-rate 50.0. This shows that it is indeed a bug in the NVIDIA drivers. I now would hopefully like to get this resolved in a future driver revision, but I'm not sure what the best way would be to contact NVIDIA to get this resolved as soon as possible. What does everyone suggest the way for me to make progress the fastest would be? I'm assuming I will have to send them the system specs of the systems that are affected, and the minimum set of files that is required to reproduce the bug, along with some other miscellaneous information. Regards, Kim. From: k.che...@live.com To: osg-users@lists.openscenegraph.org Date: Fri, 18 Sep 2009 04:22:12 -0400 Subject: Re: [osg-users] OSG CPU Utilization Hi J.P., Yes, it happens with all threading models, the only difference being that on the SingleThreaded model, the CPU consumption is used by the main thread instead. To all, Out of about eight different machines with varying OS's/hardware I've only found two that were affected so far. The only major things that were in common between these two machines were the OS's (Windows XP Professional 32-bit SP3), and Windows Vista Ultimate 64-bit, SP2), and the GPU manufacturer, NVIDIA. The two cards were an 9600 GT and a 7950 GT (both listed in order respective to the OS's that were listed), with the most recent drivers (190.62). Some of the machines that the problem was not seen on include the following: Windows 7 RTM 64-bit, ATI HD 4850 Windows Vista 32-bit, ATI X1250 (integrated) Windows XP Home (32-bit), NVIDIA 9600 GT Windows XP Professional 32-bit, NVIDIA 8800 GTX I have confirmed that vsync was on before the tests were done on all of these machines. I did confirm that this is indeed unnecessary CPU utilization as on both of the affected machines, I've tried disabling vsync and running osgViewer with osgviewer --run-max-frame-rate 60.0 cow.osg and the CPU utilization never exceeded ~2% on both systems no matter if the window was fullscreen or windowed, focused or unfocused. There may be a third system that is also affected (Windows Vista 32-bit SP2, 8800 GTX), but I have yet to confirm if vsync was enabled or not, and if disabling vsync and performing the steps above resolves the problem or not. I may be able to test it out on Ubuntu on my machine tomorrow. Thank you for all of the support. Regards, Kim. Date: Fri, 18 Sep 2009 08:11:07 +0200 From: jpdelp...@csir.co.za To: osg-users@lists.openscenegraph.org Subject: Re: [osg-users] OSG CPU Utilization Hi Kim, Kim Cheung wrote: Hi all, I really appreciate all of the feedback. Chris: Yes, I tested osgviewer.exe in release-mode with the cow.osg model, and the problem is always reproducible. Does it happen with all threading modes for OSG? jp -- This message is subject to the CSIR's copyright terms and conditions, e-mail legal notice, and implemented Open Document Format (ODF) standard. The full disclaimer details can be found at http://www.csir.co.za/disclaimer.html. This message has been scanned for viruses and dangerous content by MailScanner, and is believed to be clean. MailScanner thanks Transtec Computers for their support. ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org Hotmail® has ever-growing storage! Don’t worry about storage limits. Check it out. _ Microsoft brings you a new way to search the web. Try Bing™ now http://www.bing.com?form=MFEHPGpubl=WLHMTAGcrea=TEXT_MFEHPG_Core_tagline_try bing_1x1___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] OSG CPU Utilization
Hi Kim, What does everyone suggest the way for me to make progress the fastest would be? I'm assuming I will have to send them the system specs of the systems that are affected, and the minimum set of files that is required to reproduce the bug, along with some other miscellaneous information. I've had good results e-mailing devsupp...@nvidia.com with an example that reproduces the problem (binary executable, data files, and with the least amount of steps necessary on their part to see the problem). I've reported two bugs this way and each time it took about a week to get a first response and then it went quickly from there, getting responses generally the day after I answered their questions, until they confirmed the bug was fixed in the next driver (and I could confirm it too). Hope this helps, J-S -- __ Jean-Sebastien Guayjean-sebastien.g...@cm-labs.com http://www.cm-labs.com/ http://whitestar02.webhop.org/ ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] OSG CPU Utilization
Hi J-S, Thanks. I've just sent them an email now. Regards, Kim. Date: Sun, 20 Sep 2009 19:51:33 -0400 From: jean-sebastien.g...@cm-labs.com To: osg-users@lists.openscenegraph.org Subject: Re: [osg-users] OSG CPU Utilization Hi Kim, What does everyone suggest the way for me to make progress the fastest would be? I'm assuming I will have to send them the system specs of the systems that are affected, and the minimum set of files that is required to reproduce the bug, along with some other miscellaneous information. I've had good results e-mailing devsupp...@nvidia.com with an example that reproduces the problem (binary executable, data files, and with the least amount of steps necessary on their part to see the problem). I've reported two bugs this way and each time it took about a week to get a first response and then it went quickly from there, getting responses generally the day after I answered their questions, until they confirmed the bug was fixed in the next driver (and I could confirm it too). Hope this helps, J-S -- __ Jean-Sebastien Guayjean-sebastien.g...@cm-labs.com http://www.cm-labs.com/ http://whitestar02.webhop.org/ ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org _ Microsoft brings you a new way to search the web. Try Bing™ now http://www.bing.com?form=MFEHPGpubl=WLHMTAGcrea=TEXT_MFEHPG_Core_tagline_try bing_1x1___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] OSG CPU Utilization
Hi Kim, Kim Cheung wrote: Hi all, I really appreciate all of the feedback. Chris: Yes, I tested osgviewer.exe in release-mode with the cow.osg model, and the problem is always reproducible. Does it happen with all threading modes for OSG? jp -- This message is subject to the CSIR's copyright terms and conditions, e-mail legal notice, and implemented Open Document Format (ODF) standard. The full disclaimer details can be found at http://www.csir.co.za/disclaimer.html. This message has been scanned for viruses and dangerous content by MailScanner, and is believed to be clean. MailScanner thanks Transtec Computers for their support. ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] OSG CPU Utilization
Hi J.P., Yes, it happens with all threading models, the only difference being that on the SingleThreaded model, the CPU consumption is used by the main thread instead. To all, Out of about eight different machines with varying OS's/hardware I've only found two that were affected so far. The only major things that were in common between these two machines were the OS's (Windows XP Professional 32-bit SP3), and Windows Vista Ultimate 64-bit, SP2), and the GPU manufacturer, NVIDIA. The two cards were an 9600 GT and a 7950 GT (both listed in order respective to the OS's that were listed), with the most recent drivers (190.62). Some of the machines that the problem was not seen on include the following: Windows 7 RTM 64-bit, ATI HD 4850 Windows Vista 32-bit, ATI X1250 (integrated) Windows XP Home (32-bit), NVIDIA 9600 GT Windows XP Professional 32-bit, NVIDIA 8800 GTX I have confirmed that vsync was on before the tests were done on all of these machines. I did confirm that this is indeed unnecessary CPU utilization as on both of the affected machines, I've tried disabling vsync and running osgViewer with osgviewer --run-max-frame-rate 60.0 cow.osg and the CPU utilization never exceeded ~2% on both systems no matter if the window was fullscreen or windowed, focused or unfocused. There may be a third system that is also affected (Windows Vista 32-bit SP2, 8800 GTX), but I have yet to confirm if vsync was enabled or not, and if disabling vsync and performing the steps above resolves the problem or not. I may be able to test it out on Ubuntu on my machine tomorrow. Thank you for all of the support. Regards, Kim. Date: Fri, 18 Sep 2009 08:11:07 +0200 From: jpdelp...@csir.co.za To: osg-users@lists.openscenegraph.org Subject: Re: [osg-users] OSG CPU Utilization Hi Kim, Kim Cheung wrote: Hi all, I really appreciate all of the feedback. Chris: Yes, I tested osgviewer.exe in release-mode with the cow.osg model, and the problem is always reproducible. Does it happen with all threading modes for OSG? jp -- This message is subject to the CSIR's copyright terms and conditions, e-mail legal notice, and implemented Open Document Format (ODF) standard. The full disclaimer details can be found at http://www.csir.co.za/disclaimer.html. This message has been scanned for viruses and dangerous content by MailScanner, and is believed to be clean. MailScanner thanks Transtec Computers for their support. ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org _ Hotmail® has ever-growing storage! Don’t worry about storage limits. http://windowslive.com/Tutorial/Hotmail/Storage?ocid=TXT_TAGLM_WL_HM_Tutorial_Storage_062009___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] OSG CPU Utilization
Hi Kim, On 17/09/09 7:08 AM, Kim Cheung wrote: Hello all, I've been seeing a problem with high CPU utilization when using OSG. In my tests, I run osgViewer, and it seems to use most of core 1 on my dual-core machine, while core 0 is basically idle, in the DrawThreadPerContext threading model. I do have vsync enabled. The thing I find most interesting is that this unusually-high CPU utilization only occurs when I the window does not have focus when in fullscreen mode. So far, any other window usage will trigger this high CPU utilization. There were some previous topics regarding this issue, and I do believe it may be a busy-wait as Jean-Sebastian pointed out, however this CPU usage does affect performance when other programs need the clocks. Is this with an ATI graphics card? Cheers, /ulrich ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] OSG CPU Utilization
Hi Ulrich, Sorry about the lack of system specs. I'm actually using an NVIDIA 7950 GT with the latest drivers. Some other system specs: AMD FX-62 Dual-Core Vista 64-bit If it matters any, I'm using the SVN build of OSG. Thanks for the help. Regards, Kim. Date: Thu, 17 Sep 2009 09:45:13 +0200 From: u.hertl...@sandbox.de To: osg-users@lists.openscenegraph.org Subject: Re: [osg-users] OSG CPU Utilization Hi Kim, On 17/09/09 7:08 AM, Kim Cheung wrote: Hello all, I've been seeing a problem with high CPU utilization when using OSG. In my tests, I run osgViewer, and it seems to use most of core 1 on my dual-core machine, while core 0 is basically idle, in the DrawThreadPerContext threading model. I do have vsync enabled. The thing I find most interesting is that this unusually-high CPU utilization only occurs when I the window does not have focus when in fullscreen mode. So far, any other window usage will trigger this high CPU utilization. There were some previous topics regarding this issue, and I do believe it may be a busy-wait as Jean-Sebastian pointed out, however this CPU usage does affect performance when other programs need the clocks. Is this with an ATI graphics card? Cheers, /ulrich ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org _ Ready for Fall shows? Use Bing to find helpful ratings and reviews on digital tv's. http://www.bing.com/shopping/search?q=digital+tv'sform=MSHNCBpubl=WLHMTAGcrea=TEXT_MSHNCB_Vertical_Shopping_DigitalTVs_1x1___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] OSG CPU Utilization
Hi Kim, The high CPU utilization in this case clearly isn't the OSG, but the drivers/OS. Try a different OS/drivers. Also once you home in what combination causes the high CPU utilization go pester NVidia about there driver doing a spinlock. Robert. On Thu, Sep 17, 2009 at 6:08 AM, Kim Cheung k.che...@live.com wrote: Some scene graph stats: Framerate: Solid 60 FPS (due to vsync) Event: 0.14 Update: 0.02 Cull: 0.06 Draw: 0.29 GPU: 0.40 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] OSG CPU Utilization
Robert Osfield wrote: Try a different OS/drivers. Also once you home in what combination causes the high CPU utilization go pester NVidia about there driver doing a spinlock. Agreed, it appears this way. Though, I've not seen NVidia Windows drivers spinlock before. Is the problem reproducible with plain release-mode osgviewer with the cow.osg model? If it is, then it's something that you can send to NVidia with all pieces necessary for reproducing it at their site. Robert. -- Chris 'Xenon' Hanson, omo sanza lettere Xenon AlphaPixel.com PixelSense Landsat processing now available! http://www.alphapixel.com/demos/ There is no Truth. There is only Perception. To Perceive is to Exist. - Xen ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] OSG CPU Utilization
Recently I noticed something that might be related as well. The draw stage of my application seems to be blocking on vsync signal, rather than the swap buffers stage. It happens on Windows XP boxes with NVidia cards, regardless if it is the older GeForce 8000 and 9000 series cards or the newer 200 and 300 series. I noticed that after I upgraded the video driver to the 190.62 version from August, but it may have happened before that. One caviar is that my application is based on an older version of OSG from 2006 that still uses Producer. Another thing is the set up has two monitors of different specs configured as dual view, and a render context is created for each monitor. I don't know if the latest version of OSG will be any different. Very interestingly, the same exact executable runs fine on Windows 7 boxes, with vsync blocking taking place during swap buffers as supposed to be. Our current solution to the unsavory vsync blocking behavior on Win XP boxes is to turn vsync off and use some Direct-X function call that checks for display scan lines to mitigate tearing. It only avoids tearing on one display, though. Cheers, Yefei -Original Message- From: osg-users-boun...@lists.openscenegraph.org [mailto:osg-users-boun...@lists.openscenegraph.org] On Behalf Of Chris 'Xenon' Hanson Sent: Thursday, September 17, 2009 10:49 AM To: OpenSceneGraph Users Subject: Re: [osg-users] OSG CPU Utilization Robert Osfield wrote: Try a different OS/drivers. Also once you home in what combination causes the high CPU utilization go pester NVidia about there driver doing a spinlock. Agreed, it appears this way. Though, I've not seen NVidia Windows drivers spinlock before. Is the problem reproducible with plain release-mode osgviewer with the cow.osg model? If it is, then it's something that you can send to NVidia with all pieces necessary for reproducing it at their site. Robert. ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] OSG CPU Utilization
Hi all, I really appreciate all of the feedback. Chris: Yes, I tested osgviewer.exe in release-mode with the cow.osg model, and the problem is always reproducible. It seems the spinlock is occurring somewhere in the OpenThreads::StartPrivateAction::StartThread thread, if that helps at all. I will be doing some testing on some other systems, as Robert suggests, to see if the problem is persistent on other systems. So far, a Windows XP SP3 box with an 8800 GTX also seems to be suffering from the high CPU utilization. Regards, Kim. From: yefei...@uiowa.edu To: osg-users@lists.openscenegraph.org Date: Thu, 17 Sep 2009 11:51:01 -0500 Subject: Re: [osg-users] OSG CPU Utilization Recently I noticed something that might be related as well. The draw stage of my application seems to be blocking on vsync signal, rather than the swap buffers stage. It happens on Windows XP boxes with NVidia cards, regardless if it is the older GeForce 8000 and 9000 series cards or the newer 200 and 300 series. I noticed that after I upgraded the video driver to the 190.62 version from August, but it may have happened before that. One caviar is that my application is based on an older version of OSG from 2006 that still uses Producer. Another thing is the set up has two monitors of different specs configured as dual view, and a render context is created for each monitor. I don't know if the latest version of OSG will be any different. Very interestingly, the same exact executable runs fine on Windows 7 boxes, with vsync blocking taking place during swap buffers as supposed to be. Our current solution to the unsavory vsync blocking behavior on Win XP boxes is to turn vsync off and use some Direct-X function call that checks for display scan lines to mitigate tearing. It only avoids tearing on one display, though. Cheers, Yefei -Original Message- From: osg-users-boun...@lists.openscenegraph.org [mailto:osg-users-boun...@lists.openscenegraph.org] On Behalf Of Chris 'Xenon' Hanson Sent: Thursday, September 17, 2009 10:49 AM To: OpenSceneGraph Users Subject: Re: [osg-users] OSG CPU Utilization Robert Osfield wrote: Try a different OS/drivers. Also once you home in what combination causes the high CPU utilization go pester NVidia about there driver doing a spinlock. Agreed, it appears this way. Though, I've not seen NVidia Windows drivers spinlock before. Is the problem reproducible with plain release-mode osgviewer with the cow.osg model? If it is, then it's something that you can send to NVidia with all pieces necessary for reproducing it at their site. Robert. ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org _ Microsoft brings you a new way to search the web. Try Bing™ now http://www.bing.com?form=MFEHPGpubl=WLHMTAGcrea=TEXT_MFEHPG_Core_tagline_try bing_1x1___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] OSG CPU Utilization
Kim Cheung wrote: Yes, I tested osgviewer.exe in release-mode with the cow.osg model, and the problem is always reproducible. Ok, that's good. It seems the spinlock is occurring somewhere in the OpenThreads::StartPrivateAction::StartThread thread, if that helps at all. Hmm. That wouldn't sound like a driver vsync spinlock, though I'm not an expert. Anyone with more knowledge of this care to comment? Regards, Kim. -- Chris 'Xenon' Hanson, omo sanza lettere Xenon AlphaPixel.com PixelSense Landsat processing now available! http://www.alphapixel.com/demos/ There is no Truth. There is only Perception. To Perceive is to Exist. - Xen ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org