Abstract
This paper describes the usage of shaders to make parallel operations by improving the CPU–GPU communication, using both rendering and compute shaders. When the number of spheres is large, the execution becomes slow and requires a lot of space to store particles. We parallelized the frozen method using an efficient inter-process GPU communication to reduce the operations required. We propose to handle two buffers, one for operations and the other for rendering. While the rendering buffer increases as the number of spheres is required, the operational buffer maintains its size and the number of operations is hold. Experimental results demonstrate that the proposed method shows up 100x throughput improvement over the sequential version. We define a configuration by a 4-tuple as input to the algorithm, and we found a pattern to choose better configurations.
Similar content being viewed by others
References
Alduán I, Otaduy MA (2011) SPH Granular Flow with Friction and Cohesion. In: Proceedings of the 2011 ACM SIGGRAPH/Eurographics Symposium on Computer Animation. Vancouver, British Columbia, Canada
Bell N, Yu Y, Mucha PJ (2005) Particle-based Simulation of Granular Materials. In: Proceedings of the 2005 ACM SIGGRAPH/Eurographics Symposium on Computer Animation, SCA ’05. Los Angeles, California
Cohen J, Tariq S, Green S (2010) Interactive fluid-particle simulation using translating Eulerian grids. In: Proceedings of I3D 2010: The 2010 ACM SIGGRAPH Symposium on Interactive 3D Graphics and Games. https://doi.org/10.1145/1730804.1730807
Dharma D, Jonathan C, Kistidjantoro AI, Manaf A (2017) Material Point Method Based Fluid Simulation on GPU Using Compute Shader. In: International Conference on Advanced Informatics, Concepts, Theory, and Applications (ICAICTA), Denpasar, Indonesia, pp. 1-6, https://doi.org/10.1109/ICAICTA.2017.8090962
Di B, Sun J, Li D, Chen H, Quan Z (2018) GMOD: A Dynamic GPU Memory Overflow Detector. In: Proceedings of the 27th International Conference on Parallel Architectures and Compilation Techniques (PACT ’18). Association for Computing Machinery, New York, NY, USA. Article 20, 1–13. https://doi.org/10.1145/3243176.3243194
Erb C, Greathouse JL (2018) clARMOR: a dynamic buffer overflow detector for OpenCL kernels. In: IWOCL ’18: Proceedings of the International Workshop on OpenCL, article 15, pp1-2, https://doi.org/10.1145/3204917.3204934
Ericson C (2005) Real-time collision detection, the Morgan Kaufman series in interactive 3D technology. CRC Press, Boca Raton
The Art and Business of Making Games (2020) Pool hall lessons: fast, accurate collision detection between circles or spheres (accessed in September 2020). https://www.gamasutra.com/view/feature/131424/pool_hall_lessons_fast_accurate_.php
Markus Ihmsen J, Orthmann B, Kolb SA, Matthias T (2014) SPH Fluids in Computer Graphics. In: Eurographics conference, State of the Art Reports,. https://doi.org/10.2312/egst.20141034
Jacobson D (2007) Hardware accelerated point-based rendering of granular matter for interactive applications, mastersthesis. UMEA University, Department of Computing Science, SE-901 87 UMEA, Sweden
Juhasz Zoltan, Dŭrian Ján, Derzsi Aranka, Matejčík Štefan, Donkó Zoltán, Hartmann Peter (2021) Efficient GPU implementation of the particle-in-cell/Monte-Carlo collisions method for 1D simulation of low-pressure capacitively coupled plasmas. Comput Phys Commun 263(2021):107913. https://doi.org/10.1016/j.cpc.2021.107913
Kanchev A (2020) Review of several techniques for accelerating physical simulations on the GPU. 59-th annual scientific conference of Angel Kanchev University of Ruse and Union of Scientists - Ruse “New Industries, Digital Economy, Society - Projections of the Future III”
Kolb A, Latta L, Rezk-Salama C (2004) Hardware-Based Simulation and Collision Detection for Large Particle Systems. In: Proceedings of the ACM SIGGRAPH/EUROGRAPHICS Conference on Graphics Hardware, HWWS ’04. Grenoble, France
Kusnadi L, Dharma D, Manaf A (2017) Material point method based fluid simulation optimization on GPU with CUDA. In: International conference on advanced informatics, concepts, theory, and applications (ICAICTA). https://doi.org/10.1109/ICAICTA.2017.8090962
Madera FA, Moo-Mena FJ, Montalvo JRG (2020) Sphere polygon interaction to fill volume objects objects. Ventana Inform 40:131–144
OpenGL (2021) The Industry’s Foundation for High Performance Graphics (accessed in April 2021). https://www.opengl.org//
Ren D, Lee B, Höllerer Tobias (2017) Stardust: accessible and transparent GPU support for information visualization rendering. Comput Graph Forum 36(3):179–188. https://doi.org/10.1111/cgf.13178
Winchenbach R, Hochstetter H, Kolb A (2016) Constrained neighbor lists for SPH-based fluid simulations. In: Proceedings of the ACM SIGGRAPH/Eurographics symposium on computer animation (SCA ’16). Eurographics Association, Goslar, DEU, 49–56
Author information
Authors and Affiliations
Corresponding author
Additional information
Publisher's Note
Springer Nature remains neutral with regard to jurisdictional claims in published maps and institutional affiliations.
Rights and permissions
About this article
Cite this article
Madera-Ramirez, F.A., Lopez-Martinez, J.L., Moo-Mena, F. et al. CPU–GPU buffer communication using compute shader to fill volumes with spheres. J Supercomput 78, 6448–6460 (2022). https://doi.org/10.1007/s11227-021-04136-1
Accepted:
Published:
Issue Date:
DOI: https://doi.org/10.1007/s11227-021-04136-1