Skip to main content
Log in

CPU–GPU buffer communication using compute shader to fill volumes with spheres

  • Published:
The Journal of Supercomputing Aims and scope Submit manuscript

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.

This is a preview of subscription content, log in via an institution to check access.

Access this article

Price excludes VAT (USA)
Tax calculation will be finalised during checkout.

Instant access to the full article PDF.

Fig. 1
Fig. 2
Fig. 3
Fig. 4
Fig. 5

Similar content being viewed by others

References

  1. 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

  2. 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

  3. 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

  4. 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

  5. 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

  6. 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

  7. Ericson C (2005) Real-time collision detection, the Morgan Kaufman series in interactive 3D technology. CRC Press, Boca Raton

    Google Scholar 

  8. 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

  9. 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

  10. 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

  11. 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

    Article  MathSciNet  Google Scholar 

  12. 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”

  13. 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

  14. 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

  15. Madera FA, Moo-Mena FJ, Montalvo JRG (2020) Sphere polygon interaction to fill volume objects objects. Ventana Inform 40:131–144

    Google Scholar 

  16. OpenGL (2021) The Industry’s Foundation for High Performance Graphics (accessed in April 2021). https://www.opengl.org//

  17. 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

    Article  Google Scholar 

  18. 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

Download references

Author information

Authors and Affiliations

Authors

Corresponding author

Correspondence to F. A. Madera-Ramirez.

Additional information

Publisher's Note

Springer Nature remains neutral with regard to jurisdictional claims in published maps and institutional affiliations.

Rights and permissions

Reprints and permissions

About this article

Check for updates. Verify currency and authenticity via CrossMark

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

Download citation

  • Accepted:

  • Published:

  • Issue Date:

  • DOI: https://doi.org/10.1007/s11227-021-04136-1

Keywords

Navigation