Bullet is a popular open-source 3D physics engine. Bullet3 is its fabled branch that uses GPUs and OpenCL in its rigid body pipeline.
- Take note that you need to have a GPU that has OpenCL support. On my system, I used a NVIDIA GeForce GTX 750 Ti.
Install the latest NVIDIA driver for your Ubuntu. The driver installation also installs the Installable Client Driver (ICD) required by OpenCL. On my system, I installed the NVIDIA 352 driver package.
Clone the Bullet3 repository:
$ git clone https://github.com/bulletphysics/bullet3.git
Note: By default, OpenCL examples are not featured in the Example Browser. If you would like to have this, get my Bullet3 fork here or just replace the
examples/ExampleBrowser/CMakeLists.txt from it in your repository.
- Compile the Bullet3 code and examples:
$ cd build3 $ cmake .. $ make
- If you would like to install the library:
$ sudo make install
- Invoke the Example Browser to try out many physics tests and see how the engine fares:
- If you want to try the OpenCL tests, invoke it as:
$ examples/ExampleBrowser/App_ExampleBrowser --enable_experimental_opencl
You must be able to see two new tests listed under OpenCL (Experimental) and be able to try them out.
Tried with: Ubuntu 14.04