Our Crowd Simulation Application OpenSteer Human Behaviors

Multi Agent Simulation and its optimization over parallel
architecture using CUDA™
Abdur Rahman and Bilal Khan NEDUET(Department Of Computer and Information Systems)
Internal Advisor: Shahab Tahzeeb
External Advisor: Ali Zaidi
INTRODUCTION
MULTIAGENT SYSTEMS
MAPPING BETWEEN CUDA AND C++
In this project we are determined to show that large scale multi-agent systems
can benefit from the use of parallel computing and it will show massive
enhancement in performance. Nvidia GPUs allow general purpose computing
on graphics processing units by making use of CUDA technology.
A dynamic environment consisting of many agents (which may represent cells,
species, individuals, firms, nations) acting in parallel, constantly acting and
reacting to what the other agents are doing.
The overall behavior of the system is the result of a huge number of decisions
made every moment by many individual agents.
In order to successfully convert the application C++ specific data types must
be mapped onto CUDA specific type to successfully run on the GPU. Another
aspect that should be kept in mind that the overall behavior of the application
must not change. As CUDA is being used for accelerating the application not
redefining the application itself. One such example is that of Vec3 class in the
CPU code. This class keeps track of all the vectors associated with every agent.
Classes cannot be used with CUDA which is like the typical C-language. In our
case, we have mapped the Vec3 class into type struct.
Snapshot
You can see
agents in
motion
ACHIEVING OUR GOAL
We will implement a distributed application for crowd simulation which is one
example of Multi agent modeling. The application would be written in any high
level language such as C++
PORTING APPLICATION ONTO GPU
In the next phase, we ported that original application code onto GPU by finding
out the parallelizable portions in that code. By running the compute intensive
code on multicore GPU will show massive accelerated performance. Nvidia
CUDA architecture will be used for that purpose.
Porting this application onto the GPU requires us to determine the portions
that could be ported onto the GPU. While developing the CPU based
application using Opensteer we figured out that the architecture of the
Opensteer can be modified in two phases.
PARALLEL DESIGN MODEL
CPU Code
Find out the
parallelizable
portions
Write CUDA code
for parallel
processing
OPENSTEER
Developed by Craig Reynolds for Sony Cooperation
Its a C++ library to help construct for steering and motion behaviors of
autonomous characters in games and animation. It also takes care of all the
graphics related work.
•Modification Phase
In this phase the previously calculated steering force is used to modify the
vehicle properties like position, velocity and alignment
The simulation and modification phase are the portions that we will port onto
the GPU.
INTRODUCING HUMAN BEHAVIOR
Modify CPU code
to allow CPU-GPU
co processing
Integrate and Get
massive Speed
ups!!!
•Simulation Phase
In this phase the steering force for an agent is calculated depending on the
steering behavior. There is no modification in position, velocity or alignment
Human like behaviors include : Obstacle avoidance, Closeneighbor avoidance, Far-neighbor avoidance, Wandering. These
behaviors were integrated with the help of Opensteer to develop
CPU based crowd dynamics application
CUDA
CUDA™ is a parallel computing platform and programming model invented by
NVIDIA. It enables dramatic increases in computing performance by
harnessing the power of the graphics processing unit (GPU). With CUDA, you
can send C, C++ and Fortran code straight to GPU, no assembly language
required.
Developers at companies such as Adobe, ANSYS, Autodesk, MathWorks and
Wolfram Research are waking that sleeping giant – the GPU -- to do generalpurpose scientific and engineering computing across a range of platforms.
Creating Real World Scenarios With
Satellite Images Using GIS
With the help of this feature we will be able to map real world scenarios
and environment developed by the concerned governing authorities into
our application.
NEIGHBHORHOOD SEARCH
In the Opensteer library, the neighborhood dependent behaviors require every
agent to review every other agent that is alive. That means if there are n
agents then each agent will determine/study the position and alignment of
(n-1) agents. This would result in a complexity of O(n²) .
There are multiple approaches to improve the inefficient brute-force
neighborhood search mentioned above. One of these approaches is called
static grid neighbor. The static grid neighbor
search assumes that the simulation takes place
in a bounding sphere called World with a radius
called World Size. A vehicle trying to leave this
sphere is automatically placed on the opposite
side of the sphere. The world is divided in equally
sized cubes, called cells so that each vehicle is
assigned to exactly one cell. A neighbor search can
now be reduced to vehicles that are located within cells around the vehicle for
which the neighbor search is done. The number of cells that have to be
checked depends on the search radius.
CHANGES IN PHASE TRAVERSAL
1
1
2
2
3
3
Our Crowd Simulation
Application
Simulation
Simulation
for All agents
Modification
for All agents
Modification
CPU Code
GPU Code
Hardware used: Nvidia GeForce 460 gtx
•
•
•
•
•
CUDA Cores : 336
Memory Bandwidth: 115 GB/s
Graphics Clock: 675 MHz
Processor Clock: 1350 MHz
Price: $165