56. Appendix 2 Evaluation of AGX Dynamics

56.1. Running tutorials

The pre-built tutorials reside in the bin directory. They can be started from windows explorer just by clicking on them. Paths are setup so that the executables will look for data in the data directory.

Running applications linked to AGX without having setup the runtime environment (PATH) will lead to an application crash.

If you suspect that one more dll files are missing, use the depends tool from Microsoft (freely available on their website):

depends tutorial_basicSimulation.exe

It will give you a list of all the required runtime files necessary for running the application. It can also be run on a dll file:

depends agxPhysics.dll

which lists all the runtime dependencies for AGX main library.

56.1.1. Testing performance

When testing performance of a physics engine, it is important to remember the following things:
  • Do not run with graphics. The agxOSG library will not run AGX in a thread separate from the graphics. To achieve this use the –agxOnly argument with agxViewer. For example:

> agxViewer tutorial1_graphics.agxPy -agxOnly -stopAfter 10

The above command would load and run tutorial1_graphics.agxPy without graphics for 10 seconds and stop and report the time it took to run the simulation.

  • Do not use more threads than you have actual execution units on your CPU (cores). On some systems hyperthreading is enabled. This means that you will see more cores than what the hardware actually have. Hyperthreading works well with “light threads”, which does not do intensive float/calculations. You will notice a very uneven performance in AGX if you enable too many threads. What will happen is that you will spend a lot of time scheduling threads in and out of the cores leaving less time for actual calculations. This means that calling agxViewer –numThreads 10 will certainly NOT run faster than –numThreads 2 on a two core machine.

  • Make sure that the machine is idle before starting your testing.

56.2. agxOSG – Binding to a rendering engine

Section 44.1.4 documents keybindings for the applications built using the agxOSG::ExampleApplication framework. The ExampleApplication is a collection of utilities found in the agxOSG directory as source. This can work as an example of an integration of AGX into a rendering engine (www.openscenegraph.org). agxOSG is mostly for internal use at Algoryx and is not very well documented.

Worth noticing is that rendering and simulation is executed from the same thread This means that if you want to measure the performance of AGX Dynamics only, you should run the tutorial/application without interactive graphics. This can be done for example through the arguments through the agxOSG::ExampleApplication class which all of the tutorials and AGXViewer is based on:

cmd> tutorial_customConstraints --scene 1 --stopAfter 10 --agxOnly --timeStep 0.01 --numThreads 2
The above command would do the following:
  • start the application tutorial_customConstraints

  • load scene 1 as defined in the application (–scene 1)

  • run the simulation for 10 seconds (–stopAfter 10)

  • Run as fast as possible with no graphics/window (–agxOnly)

  • Use a time step of 100hz (–timeStep 0.01)

  • Allocate and use two threads for AGX solver etc. (–numThreads 2)