ChronoEngine:Unit GPU

From ChronoWiki

Jump to: navigation, search

unit_GPU

Status:

Tested

Build depends:

Chrono::Engine
CUDA Nvidia SDK

Run depends:

Chrono::Engine
Nvidia GPU board

Main developers:

Hammad Mazhar
Alessandro Tasora

This is an optional unit that can add GPU parallel computation in Chrono::Engine. Read the introduction to units for a technical background on the modularity of the Chrono::Engine project.

Features

The GPU unit is used to exploit GPU parallel computation: you can use a GPU stream processor to speedup the solver and the collision detection.

This part of the project is NOT licensed as GPL and it can be accessed only to a part of the developer team. It can be provided on request - contact us if you are interested.

Here are the main features:

  • GPU-based collision engine (broad phase and narrow phase)
  • GPU-based complementarity solver.

In both cases, the speedup is up to two orders of magnitude for complex scenarios.

Requirements

  • To run applications based on this unit:
    • you must have a Nvidia GPU board with CUDA support installed in your hardware
  • To build applications based on this unit:
    • you must have a Nvidia GPU board with CUDA support installed in your hardware (previously this was not necessary because develepment could also happen without a GPU board, using the CUDA emulation mode, but since CUDA v.2.1 the emulation mode is unsupported).
    • you must have CUDA SDK and toolkit installed on your system (tested from v.3.0).

Building instructions

This unit corresponds to an additional DLL library, called ChronoEngine_GPU.dll, that can be linked to your application if you want to use it. On Linux systems, the .dll suffix is .so.

That library is not available in the SVN or in the easy installer, so you have to build it. The building process requires the following steps.

  • Repeat the instructions for the full installation, but when you see the CMake window, you must add the following steps:
  • Set the ENABLE_UNIT_GPU as 'on', then press 'Configure' (to refresh the variable list)
    File:cmake_units.gif


  • During the configure, a special CMake function should be able to detect automatically the directories where you installed the CUDA SDK and the CUDA toolkit. However, if you see a warning message showing that CMake could not find one of the these two, you can set them manually:
    • Set the CH_CUDA_SDK_ROOT_DIR to the path where you have your CUDA '/SDK/C' subdirectory. This changes depending on where you installed CUDA. For example, it could be C:/CUDA/SDK/C
    • Set the CH_CUDA_TOOLKIT_ROOT_DIR to the path where you have your CUDA toolkit subdirectory. This changes depending on where you installed CUDA. For example, it could be C:/CUDA
  • Press 'Configure' again, then 'Generate', and proceed as usual in the installation instructions.


When you will rebuild the project, you will find some GPU-based demos in the binary directory, among other default demos. Look at the C++ source of these demos (in chronoengine/source/demos/gpu/ ) to learn how to use the functions of this unit.

Personal tools