55
Applying GPU and POSIX Thread Technologies in Massive Remote Sensing Image Data Processing By: Group 17 King Mongkut's Institute of Technology Ladkrabang

Applying GPU and POSIX Thread Technologies in Massive Remote Sensing Image Data Processing By: Group 17 King Mongkut's Institute of Technology Ladkrabang

Embed Size (px)

Citation preview

Page 1: Applying GPU and POSIX Thread Technologies in Massive Remote Sensing Image Data Processing By: Group 17 King Mongkut's Institute of Technology Ladkrabang

Applying GPU and POSIX Thread Technologies in Massive Remote Sensing Image Data Processing

By: Group 17 King Mongkut's Institute of Technology Ladkrabang

Page 2: Applying GPU and POSIX Thread Technologies in Massive Remote Sensing Image Data Processing By: Group 17 King Mongkut's Institute of Technology Ladkrabang

High Resolution graphics not Smoother?

1. Buy better Graphics Card

2. Install newest Driver

<< This Paper >>3. Better GPU & CPU Management!!

Why

Page 3: Applying GPU and POSIX Thread Technologies in Massive Remote Sensing Image Data Processing By: Group 17 King Mongkut's Institute of Technology Ladkrabang

This Paper?

GPU?POSIX?

- IEEE Thread Standard- Thread API for Many OS

- Pthread

= GPU + Thread Technique

Apply GPU & POSIX Thread

What

Page 4: Applying GPU and POSIX Thread Technologies in Massive Remote Sensing Image Data Processing By: Group 17 King Mongkut's Institute of Technology Ladkrabang

Overview

1.Solve?2.Technique3.Process4.Real App

Page 5: Applying GPU and POSIX Thread Technologies in Massive Remote Sensing Image Data Processing By: Group 17 King Mongkut's Institute of Technology Ladkrabang

1.Solve?

Page 6: Applying GPU and POSIX Thread Technologies in Massive Remote Sensing Image Data Processing By: Group 17 King Mongkut's Institute of Technology Ladkrabang

1.Solve?Problem: Remote sensing is Massive!

High Resolution = Slow Processing = Can’t Real Time

Goal: Processing image faster

Page 7: Applying GPU and POSIX Thread Technologies in Massive Remote Sensing Image Data Processing By: Group 17 King Mongkut's Institute of Technology Ladkrabang

2.Technique

Page 8: Applying GPU and POSIX Thread Technologies in Massive Remote Sensing Image Data Processing By: Group 17 King Mongkut's Institute of Technology Ladkrabang

2.Technique (1/4)

1. CUDA

2. Block and Tile

3. Dual-parallel Processing

Page 9: Applying GPU and POSIX Thread Technologies in Massive Remote Sensing Image Data Processing By: Group 17 King Mongkut's Institute of Technology Ladkrabang

2.Technique (2/4)1.CUDA

(Compute Unified Device Architecture)

Is: Parallel Architecture for using GPU

Use by: NVIDIA GPUs since 2007 e.g. GeForce GT 420*

Page 10: Applying GPU and POSIX Thread Technologies in Massive Remote Sensing Image Data Processing By: Group 17 King Mongkut's Institute of Technology Ladkrabang

2.Technique (3/4)2. Block and Tile

What is Block and Tile

● Image data share to block of I/O

● If block larger than gpu , have problem

Page 11: Applying GPU and POSIX Thread Technologies in Massive Remote Sensing Image Data Processing By: Group 17 King Mongkut's Institute of Technology Ladkrabang

2.Technique (4/4)3. Dual-parallel Processing

POSIX threads are applied to perform the I/O step and the GPU processing step simultaneously.

Page 12: Applying GPU and POSIX Thread Technologies in Massive Remote Sensing Image Data Processing By: Group 17 King Mongkut's Institute of Technology Ladkrabang

3.Process

Page 13: Applying GPU and POSIX Thread Technologies in Massive Remote Sensing Image Data Processing By: Group 17 King Mongkut's Institute of Technology Ladkrabang

2.Process(1/2)Main

Init of CUDA

Two Thread are set Up

Process of I/O Thread

And GPU Process

pthread_join

Return

