General purpose computing on graphic processing units (GPU) is a potential method of speeding up scientific computation with low cost and high energy efficiency. We experimented with the particle physics simulation toolkit Geant4 used at CERN to benchmark its geometry navigation functionality on a GPU. The goal was to find out whether Geant4 physics simulations could benefit from GPU acceleration and how difficult it is to modify Geant4 code to run in a GPU.
We ported selected parts of Geant4 code to C99 & CUDA and implemented a simple gamma physics simulation utilizing this code to measure efficiency. The performance of the program was tested by running it on two different platforms: NVIDIA GeForce 470 GTX GPU and a 12-core AMD CPU system. Our conclusion was that GPUs can be a competitive alternate for multi-core computers but porting existing software in an efficient way is challenging.
We ported a piece of code from a large particle physics simulation toolkit to a general purpose GPU and compared its performance in a GPU and a 12 core CPU server.
The results indicated that the performance on the GPU may be heavily input-dependent. In our test cases, the GPU program, when compared to a single-threaded CPU version, was faster by a factor 1.6 – 13, depending on the test case. The corresponding speedup factor on the 12-core CPU system was 8 – 12 and it outperformed the GPU in most cases.
The algorithms were originally designed for CPUs and quite straightforwardly ported to GPU. Our results indicated that an efficient GPU implementation of Geant4 in the particle physics context would probably require rewriting the algorithms for the target GPU architecture.
Based on our case, we can say that GPU computing can be a cost-effective solution for simple enough problems but accelerating complex software packages efficiently using GPGPU is not necessarily a feasible alternative, even if the software was easily parallelizable on CPU systems.