SEARCH
ARCHIVE · NEW PARADIGM SERIES

The universe in the GPU

BY GERARDO BLANCO · · 7 MIN
KOSMOSLOGOS ARCHIVEAutomatic translation of the original Spanish post by Gerardo Blanco (KosmosLogos, CC BY-SA 3.0). Read the original in Spanish. /2010/02/el-universo-en-la-gpu.html

Just as our video card is part of the universe, it is also possible to use its computing capabilities to study the cosmos, process images, and play.

Cosmological Simulation

The graphics processing unit or GPU (acronym from English graphics processing unit) is a processor dedicated exclusively to processing graphics, to lighten the workload of the central processor in various applications. ATI (now acquired by AMD) and NVIDIA are the two largest producers of video cards, which now provide products with very important capabilities, such as cards compatible with CUDA, which we will see here. But AMD also has its own.

CUDA stands for (Compute Unified Device Architecture) which refers to both a compiler and a set of development tools created by NVIDIA.

It works on all NVIDIA GPUs from the G8X series onwards, including GeForce, Quadro and the Tesla line (see compatible products).

CUDA attempts to exploit the advantages of GPUs by using the parallelism offered by their multiple cores.

What is CUDA used for?

The Cuda Zone site allows you to browse a wide set (almost 700) of different uses that developers have created. Here we list some of the ways astronomy and cosmology are using CUDA to study the cosmos:

CUDA Applications

Signal correlation in radio astronomy

Rob van Nieuwpoort, from ASTRON, carried out a comparison work of different processors:

A recent development in radio astronomy is to replace traditional antennas with many small antennas. The signals are combined to form a large virtual telescope. The enormous data flow is filtered, through a process called cross-correlation to remove noise. This is especially challenging because the computational demand grows quadratically and there is intense input and output of data. The LOFAR telescope, for example, will produce more than 100 terabytes per day. A recent trend is to correlate in software instead of dedicated hardware to increase flexibility and reduce development efforts.

The paper indicates that LOFAR uses the IBM Blue Gene/P architecture in the correlator, but they also tested NVIDIA Tesla C1060, ATI 4870 and Cell B.E.

The results (*1) show that the processing power and memory of current GPUs are unbalanced for correlation purposes. While the correlator on Blue Gene reaches an incredible 96% of the theoretical peak performance, on ATI it only reaches 14%, on NVIDIA it only climbs to 26% and on Cell/B.E. it achieves 92%.

GPU Comparison
Comparative chart of the theoretical peak achieved with and without communication, among the different platforms. Credit: Nieuwpoor-Romein

The work was presented at the 23rd International Conference on Supercomputing (ICS), June 8-12, 2009, New York, USA. It was published in ACM.
A copy can be obtained at GPGPU.

Interactive visualization of cosmological simulations

Tamas Szalay, Volker Springel and Gerard Lemson authored the paper:
GPU-Based Interactive Visualization of Billion Point Cosmological
Simulations arXiv:0811.2055v2
There they indicate that, despite recent advances in computer graphics capabilities, a brute force approach is unable to interactively display terabytes of data. They indicate having implemented a system that uses a hierarchical level of detail for the results of cosmological simulations, to be able to visually display precise results without loading all the data (which contains more than 10 billion points). The guiding principle of the program is that the user should not be able to distinguish what they see from the entire original dataset. Furthermore, by using a tree system for the levels of detail, the size of the data is limited only by the capacity of the input/output system that contains it.

Springel seems to be an expert on the subject. He is the one who developed the GADGET code for cosmological simulations.

Octree

The article indicates that they used data from the Aquarius simulation (one of the largest ever done) in which there are 150 million particles at each time step and 128 steps in total, so there are about 20 billion particles. The entire simulation requires 1.4 terabytes of disk space. The idea is not to render all the data, but to generate equivalents at various scales. This has been done many times. A simple example is the satellite images from Google Maps.

For cosmological simulations, the procedure generally consists of taking a large number of points (currently up to tens of billions) and rendering each one as a pixel or a group, on the screen. The data structure used were octrees, which are eight-branch trees, so to speak. Thus, places close to the user viewer will be loaded with a lot of detail, while those farther away will show a simplified version.