Page 14: Applying GPU and POSIX Thread Technologies in Massive Remote Sensing Image Data Processing By: Group 17 King Mongkut's Institute of Technology Ladkrabang

3.Process (2/2)

Page 15: Applying GPU and POSIX Thread Technologies in Massive Remote Sensing Image Data Processing By: Group 17 King Mongkut's Institute of Technology Ladkrabang

4.Real App

EXPERIMENT

Database PostgreSQL

Page 16: Applying GPU and POSIX Thread Technologies in Massive Remote Sensing Image Data Processing By: Group 17 King Mongkut's Institute of Technology Ladkrabang

4.Real App

CPU 1 ( AMD Athon 3000+ , 1.81GHz ) CPU 2 ( Intel Core i3 530 , 2.93 GHz ) GPU ( Nvidia Geforce GT240 , 512M )

1 2 3

EXPERIMENT

Page 17: Applying GPU and POSIX Thread Technologies in Massive Remote Sensing Image Data Processing By: Group 17 King Mongkut's Institute of Technology Ladkrabang

4.Real App1 2 3

4

56

Image1

Image2

Image3

Image4

Origital Image

ProcessesProcessed Image

Input

Process

Output

Page 18: Applying GPU and POSIX Thread Technologies in Massive Remote Sensing Image Data Processing By: Group 17 King Mongkut's Institute of Technology Ladkrabang

4.Real AppOriginal image Processed image

Page 19: Applying GPU and POSIX Thread Technologies in Massive Remote Sensing Image Data Processing By: Group 17 King Mongkut's Institute of Technology Ladkrabang

4.Real App

IMAGE 1

IMAGE 2

IMAGE 4

IMAGE 3

Page 20: Applying GPU and POSIX Thread Technologies in Massive Remote Sensing Image Data Processing By: Group 17 King Mongkut's Institute of Technology Ladkrabang

4.Real AppImage123821 * 21758

Image212000 * 10961

Image36000 * 5480

Image43000 * 2740

Page 21: Applying GPU and POSIX Thread Technologies in Massive Remote Sensing Image Data Processing By: Group 17 King Mongkut's Institute of Technology Ladkrabang

- PostgreSQL is a powerful- Object-Relational database system- More Than MySQL

- CUDA technology directly to process the image blocks stored in database rapidly with SQL statements

4.Real AppDatabase PostgreSQL

Page 22: Applying GPU and POSIX Thread Technologies in Massive Remote Sensing Image Data Processing By: Group 17 King Mongkut's Institute of Technology Ladkrabang

4.Real App

1.Use2.Download3.Install

Database PostgreSQL

Page 23: Applying GPU and POSIX Thread Technologies in Massive Remote Sensing Image Data Processing By: Group 17 King Mongkut's Institute of Technology Ladkrabang

4.Real App1.Use PostgreSQL

PostPIC PostGIS

SELECT *FROM images WHERE where date(the_img) > '2009-01-01'::date and size(the_img) > 1600;

- Support geographic objects to PostgreSQL

- Simple Features Specification for SQL

- Types and Functions

Page 24: Applying GPU and POSIX Thread Technologies in Massive Remote Sensing Image Data Processing By: Group 17 King Mongkut's Institute of Technology Ladkrabang

- Download : http://www.postgresql.org/download

4.Real App2. Download

Page 25: Applying GPU and POSIX Thread Technologies in Massive Remote Sensing Image Data Processing By: Group 17 King Mongkut's Institute of Technology Ladkrabang

4.Real App3.1 Install PostgreSQL

1 2 3

4 5 6

Page 26: Applying GPU and POSIX Thread Technologies in Massive Remote Sensing Image Data Processing By: Group 17 King Mongkut's Institute of Technology Ladkrabang

4.Real App3.1 Install PostgreSQL

7 8 9

10 11 12

Page 27: Applying GPU and POSIX Thread Technologies in Massive Remote Sensing Image Data Processing By: Group 17 King Mongkut's Institute of Technology Ladkrabang

4.Real App 3.2 Install PostGIS

16 17 18

13 14 15

Page 28: Applying GPU and POSIX Thread Technologies in Massive Remote Sensing Image Data Processing By: Group 17 King Mongkut's Institute of Technology Ladkrabang

4.Real App3.2 Install PostGIS

19 20

