Parallel Computation of Ground Radiation Simulation Based on GPU

Parallel Computation of Ground Radiation Simulation Based on GPU

Available online at www.sciencedirect.com ScienceDirect Procedia Computer Science 107 (2017) 9 – 14 International Congress of Information and Commun...

345KB Sizes 2 Downloads 31 Views

Available online at www.sciencedirect.com

ScienceDirect Procedia Computer Science 107 (2017) 9 – 14

International Congress of Information and Communication Technology (ICICT 2017)

Parallel Computation of Ground Radiation Simulation Based on GPU Zhao Yanjie, Yao Guoqing*, Ding Yanqing School of Information Engineering, China University of Geosciences (Beijing), Beijing 100083, China * Corresponding authors: [email protected] Tel.: +1-342-605-4879

Abstract This paper introduces a simulation calculation model of ground radiation field. The simulation calculation model includes the calculation of incident radiation field and the calculation of outgoing radiation field. The calculation of incident radiation field is mainly divided into direct solar radiation, diffuse sky radiation and background to target reflected radiation. The parallel computing technology of GPU is introduced, and the process of simulation calculation is implemented based on CUDA framework. The ground radiation field simulation is carried out on several different 3D scenes, and the parallel computing time is compared with the computing time before parallel computing. Through the comparison and analysis, the use of parallel computing can significantly improve the time of simulation calculation. At the same time, with the increase of the number of triangular facets in the 3D scene, the efficiency of acceleration will continue to improve, but the extent of the upgrade will be affected by the conditions of GPU hardware equipment. Keywords: ground radiation field; simulation calculation; GPU parallel computing; CUDA

1. Introduction The simulation process of ground radiation field is helpful to deepen the study of target characteristics of optical remote sensing and provide theoretical basis for the development of remote sensing instruments and platform parameters. At present, researches about radiation simulation have been widely studied at home and abroad. Can Hou1 simulated the direct solar radiation inside the plant canopy which is calculated in parallel. Quan Zhao2 calculated the thermal radiation of implosion pellet based on CUDA framework and made breakthrough progress. Through the integration of data, Curtis obtained material radiation characteristics in different weather conditions, different time and different directions, and summed up the model on the condition of experience, which can be used to obtain the radiation characteristics of different materials. Shengcheng Cui3 presented a remote sensing model of

