Tim Madden ODG/XSD.  Graphics Processing Unit  Graphics card on your PC.  “Hardware accelerated graphics”  Video game industry is main driver.  More.

Slides:



Advertisements
Similar presentations
FatMax Licensed under a Creative Commons Attribution-NonCommercial-ShareAlike 2.5 LicenseCreative Commons Attribution-NonCommercial-ShareAlike 2.5.
Advertisements

Click Here to Begin. Objectives Purchasing a PC can be a difficult process full of complex questions. This Computer Based Training Module will walk you.
GPGPU Introduction Alan Gray EPCC The University of Edinburgh.
GRAPHICS AND COMPUTING GPUS Jehan-François Pâris
Acceleration of the Smith– Waterman algorithm using single and multiple graphics processors Author : Ali Khajeh-Saeed, Stephen Poole, J. Blair Perot. Publisher:
OS Case Study: The Xbox 360  Instructor: Rob Nash  Readings: See citations in the slides.
Introduction to Shader Programming
CUDA (Compute Unified Device Architecture) Supercomputing for the Masses by Peter Zalutski.
GCSE Computing - The CPU
Computer Science – Game DesignUC Santa Cruz Adapted from Jim Whitehead’s slides Shaders Feb 18, 2011 Creative Commons Attribution 3.0 (Except copyrighted.
GPGPU overview. Graphics Processing Unit (GPU) GPU is the chip in computer video cards, PS3, Xbox, etc – Designed to realize the 3D graphics pipeline.
Graphical Tree-Based Scientific Calculator: CalcuWiz Will Ryan Christian Braunlich.
Graphics and Multimedia In visual Studio. Net (C#)
Klas Skogmar, Lund Institute of Technology Real-time Video Effects Using Programmable Graphics Cards Master of Science Thesis Klas Skogmar
Shekoofeh Azizi Spring  CUDA is a parallel computing platform and programming model invented by NVIDIA  With CUDA, you can send C, C++ and Fortran.
The Internal Components of a Personal Computer (PC)
GAM531 DPS931 – Week 1 Introduction. Professors Joseph Hughes Info: scs.senecac.on.ca/~jp.hughes T2104 Roles: Primary Lecturer.
CSU0021 Computer Graphics © Chun-Fa Chang CSU0021 Computer Graphics September 10, 2014.
Training Program on GPU Programming with CUDA 31 st July, 7 th Aug, 14 th Aug 2011 CUDA Teaching UoM.
Unit 2 - Hardware Microprocessors & CPUs. What is a microprocessor? ● The brain of the computer, the microprocessor is responsible for organizing and.
Shared memory systems. What is a shared memory system Single memory space accessible to the programmer Processor communicate through the network to the.
Translate the following message:
Computer Graphics Graphics Hardware
Tim Madden ODG/XSD.  Graphics Processing Unit  Graphics card on your PC.  “Hardware accelerated graphics”  Video game industry is main driver.  More.
Tim Madden ODG/XSD.  Graphics Processing Unit  Graphics card on your PC.  “Hardware accelerated graphics”  Video game industry is main driver.  More.
Instructor Notes GPU debugging is still immature, but being improved daily. You should definitely check to see the latest options available before giving.
1 ITCS 4/5010 GPU Programming, UNC-Charlotte, B. Wilkinson, Jan 14, 2013 CUDAProgModel.ppt CUDA Programming Model These notes will introduce: Basic GPU.
CUDA All material not from online sources/textbook copyright © Travis Desell, 2012.
GPU Architecture and Programming
Introduction What is GPU? It is a processor optimized for 2D/3D graphics, video, visual computing, and display. It is highly parallel, highly multithreaded.
CHAPTER 3 Getting Player Input XNA Game Studio 4.0.
OpenCL Joseph Kider University of Pennsylvania CIS Fall 2011.
Source Controller software Ianos Schmidt The University of Iowa.
TESTING THE WIRELESS NETWORK INTERFACE CARD
GAM666 – Introduction To Game Programming ● Programmer's perspective of Game Industry ● Introduction to Windows Programming ● 2D animation using DirectX.
Introduction to Game Programming Pertemuan 11 Matakuliah: T0944-Game Design and Programming Tahun: 2010.
Ray Tracing using Programmable Graphics Hardware
TU STORM The TU STORM Robot Controller: Innovation First Mini Robot Controller (Microchip PIC18F8520) Programmable in C Using MPLAB IDE.
11 Computers, C#, XNA, and You Session 1.1. Session Overview  Find out what computers are all about ...and what makes a great programmer  Discover.
Computer Hardware & Processing Inside the Box CSC September 16, 2010.
GPU Computing for GIS James Mower Department of Geography and Planning University at Albany.
Computer Science – Game DesignUC Santa Cruz Tile Engine.
1 ITCS 4/5145GPU Programming, UNC-Charlotte, B. Wilkinson, Nov 4, 2013 CUDAProgModel.ppt CUDA Programming Model These notes will introduce: Basic GPU programming.
COMP 175 | COMPUTER GRAPHICS Remco Chang1/XX13 – GLSL Lecture 13: OpenGL Shading Language (GLSL) COMP 175: Computer Graphics April 12, 2016.
NVIDIA® TESLA™ GPU Based Super Computer By : Adam Powell Student # For COSC 3P93.
Heterogeneous Processing KYLE ADAMSKI. Overview What is heterogeneous processing? Why it is necessary Issues with heterogeneity CPU’s vs. GPU’s Heterogeneous.
OpenCL. Sources Patrick Cozzi Spring 2011 NVIDIA CUDA Programming Guide CUDA by Example Programming Massively Parallel Processors.
Computer Engg, IIT(BHU)
Computer Graphics Graphics Hardware
CUDA C/C++ Basics Part 2 - Blocks and Threads
CPU Lesson 2.
Unit 2 Technology Systems
GCSE Computing - The CPU
Unit 20 – Computer Game Platforms & Technology – Software Technology
Java Programming: From the Ground Up
CUDA Introduction Martin Kruliš by Martin Kruliš (v1.1)
Chapter 10: Computer systems (1)
ECE 103 Engineering Programming Chapter 5 Programming Languages
Our Graphics Environment
What is GPU? how does it work?
OpenCL 소개 류관희 충북대학교 소프트웨어학과.
Basic CUDA Programming
Drill Translate the following message:
CS 286 Computer Organization and Architecture
Computer Basics.
Presented by: Isaac Martin
Unit 20 Software Part 2.
Unit 20 Software Part 2.
Computer Graphics Graphics Hardware
GCSE Computing - The CPU
Presentation transcript:

Tim Madden ODG/XSD

 Graphics Processing Unit  Graphics card on your PC.  “Hardware accelerated graphics”  Video game industry is main driver.  More recently used for non-graphics applications.

 Card on the PCI-Express buss.  GPU card contains its own RAM and processor(s).  What is a CORE?  A core is an ALU, arithmetic logic unit.  ALU is basically a single processor that can run a computer program.  Modern PCs have “Quad Core.” Basically 4 processors. This refers to the processor on the motherboard that runs Windows.  GPU has hundreds of Cores!

 Programmer uses some API to write graphics code  Open GL: Silicon Graphics Corp. Now a common standard on most computers.  Direct X: X-Box, Windows  Programmer calls functions with above APIs and compiles.  If the computer has proper GPU, (“Direct 3D compatible” etc.) the code magically runs on the GPU. Compiled program can link at runtime to libraries that run on the GPU. “Hardware Acceleration”  These APIs only useful for drawing and responding to the mouse, or joystick etc.  MSDN- us/directx/default

 DirectX, OpenGL is predefined set of graphics functions that can run on GPU  Nvidea created CUDA for non-graphics applications for GPUs  CUDA allows writing a C++ program to run on the GPU.  Cross-compiler- You write code by typing into a windows box. You compile on the windows box. The code runs on the GPU.  CUDA tools interfaces with Microsoft compiler.  CUDA allows the creation of your OWN functions that run on the GPU, not just whatever DirectX gives you.

 Parallel programming?  What is a “Thread?”  A sequence of commands in a program that run after another. void oneThread(int N) { int counter=0; while(1) { printf(“Thread %d Count %d\n”, N, counter++); Sleep(1000); }

 A typical program on a PC has many threads running at once.  An EPICS IOC has about 20 threads running.  This Powerpoint program is running 8 threads (at time of typing this sentence). void oneThread(int N) { int counter=0; while(1) { printf(“Thread %d Count %d\n”, N, counter++); Sleep(1000); } void oneThread(int N) { int counter=0; while(1) { printf(“Thread %d Count %d\n”, N, counter++); Sleep(1000); } void oneThread(int N) { int counter=0; while(1) { printf(“Thread %d Count %d\n”, N, counter++); Sleep(1000); } void oneThread(int N) { int counter=0; while(1) { printf(“Thread %d Count %d\n”, N, counter++); Sleep(1000); } void oneThread(int N) { int counter=0; while(1) { printf(“Thread %d Count %d\n”, N, counter++); Sleep(1000); } void oneThread(int N) { int counter=0; while(1) { printf(“Thread %d Count %d\n”, N, counter++); Sleep(1000); } void oneThread(int N) { int counter=0; while(1) { printf(“Thread %d Count %d\n”, N, counter++); Sleep(1000); } void oneThread(int N) { int counter=0; while(1) { printf(“Thread %d Count %d\n”, N, counter++); Sleep(1000); } void oneThread(int N) { int counter=0; while(1) { printf(“Thread %d Count %d\n”, N, counter++); Sleep(1000); }

 The more threads running, the slower each thread.  Solution is to add more processors. A “core” is a processor.  “Quad Core” PC has 4 processors, each running hundreds of threads. void oneThread(int N) { int counter=0; while(1) { printf(“Thread %d Count %d\n”, N, counter++); Sleep(1000); } void oneThread(int N) { int counter=0; while(1) { printf(“Thread %d Count %d\n”, N, counter++); Sleep(1000); } void oneThread(int N) { int counter=0; while(1) { printf(“Thread %d Count %d\n”, N, counter++); Sleep(1000); } void oneThread(int N) { int counter=0; while(1) { printf(“Thread %d Count %d\n”, N, counter++); Sleep(1000); } void oneThread(int N) { int counter=0; while(1) { printf(“Thread %d Count %d\n”, N, counter++); Sleep(1000); } void oneThread(int N) { int counter=0; while(1) { printf(“Thread %d Count %d\n”, N, counter++); Sleep(1000); } PROCESSOR void oneThread(int N) { int counter=0; while(1) { printf(“Thread %d Count %d\n”, N, counter++); Sleep(1000); } void oneThread(int N) { int counter=0; while(1) { printf(“Thread %d Count %d\n”, N, counter++); Sleep(1000); } void oneThread(int N) { int counter=0; while(1) { printf(“Thread %d Count %d\n”, N, counter++); Sleep(1000); } void oneThread(int N) { int counter=0; while(1) { printf(“Thread %d Count %d\n”, N, counter++); Sleep(1000); } void oneThread(int N) { int counter=0; while(1) { printf(“Thread %d Count %d\n”, N, counter++); Sleep(1000); } void oneThread(int N) { int counter=0; while(1) { printf(“Thread %d Count %d\n”, N, counter++); Sleep(1000); } PROCESSOR void oneThread(int N) { int counter=0; while(1) { printf(“Thread %d Count %d\n”, N, counter++); Sleep(1000); } void oneThread(int N) { int counter=0; while(1) { printf(“Thread %d Count %d\n”, N, counter++); Sleep(1000); } void oneThread(int N) { int counter=0; while(1) { printf(“Thread %d Count %d\n”, N, counter++); Sleep(1000); } void oneThread(int N) { int counter=0; while(1) { printf(“Thread %d Count %d\n”, N, counter++); Sleep(1000); } void oneThread(int N) { int counter=0; while(1) { printf(“Thread %d Count %d\n”, N, counter++); Sleep(1000); } void oneThread(int N) { int counter=0; while(1) { printf(“Thread %d Count %d\n”, N, counter++); Sleep(1000); } PROCESSOR void oneThread(int N) { int counter=0; while(1) { printf(“Thread %d Count %d\n”, N, counter++); Sleep(1000); } void oneThread(int N) { int counter=0; while(1) { printf(“Thread %d Count %d\n”, N, counter++); Sleep(1000); } void oneThread(int N) { int counter=0; while(1) { printf(“Thread %d Count %d\n”, N, counter++); Sleep(1000); } void oneThread(int N) { int counter=0; while(1) { printf(“Thread %d Count %d\n”, N, counter++); Sleep(1000); } void oneThread(int N) { int counter=0; while(1) { printf(“Thread %d Count %d\n”, N, counter++); Sleep(1000); } void oneThread(int N) { int counter=0; while(1) { printf(“Thread %d Count %d\n”, N, counter++); Sleep(1000); } PROCESSOR

 Make a thread, that in turn makes a new thread, etc…  Void haveChildren()  Update global thread counter, and printf.  Sleep 500ms  Call haveChildren() on a New thread.  Display a window  If OK is hit on window, then exit(0)  When haveChildren is called, an infinite number of threads is created. An infinite number of windows will display.  Threads show in Task Manager

 Instead of running 100’s of threads, let us run millions of threads!  GPU can have 1024 processors. Each processor can run 1000’s of threads at once.  Adding more processors speeds up the program.

Thread

// My image data Short *image = new short[1024*1024]; Int k For (k=0; k<1024*1024; k++) { image[k] = image[k] + 1; }  On the host (not the GPU) we write a single thread to process an image.  1 pixel at a time.  For a 1kx1k image, this is 1M operations in sequence.

 Write code for a single pixel, and call the code in 1M separate threads.  Cuda will dole out threads to Cores for you on the GPU.  Pixel X runs on thread X. __global__ void subtractDarkImage_k( unsigned short *d_Dst, unsigned short *d_Src, int dataSize ){ const int i = blockDim.x * blockIdx.x + threadIdx.x; if(i >= dataSize) return; d_Dst[i] =d_Src[i] +1; }

 Install Microsoft compiler.  Download Cuda and install.  Open examples.  Cuda plugs into Microsoft Visual Studio.  When you build, both the host code and GPU code are built. .cpp runs on the host..cu and.cuh runs on GPU

 Plugin to Area Detector to run calculations on GPU.  When new image comes from detector:  Host sends image to GPU  GPU does calcs.  Host retrieves result from GPU..  Host sends results to EPICS etc.  GPU code compiled as DLL.  Epics Area Detector loads DLL and runs.  Allows arbitrary calculations on GPU. Just make a new DLL.  Separates cross compile of GPU code, from EPICS build.  One Area Detector plugin for all GPU calculations.  Can define EPICS variables in the DLL. Host queries DLL for parameters and connects EPICS PVs.

 Sending image to GPU and back.  Dark Subtraction on Host versus GPU.  Fast convolution on GPU versus Host.  Running several programs on GPU at once.