Page 29: Applying GPU and POSIX Thread Technologies in Massive Remote Sensing Image Data Processing By: Group 17 King Mongkut's Institute of Technology Ladkrabang

4.Real App

PostgreSQL 9.3

PostGIS 2.1

3.3 Install Complete

Page 30: Applying GPU and POSIX Thread Technologies in Massive Remote Sensing Image Data Processing By: Group 17 King Mongkut's Institute of Technology Ladkrabang

Conclusion!

Page 31: Applying GPU and POSIX Thread Technologies in Massive Remote Sensing Image Data Processing By: Group 17 King Mongkut's Institute of Technology Ladkrabang

Conclusion1.Solve?= Processing

faster

3.Process= Flowchart

2.Technique= Dual-Process

4.Real App= Speed up

Page 32: Applying GPU and POSIX Thread Technologies in Massive Remote Sensing Image Data Processing By: Group 17 King Mongkut's Institute of Technology Ladkrabang

PostPIC PostGIS

PostgreSQL

Conclusion

CPU GPU

Block and Tile

Page 33: Applying GPU and POSIX Thread Technologies in Massive Remote Sensing Image Data Processing By: Group 17 King Mongkut's Institute of Technology Ladkrabang

Applying GPU and POSIX Thread Technologies in Massive Remote Sensing Image Data Processing

By: Group 17By: Group 17

THANK YOU !!

Page 34: Applying GPU and POSIX Thread Technologies in Massive Remote Sensing Image Data Processing By: Group 17 King Mongkut's Institute of Technology Ladkrabang

Applying GPU and POSIX Thread Technologies in Massive Remote Sensing Image Data Processing

Extended!!

1. Technique (Extended)

2. Process (Extended)

Page 35: Applying GPU and POSIX Thread Technologies in Massive Remote Sensing Image Data Processing By: Group 17 King Mongkut's Institute of Technology Ladkrabang

1. Technique X

Page 36: Applying GPU and POSIX Thread Technologies in Massive Remote Sensing Image Data Processing By: Group 17 King Mongkut's Institute of Technology Ladkrabang

1. Technique X

1.CUDA X

2.Block and Tile X

3.Dual-parallel Processing X

Page 37: Applying GPU and POSIX Thread Technologies in Massive Remote Sensing Image Data Processing By: Group 17 King Mongkut's Institute of Technology Ladkrabang

1. Technique X1.CUDA (Extended)

Page 38: Applying GPU and POSIX Thread Technologies in Massive Remote Sensing Image Data Processing By: Group 17 King Mongkut's Institute of Technology Ladkrabang

1. Technique X

1.1 Architecture

Confix GPU

API

1.CUDA (Extended)

Page 39: Applying GPU and POSIX Thread Technologies in Massive Remote Sensing Image Data Processing By: Group 17 King Mongkut's Institute of Technology Ladkrabang

1. Technique X

1. Language integration-Level = e.g. C, C++, …

2. Device-Level = e.g. Assembly

1.1 Architecture1.CUDA (Extended)

-> API

Page 40: Applying GPU and POSIX Thread Technologies in Massive Remote Sensing Image Data Processing By: Group 17 King Mongkut's Institute of Technology Ladkrabang

1. Technique X

1.2 Parallel

CPU GPU

1.CUDA (Extended)

Page 41: Applying GPU and POSIX Thread Technologies in Massive Remote Sensing Image Data Processing By: Group 17 King Mongkut's Institute of Technology Ladkrabang

1. Technique X

- A resource management program in OS

-> CPU

- Allow copy backhelp other compute

1.2 Parallel

1.CUDA (Extended)

Page 42: Applying GPU and POSIX Thread Technologies in Massive Remote Sensing Image Data Processing By: Group 17 King Mongkut's Institute of Technology Ladkrabang

1. Technique X

Partition of imageData in GPU

Partition for a kernel

Processing data in a Block

-> GPU1.2 Parallel

1.CUDA (Extended)

Page 43: Applying GPU and POSIX Thread Technologies in Massive Remote Sensing Image Data Processing By: Group 17 King Mongkut's Institute of Technology Ladkrabang

1. Technique X2. Block and Tile

(Extended)