1877-0509 © 2017 The Authors. Published by Elsevier B.V. This is an open access article under the CC BY-NC-ND license (http://creativecommons.org/licenses/by-nc-nd/4.0/). Peer-review under responsibility of the scientific committee of the 7th International Congress of Information and Communication Technology doi:10.1016/j.procs.2017.03.049

10

Zhao Yanjie et al. / Procedia Computer Science 107 (2017) 9 – 14

surface albedo that takes into account the effect of the actual sky light distribution, the influence of the sky angles distribution in the atmospheric conditions, and the multiple reflection mechanism between the surface and the atmosphere. As the background radiation comes in all directions and the complexity of background radiation requires to consider occlusion relation among the triangular facets in the scene due to the positional relationship, geometric shape and other factors, the processing is quite time consuming thus limits its application in engineering. With the increasing number of triangular facets, the time of simulation on CPU is far from expected which makes it very important to study how to carry out simulation calculation in parallel. With the development of GPU devices, its single-precision floating-point computing power and storage bandwidth have been improved greatly4. Although the computational frequency of each GPU is still lower than the CPU core, but a GPU contains a number of computing cores far more than CPU, its multi-core structure can make up for the shortcoming of low computational frequency. It means that GPU can handle thousands of threads at the same time, the time of waiting for the memory response before reading memory information for each thread can also be ignored. Therefore, GPU not only can perform image rendering work in cooperation with CPU, but also has a strong power for parallel computing. In recent years after the release of compute unified frameworks such as Compute Unified Device Architecture5 (CUDA), programming GPUs has become much easier and more popular. GPU has been used to accelerate a wide range of research applications such as, image processing 6, feature tracking7. In this paper, the process of ground radiation field simulation accelerated computing efficiency by using parallel method based on GPU and CUDA environment, the experimental results show that the calculation of ground radiation field simulation based on GPU has good speedup and computing efficiency. 2. Model of ground radiation simulation The calculation of ground radiation simulation includes the calculation of incident radiation field and the calculation of outgoing radiation field. The calculation of incident radiation field also includes direct solar radiation, diffuse sky radiation and background to target reflected radiation. 2.1. Direct solar radiation The calculation of direct solar radiation is based on the position of the sun and atmospheric conditions. The solar irradiance outside of the atmosphere reaches each triangular facet in the 3D scene through the decrease of atmosphere. The calculation formula is as follows:

G G

W d O Es0O cos s ˜ n

EsO

(1) G G In this formula, s and n represent the direction vector of the sun and the normal vector of triangular facet respectively, EsO is the actual solar irradiance, W d O is atmospheric downward transmittance with wavelength

O

0

and EsO is the solar irradiance outside of the atmosphere.

2.2. Diffuse sky radiation Diffuse sky downward radiation is mainly concerned with the whole space above the facets on the surface. The whole space is divided into equal intervals according to zenith and azimuth angle. We need to calculate the scattering from each incident zenith and azimuth angle then integrate over the whole space. The sum of the whole space is the current facet energy from the diffuse sky radiation. The calculation formula is as follows:

Ed

2S

S 2

³M ³T 0

0

Ld T , M cos T sin T dTdM

(2)

11

Zhao Yanjie et al. / Procedia Computer Science 107 (2017) 9 – 14

M are the incident zenith and azimuth angle of the sky light, Ld T , M is the atmospheric spectral radiance in the hemispherical space and Ed represents the diffuse sky downward irradiance

In this formula,

T

and

among the whole space on the surface. 2.3. Background to target reflected radiation Background to target reflected radiation mainly takes into account the reflected radiation effects among the triangular facets in the scene due to the positional relationship, geometrical shape and other factors. The incident radiation of background facet also includes direct solar radiation, diffuse sky radiation and reflected radiation from others. We calculate background radiation from those facets that are visible for each other. It can be expressed as

L cos T ³s r 2 ds

Eb

N

¦ i 1

Li cos T i si ri 2

(3)

N represents the number of background facets, ri represents the distance between the center of background facet and the center of target facet, T i represents the zenith angle from the center of background facet to the center of target facet, si represents the area of background facet and Li represents the radiance reflected In this formula,

from the background facet to the target facet.

Li

G G rf

W d O Es0O cos s ˜ n

S



2S

M 0

r

S 2 f

³T

0

S

Ld T , M cos T sin TdTdM

(4)

On the right of this formula, the first part is the radiance of direct solar radiation reaching the background facet is reflected by the background facet to reach the target facet, the second part is the radiance of diffuse sky radiation reaching the background facet is reflected by the background facet to reach the target facet. 2.4. Outgoing Radiation The outgoing radiation field is the result of the incident radiation field being reflected by the surface of the scene. For each facet in the scene, select a fit reflectivity curve, then calculate the outgoing radiance based on the given direction with zenith and azimuth angle. We can obtain the total outgoing radiance of target in a certain direction by integration of direct solar radiance, diffuse sky radiance and reflected radiance from background facets. The calculation formula can be expressed as 2S G G r L0 W d O Es0O cos s ˜ n Sf  ³

M 0

r

S 2 f

³T

0

S

N

Ld T , M cos T sin TdTdM  ¦ i 1

rf Li cos Ti ˜ si S ri 2

(5)

3. Parallel strategy for ground radiation simulation First of all, the 3D scene is constructed by scene editor. Then the scene is loaded and physical properties of triangular facets are initialized. The radiation simulation is performed according to external lighting conditions. We can analyze the simulation result when calculation finished. The process is shown in Fig. 1. 3D Scene

Incident Radiation Field

Outgoing Radiation Field

Direct Solar Radiation

Diffuse Sky Radiation

Background to Target Reflected Radiation

Fig. 1. The process of ground radiation simulation

Simulation Result

12

Zhao Yanjie et al. / Procedia Computer Science 107 (2017) 9 – 14

Through analysis we can know, the time complexity of direct solar radiation is O n , the time complexity of





2

diffuse sky radiation is O n and the time complexity of background to target reflected radiation is O n . The process of radiation calculation between the geometrical models in the 3D scene is relatively independent, and the process of radiation calculation between the triangular facets in the geometrical model is also relatively independent, so we can calculate the radiation field of the whole scene by increasing the number of threads, although it is not possible to reduce the time complexity of the algorithm, but it can reduce the execution time of the algorithm to a certain extent. We can divide the whole task into single tasks that a thread calculates the irradiance of a triangular facet. Because the task for each thread is relatively dependent, there is no need for threads to correspond with each other, which makes the process of calculation simple. The parallel computing process of ground radiation simulation is shown in Fig. 2. Construct And Load 3D Scene

Initialize Attributes for Each Triangular Facet

Convert to The Format CUDA Supports And Transfer to Device Memory

Radiation Field Simulation Calculation

Transfer Results to Host Memory

Analyze Simulation Result

Fig. 2. The parallel computing process of ground radiation simulation

In CUDA framework, the thread organization structure is shown in Fig. 3. A kernel function has two levels of parallelism, that is, the thread blocks in the thread grid and the threads in the thread block. The whole problem is divided into several small-scale problems using the divide and conquer method. Each sub-problem module is implemented with one thread block. The thread blocks are coarse-grained parallel, the threads in a thread block are fine-grained parallel. This programming model can make full use of hardware resources to achieve multi-threaded efficient parallel computing. The parallel strategy of ground radiation field simulation is shown in Fig. 4. Grid 0

Blockδ0,2ε

Block δ0,0ε

Block δ0,1ε

Block δ0,2ε

Thread δ0,0ε

Thread δ0,1ε

Thread δ0,2ε

Block δ1,0ε

Block δ1,1ε

Block δ1,2ε

Thread δ1,0ε

Thread δ1,1ε

Thread δ1,2ε

ĊĊĊĊ

ĊĊĊĊ

Fig. 3. Thread organization structure

13

Zhao Yanjie et al. / Procedia Computer Science 107 (2017) 9 – 14

All Models In The Scene Radiation Calculation Block 1

Block 0

Block N

...

The Scene Radiation Calculation Result

Fig. 4. Parallel Strategy

4. Implementation and results discussion The parallel computation of ground radiation field simulation is implemented and verified by experiments. The experimental environment is Windows7 ultimate 64 bit, 16GB memory, Intel CPU processor Core i7-4790 3.60GHz and NVIDIA GeForce GTX 950. The specification of GTX 950 is listed in Table 1. Table 1. Specification of NVDIA GeForce GTX 950 Number of multiprocessors

6

Number of cores

48

GPU clock rate

1228MHz

Total amount of global memory

2GB

Total amount of shared memory per block

49152bytes

Maximum number of threads per block

1024

Maximum sizes of each dimension of a block

1024 * 1024 * 64

Maximum sizes of each dimension of a grid

2147483647 * 65535 * 65535

There are three scenes made up of simple geometrical models in the experiment. x Scene1: A sphere model with radius of 2m. The number of facets is 2400, the number of sky light directions is 360 and the number of background sky light directions is 6. x Scene2: A sphere model with radius of 2m. The number of facets is 9800, the number of sky light directions is 360 and the number of background sky light directions is 6. x Scene3: A sphere model with radius of 2m and a 10m length, 10m width terrain model. The sphere model has 9800 facets and the terrain model has 20000 facets. The number of sky light directions and background sky light directions are 360 and 6 respectively. Table 2 shows how much time it takes to process the same data whether to use parallel computing, and the efficiency of using parallel computing. It can be seen clearly from Table 2 that GPU computing time is much lower than CPU computing time, and with the increase of the number of scene facets, the computing efficiency has also been significantly improved. Table 2. Radiation calculation time and speedup of different scenes Scene

The Number of Facets

Computing Time on CPU (minute)

Computing Time on GPU(minute)

Speedup

Scene 1

2400

154

13

11.846

Scene 2

9800

935

76

12.303

Scene 3

29800

12841

664

19.339

14

Zhao Yanjie et al. / Procedia Computer Science 107 (2017) 9 – 14

The experimental results show that parallel calculation of ground radiation simulation is a good method to speed up calculation time and solve the simulation problem. It’s an effective parallel computing method which can speed up the speed of solving the simulation problem, improve the scale of the problem and have good scalability. 5. Summary and future work In this paper, we use GPU parallel computing to simulate the ground radiation field based on CUDA development environment. The simulation calculation model includes the calculation of the incident radiation field and the calculation of outgoing radiation field. We calculated the radiation field of three scenes made up of simple geometrical models. Compared with the time without using parallel computing, it’s proved that computing efficiency can be improved significantly by parallel computing. With the increase of the number of triangular facets, the efficiency of acceleration will continue to improve, but the extent of the upgrade will be affected by the conditions of GPU hardware equipment. Experiment shows that the process of ground radiation field simulation calculation has strong parallel computing capabilities and scalability. Now quite a number of graphics cards have more than one GPU, so our next work is to use this architecture to verify whether it can help accelerate the speedup. Acknowledgments This work has been supported by Li Ligang and Ni Wei in the National Space Science Center. Thank you for providing the technical support and guidance. References 1. Can Hou, LiYu Tang, Chongcheng Chen, et al. Parallel Radiosity Based Light Distribution Simulation within Virtual Plant Canopy, Journal of System Simulation, 2015, p. 10. 2. Quan Zhao, Yunbao Huang, Yuhang Sun, CUDA Based Parallel Computation in Thermal Radiation on Implosion Pellet, Journal of ComputerAided Design & Computer Graphics, vol. 25, 2013, pp. 937-945. 3. Shengcheng Cui, Wenyue Zhu, Xuebin Li, Remote Sensing Model of Surface Reflectance with Consideration of Actual Sky Light Distribution, G06F19/00, 2016.05.04. 4. Jinshuo Liu, Tianxiao Liu, Hui Wu, et al. From Graphic Processing Unit to General Purpose Graphic Processing Unit, J. Wuhan Univ. (Nat. Sci. Ed.), vol. 59, 2013, pp. 198-206. 5. Shane Cook, CUDA Programming: A Developer’s Guide to Parallel Computing with GPUs: Newnes, 2012. 6. Yang Z, Zhu Y, Pu Y, Parallel Image Processing Based on CUDA, Conference on Computer Science and Software Engineering, International Conference on, 2008, pp. 198-201. 7. Sinha S N, Frahm J M, Pollefeys M, et al. GPU-based Video Feature Tracking and Matching, Workshop on Edge Computing Using New Commodity Architectures, 2000, pp. 189-196.