The program for visualization uses the CPU only to decide which blocks to load and render. The rest of the work is done by the graphics card.

The implemented system allows viewing the data at different scales and in different locations, instantly; examining the data at different times and selecting some points of interest and following them from beginning to end.
And all with a GeForce 8800 at 10 frames per second.

The tip of the iceberg

Those mentioned are only some of the several uses that relate GPUs to astronomy. To cite some other interesting resources and links:

AstroGPU 2007 was a workshop on computing and graphics processing units in astronomy and astrophysics. It was held at the Institute for Advanced Study in Princeton, November 9-10, 2007. On the AstroGPU 2007 page there are videos and pdf presentations.

GAMER: a GPU-Accelerated Adaptive Mesh Refinement Code for Astrophysics
Hsi-Yu Schive, Yu-Chih Tsai, Tzihong Chiueh arXiv:0907.3390v2

Graphic-Card Cluster for Astrophysics (GraCCA) -- Performance Tests
Hsi-Yu Schive, Chia-Hung Chien, Shing-Kwong Wong, Yu-Chih Tsai, Tzihong Chiueh arXiv:0707.2991v2

The article describes the architecture of the GraCCA system, a cluster of graphics cards for astrophysical simulations. It consists of 16 nodes, each with 2 NVIDIA GeForce 8800 GTX cards, with a theoretical performance of 16.2 TFLOPS.

GraCCA

For the general public

Science at home

Current GPU capabilities can be used not only for high-performance science. Here we have commented on the possibility of doing science on a personal computer, through projects like SETI@home. The project enables the use of CUDA to have much greater processing power. The same happens with Einstein@Home and GPUGRID.

Brian Burke, from NVIDIA, says that "NVIDIA's CUDA technology dramatically accelerates the pace of scientific research".

And also for recreation

To finish, the games. I'm not an avid gamer (I'm still on Tomb Raider...), but some seem very tempting:

Crazy Machines 2: It's about solving problems, using PhysX. This and other games can be seen running in YouTube videos like the following:

Crazy Machines 2

http://www.youtube.com/watch?v=Y-SCYg7pA-s

Warmonger

If it's about shooting, with Warmonger it seems we can destroy everything in our path.
On YouTube:http://www.youtube.com/watch?v=rRMdv21q9Cw

Screensaver

NVIDIA has a hypnotic screensaver of a ball falling and breaking cloths, with several configuration options, for example, it's possible for the screensaver background to be an image (or a series) that we have on our PC. We can preview it on YouTube.

NVIDIA Screensaver

The two games and the screensaver indicated can be downloaded for free from the NVIDIA Power Packs page.

Bonus

FastFractal256 is an application for visualizing Mandelbrot fractals. It uses CPU and GPU. If we don't have an appropriate graphics card, it will use only the central processing unit. A trial version can be downloaded and videos and images of the program can be seen at FastFractal.com

To learn

The CUDA development tools consist of three fundamental components to help the programmer get started in this language:
1. The latest CUDA driver
2. A complete toolkit
3. Code examples from the CUDA SDK

CUDA U contains online courses that offer everything needed to start programming in CUDA or to impart knowledge about this programming environment. It also contains links to universities that include CUDA in their curricula.

Open CL

OpenCL (Open Computing Language) is a heterogeneous computing environment that runs on the CUDA architecture. It allows developers to leverage the extraordinary parallel processing capability of NVIDIA GPUs to create highly efficient computing applications.

As part of the OpenCL NVIDIA presentation, a demonstration of the world's first OpenCL application for GPU running on an NVIDIA GPU for laptops was performed.

Sources and related links

About the images

  • Cosmological simulation (first image) and octree. Credit: Tamas Szalay, Volker Springel and Gerard Lemson
  • Images of the GraCCA system. Credit: Hsi-Yu Schive
  • Screensaver image. Credit: NVIDIA
KOSMOSLOGOS ARCHIVEOriginally published on KosmosLogos by Gerardo Blanco · License CC BY-SA 3.0 · Adapted format, original text unchanged
GERARDO BLANCOAuthor of the KosmosLogos blog, written from Argentina about astronomy, astrophysics, cosmology, and related sciences.