Page 44: Applying GPU and POSIX Thread Technologies in Massive Remote Sensing Image Data Processing By: Group 17 King Mongkut's Institute of Technology Ladkrabang

1. Technique X2. Block and Tile

(Extended)

• The block is the I/O unit between sensing image data and the system memory

Page 45: Applying GPU and POSIX Thread Technologies in Massive Remote Sensing Image Data Processing By: Group 17 King Mongkut's Institute of Technology Ladkrabang

1. Technique XBlock and Tile(Cont)

• We tested the I/O performance with different block sizes

• Results show that the I/O performance of sensing image data declines

• The tile is used to transfer data between the system memory and GPU memory

• Block , the I/O unit between image and memory

• Tile , the I/O unit between memory and GPU memory

Page 46: Applying GPU and POSIX Thread Technologies in Massive Remote Sensing Image Data Processing By: Group 17 King Mongkut's Institute of Technology Ladkrabang

1. Technique XBlock and Tile(Cont)

• The block in system memory is partitioned into multiple tiles in this approach

• The tile is used to transfer data between the system memory and GPU memory

Page 47: Applying GPU and POSIX Thread Technologies in Massive Remote Sensing Image Data Processing By: Group 17 King Mongkut's Institute of Technology Ladkrabang

1. Technique X2. Dual-parallel

Processing (Extended)

Page 48: Applying GPU and POSIX Thread Technologies in Massive Remote Sensing Image Data Processing By: Group 17 King Mongkut's Institute of Technology Ladkrabang

3. Dual-parallel Processing (Extended)

1. Technique X

• Using buffer pool technology.

• I/O step and the GPU processing step are independent from each other.

• Simple and easy to implement if buffer size is equal to block size.

Page 49: Applying GPU and POSIX Thread Technologies in Massive Remote Sensing Image Data Processing By: Group 17 King Mongkut's Institute of Technology Ladkrabang

1.Technique X

• Used for the I/O task between the image data and the system memory

• Responsible for delivering the buffers from the buffer pool to the GPU memory and processing

3. Dual-parallel Processing (Extended)

Page 50: Applying GPU and POSIX Thread Technologies in Massive Remote Sensing Image Data Processing By: Group 17 King Mongkut's Institute of Technology Ladkrabang

1.Technique X3. Dual-parallel Processing (Extended)

Page 51: Applying GPU and POSIX Thread Technologies in Massive Remote Sensing Image Data Processing By: Group 17 King Mongkut's Institute of Technology Ladkrabang

1.Technique X

• From the micro perspective, image data are processed by hundreds of execution units simultaneously in GPU

• From the macro perspective, the I/O operation and the processing operation are performed simultaneously by POSIX threads.

3. Dual-parallel Processing (Extended)

Page 52: Applying GPU and POSIX Thread Technologies in Massive Remote Sensing Image Data Processing By: Group 17 King Mongkut's Institute of Technology Ladkrabang

1.Technique X3. Dual-parallel Processing (Extended)

Page 53: Applying GPU and POSIX Thread Technologies in Massive Remote Sensing Image Data Processing By: Group 17 King Mongkut's Institute of Technology Ladkrabang

2.Process X

Page 54: Applying GPU and POSIX Thread Technologies in Massive Remote Sensing Image Data Processing By: Group 17 King Mongkut's Institute of Technology Ladkrabang

2.Process(1/3)• Begins with function main after that Initialization of CUDA

environment• Group of buffers are set up• Two POSIX threads are created• One is used to input and output the remote sensing image data• Two is used to responsible for processing the buffers read by

the first thread• For example

• Ready_to_read• The I/O thread should read a block from image data

to current buffer• Ready_to_process

• Buffer is ready to be process by GPU• Ready_to_process

• The I/O thread should write a block to image data

Page 55: Applying GPU and POSIX Thread Technologies in Massive Remote Sensing Image Data Processing By: Group 17 King Mongkut's Institute of Technology Ladkrabang

2.Process(2/3)• Two global variables are declared to record the execution state

of each thread• For example

• Is_IO_Over• is true, it means all the work of I/O thread is finished

• Is_Process_Over• is true, it means all the work of responsible for

processing the buffers is finished• “pthread_join” would be called to terminate that thread• Two threads are finished then all the remote sensing image

data are completely processed and the program will be end by calling “return”