Re: [osg-users] Load balancing on multiple cores
One suggestion that I will offer: build your code in release mode, but do not optimize. Under MSVC, use the following flags: /MD /Zi /Od /Ob0 /RTC1 /D NDEBUG You can add the following CMAKE Option to OSGs CMakeLists.txt to add this type of build as an MSVC option in the configuration manager: set(CMAKE_CONFIGURATION_TYPES Debug;RelWithDebInfo;Development;DevelopmentNoOpt CACHE STRING FORCE) set(CMAKE_CXX_FLAGS_DEVELOPMENT /MD /Zi /O2 /Ob1 /D NDEBUG CACHE STRING CMAKE_CXX_FLAGS_DEVELOPMENT FORCE) set(CMAKE_SHARED_LINKER_FLAGS_DEVELOPMENT /debug /INCREMENTAL:YES CACHE STRING CMAKE_SHARED_LINKER_FLAGS_DEVELOPMENT FORCE) set(CMAKE_CXX_FLAGS_DEVELOPMENTNOOPT /MD /Zi /Od /Ob0 /RTC1 /D NDEBUG CACHE STRING CMAKE_CXX_FLAGS_DEVELOPMENTNOOPT FORCE) set(CMAKE_SHARED_LINKER_FLAGS_DEVELOPMENTNOOPT /debug /INCREMENTAL:YES CACHE STRING CMAKE_SHARED_LINKER_FLAGS_DEVELOPMENTNOOPT FORCE) sean _ Sean Spicer Executive Vice President Chief Technology Officer Aqumin (www.aqumin.com) Office+1.713.781.2121 Mobile...+1.713.447.2706 Fax...+1.713.781.2123 On Fri, Mar 19, 2010 at 1:12 AM, J.P. Delport jpdelp...@csir.co.za wrote: Hi Jesse, Jesse Stimpson wrote: I feel that we're diverging from what I think is most perplexing about what I'm seeing. When I restrict the process to use less cores, I get increased rendering performance. This is what leads me to believe there are some load-balancing issues. yes, and it would be difficult to see what causes it. Is it OSG, the OpenGL driver or your OS? Unfortunately there is no magic way to get the balance right on all hardware combos. You'll just have to experiment and use what works best in your situation. Also, if I have the OSG process set to both cores and I run another single-threaded process in the background, the other process gets assigned to one core, and OSG rendering speeds up, presumably because it is being processed mainly on a single core. you might find this interesting: http://igoro.com/archive/gallery-of-processor-cache-effects/ I've been playing with the OSG threading models as well. In debug, SingleThreaded mode seems to run the best on my machine. Is there documentation on the implications of the threading models? Not explicitly that I know of. A search in the archives for the long names should get you some discussions. If I understand correctly, SingleThreaded means only the rendering is single threaded, and the database pager is still a separate thread. Is this right? Are reasons we shouldn't consider using SingleThreaded mode? No, use whatever works best for you. We are using SingleThreaded for some of our apps, because they are just a small part of a larger application and we can't use all the resources in the machine for rendering. See also this: http://thread.gmane.org/gmane.comp.graphics.openscenegraph.user/52734 rgds jp Thanks, Jesse ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org -- 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 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] Load balancing on multiple cores
Hi Jesse, Jesse Stimpson wrote: I feel that we're diverging from what I think is most perplexing about what I'm seeing. When I restrict the process to use less cores, I get increased rendering performance. This is what leads me to believe there are some load-balancing issues. yes, and it would be difficult to see what causes it. Is it OSG, the OpenGL driver or your OS? Unfortunately there is no magic way to get the balance right on all hardware combos. You'll just have to experiment and use what works best in your situation. Also, if I have the OSG process set to both cores and I run another single-threaded process in the background, the other process gets assigned to one core, and OSG rendering speeds up, presumably because it is being processed mainly on a single core. you might find this interesting: http://igoro.com/archive/gallery-of-processor-cache-effects/ I've been playing with the OSG threading models as well. In debug, SingleThreaded mode seems to run the best on my machine. Is there documentation on the implications of the threading models? Not explicitly that I know of. A search in the archives for the long names should get you some discussions. If I understand correctly, SingleThreaded means only the rendering is single threaded, and the database pager is still a separate thread. Is this right? Are reasons we shouldn't consider using SingleThreaded mode? No, use whatever works best for you. We are using SingleThreaded for some of our apps, because they are just a small part of a larger application and we can't use all the resources in the machine for rendering. See also this: http://thread.gmane.org/gmane.comp.graphics.openscenegraph.user/52734 rgds jp Thanks, Jesse ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org -- 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
[osg-users] Load balancing on multiple cores
Hello, OSG is a great product and I hope I can tap into the great support you folks offer! I have an Intel Core 2 Duo processor, and I'm running OSG 2.8.2 on Windows XP. And I have VSync turned off, by the way. When I run osgviewerd.exe (debug) I notice that the stats reported are very erratic. That is, the graphs displaying the Event, Update, Cull, Draw traversals are not flat line but go up and down unpredictably. I get ~100 fps. If I go into the Windows Task Manager and set the affinity of the osgviewerd.exe process to a single core, then the stats flat line and my framerate goes way up (~160 fps). Running osgviewer.exe (release) with affinity in the Task Manager to both cores yields flat line graphs and frame rate ~200 fps. Obviously, 100 fps is more than enough, but that is for a simple scene. In our application, which embeds OSG into an MFC window, I see a framerate of about 20 fps in debug. My colleague, who has a quad core machine, sees about 3 fps in debug! Is there something we're not understanding correctly about how to load balance OSG across multiple cores? We don't want to limit our application to one core because then we obviously lose parallel processing (database pager, etc). I really appreciate any help you guys can offer. Thanks, and keep up the great work! Jesse Stimpson ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] Load balancing on multiple cores
Hi Jesse, I'll let others reply specifically about the threading, but I wanted to react to one part of your post: When I run osgviewerd.exe (debug) I notice that the stats reported are very erratic. Never do any performance testing in debug, especially using Visual C++! An erratic frame rate and stats is exactly what I have come to expect in debug. Visual C++ and its iterator and other debugging facilities really get in the way and make the stats useless. If you get the performance you want in release, that's all that matters. You won't ship debug binaries to your clients will you? 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] Load balancing on multiple cores
Hi J-S, Never do any performance testing in debug, especially using Visual C++! An erratic frame rate and stats is exactly what I have come to expect in debug. Visual C++ and its iterator and other debugging facilities really get in the way and make the stats useless. If you get the performance you want in release, that's all that matters. You won't ship debug binaries to your clients will you? You're correct. We never will be shipping debug binaries. However, it's come to the point where the debug performance is hindering our development. My colleague with the quad core desktop sees ~3 fps, and it's decreasing his productivity. I'd be willing to live with having to go into the task manager and set the processor affinity if we are using the debug build, or setting it programmatically for debug builds, but if there's a root cause that can be fixed, I'd rather do that. That way, the debug and release builds stay as similar as possible and testing in one is likely to produce the same results as the other. Having said that, your insight on the STL debugging facilities is very helpful. Thanks for your reply. Jesse ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] Load balancing on multiple cores
Hi Jesse, On Thu, Mar 18, 2010 at 4:36 PM, Jesse Stimpson jesse.stimp...@gmail.com wrote: You're correct. We never will be shipping debug binaries. However, it's come to the point where the debug performance is hindering our development. My colleague with the quad core desktop sees ~3 fps, and it's decreasing his productivity. We'll if VisualStudio's debug performance is too bad to develop with routinely avoid using debug unless you actually need to do debugging, or pick a better compiler or see if you can tweak compiler options to avoid the pitfalls of VisualStudio. Personally in dev work I just use an optimized build, then perhaps a couple of times a month I might come across an issue that really needs a stack trace or a putting a break point into to monitor something and I will do a debug build. A will often go several weeks on the trot without ever using debug. This is even under Linux where the gcc compiler can do debug builds without totally killing performance. Robert. ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] Load balancing on multiple cores
Hi Robert, Thanks for the response. We'll if VisualStudio's debug performance is too bad to develop with routinely avoid using debug unless you actually need to do debugging, or pick a better compiler or see if you can tweak compiler options to avoid the pitfalls of VisualStudio. I do plan to try some compiler options. Although, if others have had similar experiences, then I can reduce the amount of time I spin my wheels so to speak. Personally in dev work I just use an optimized build, then perhaps a couple of times a month I might come across an issue that really needs a stack trace or a putting a break point into to monitor something and I will do a debug build. A will often go several weeks on the trot without ever using debug. This is even under Linux where the gcc compiler can do debug builds without totally killing performance. Unfortunately, this isn't an option for us. I feel that we're diverging from what I think is most perplexing about what I'm seeing. When I restrict the process to use less cores, I get increased rendering performance. This is what leads me to believe there are some load-balancing issues. Also, if I have the OSG process set to both cores and I run another single-threaded process in the background, the other process gets assigned to one core, and OSG rendering speeds up, presumably because it is being processed mainly on a single core. I've been playing with the OSG threading models as well. In debug, SingleThreaded mode seems to run the best on my machine. Is there documentation on the implications of the threading models? If I understand correctly, SingleThreaded means only the rendering is single threaded, and the database pager is still a separate thread. Is this right? Are reasons we shouldn't consider using SingleThreaded mode? Thanks, Jesse ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org