Graphics Hardware. Instructor Stephen J. Guy

Similar documents
X. GPU Programming. Jacobs University Visualization and Computer Graphics Lab : Advanced Graphics - Chapter X 1

2.11 Particle Systems

Lecture 2. Shaders, GLSL and GPGPU

Graphics Processing Unit Architecture (GPU Arch)

Graphics Hardware, Graphics APIs, and Computation on GPUs. Mark Segal

Spring 2009 Prof. Hyesoon Kim

Real - Time Rendering. Graphics pipeline. Michal Červeňanský Juraj Starinský

Graphics Hardware. Graphics Processing Unit (GPU) is a Subsidiary hardware. With massively multi-threaded many-core. Dedicated to 2D and 3D graphics

Spring 2011 Prof. Hyesoon Kim

Real-Time Rendering (Echtzeitgraphik) Michael Wimmer

Shaders. Slide credit to Prof. Zwicker

CS451Real-time Rendering Pipeline

CS GPU and GPGPU Programming Lecture 2: Introduction; GPU Architecture 1. Markus Hadwiger, KAUST

Introduction to Shaders.

Rendering. Converting a 3D scene to a 2D image. Camera. Light. Rendering. View Plane

Tutorial on GPU Programming #2. Joong-Youn Lee Supercomputing Center, KISTI

Models and Architectures

Shaders (some slides taken from David M. course)

Programming Graphics Hardware

Evolution of GPUs Chris Seitz

Introduction to Computer Graphics with WebGL

CS230 : Computer Graphics Lecture 4. Tamar Shinar Computer Science & Engineering UC Riverside

Pipeline Operations. CS 4620 Lecture 14

Models and Architectures. Ed Angel Professor of Computer Science, Electrical and Computer Engineering, and Media Arts University of New Mexico

C P S C 314 S H A D E R S, O P E N G L, & J S RENDERING PIPELINE. Mikhail Bessmeltsev

CS427 Multicore Architecture and Parallel Computing

Pipeline Operations. CS 4620 Lecture Steve Marschner. Cornell CS4620 Spring 2018 Lecture 11

Graphics Hardware. Computer Graphics COMP 770 (236) Spring Instructor: Brandon Lloyd 2/26/07 1

Rasterization Overview

Sung-Eui Yoon ( 윤성의 )

Rendering Objects. Need to transform all geometry then

CSE4030 Introduction to Computer Graphics

1.2.3 The Graphics Hardware Pipeline

Could you make the XNA functions yourself?

CSE 591: GPU Programming. Introduction. Entertainment Graphics: Virtual Realism for the Masses. Computer games need to have: Klaus Mueller

Programmable GPUs. Real Time Graphics 11/13/2013. Nalu 2004 (NVIDIA Corporation) GeForce 6. Virtua Fighter 1995 (SEGA Corporation) NV1

CS 354R: Computer Game Technology

COMP371 COMPUTER GRAPHICS

Interactive Cloth Simulation. Matthias Wloka NVIDIA Corporation

The Graphics Pipeline

CS452/552; EE465/505. Clipping & Scan Conversion

SHADER PROGRAMMING. Based on Jian Huang s lecture on Shader Programming

Motivation Hardware Overview Programming model. GPU computing. Part 1: General introduction. Ch. Hoelbling. Wuppertal University

Ciril Bohak. - INTRODUCTION TO WEBGL

CS450/550. Pipeline Architecture. Adapted From: Angel and Shreiner: Interactive Computer Graphics6E Addison-Wesley 2012

General Purpose Computation (CAD/CAM/CAE) on the GPU (a.k.a. Topics in Manufacturing)

CS4620/5620: Lecture 14 Pipeline

The Traditional Graphics Pipeline

Scanline Rendering 2 1/42

CHAPTER 1 Graphics Systems and Models 3

CS130 : Computer Graphics. Tamar Shinar Computer Science & Engineering UC Riverside

CSE 167: Introduction to Computer Graphics Lecture #5: Rasterization. Jürgen P. Schulze, Ph.D. University of California, San Diego Fall Quarter 2015

GPU Architecture and Function. Michael Foster and Ian Frasch

Optimisation. CS7GV3 Real-time Rendering

Performance OpenGL Programming (for whatever reason)

The Traditional Graphics Pipeline

CIS 581 Interactive Computer Graphics

Beginning Direct3D Game Programming: 1. The History of Direct3D Graphics

Graphics Pipeline & APIs

GPGPU. Peter Laurens 1st-year PhD Student, NSC

CSE 591/392: GPU Programming. Introduction. Klaus Mueller. Computer Science Department Stony Brook University

Cornell University CS 569: Interactive Computer Graphics. Introduction. Lecture 1. [John C. Stone, UIUC] NASA. University of Calgary

3D Graphics and OpenGl. First Steps

Copyright Khronos Group, Page Graphic Remedy. All Rights Reserved

Module Contact: Dr Stephen Laycock, CMP Copyright of the University of East Anglia Version 1

Programmable GPUS. Last Time? Reading for Today. Homework 4. Planar Shadows Projective Texture Shadows Shadow Maps Shadow Volumes

Optimizing DirectX Graphics. Richard Huddy European Developer Relations Manager

Supplement to Lecture 22

Hardware Accelerated Volume Visualization. Leonid I. Dimitrov & Milos Sramek GMI Austrian Academy of Sciences

CS8803SC Software and Hardware Cooperative Computing GPGPU. Prof. Hyesoon Kim School of Computer Science Georgia Institute of Technology

Direct Rendering of Trimmed NURBS Surfaces

- Rasterization. Geometry. Scan Conversion. Rasterization

CS130 : Computer Graphics Lecture 2: Graphics Pipeline. Tamar Shinar Computer Science & Engineering UC Riverside

Computer Graphics and Visualization. Graphics Systems and Models

Shader Series Primer: Fundamentals of the Programmable Pipeline in XNA Game Studio Express

The Traditional Graphics Pipeline

Architectures. Michael Doggett Department of Computer Science Lund University 2009 Tomas Akenine-Möller and Michael Doggett 1

ECE 571 Advanced Microprocessor-Based Design Lecture 20

UberFlow: A GPU-Based Particle Engine

Mattan Erez. The University of Texas at Austin

OpenGL: Open Graphics Library. Introduction to OpenGL Part II. How do I render a geometric primitive? What is OpenGL

2: Introducing image synthesis. Some orientation how did we get here? Graphics system architecture Overview of OpenGL / GLU / GLUT

The Application Stage. The Game Loop, Resource Management and Renderer Design

Chapter 1 Introduction

Graphics Pipeline & APIs

CS 381 Computer Graphics, Fall 2008 Midterm Exam Solutions. The Midterm Exam was given in class on Thursday, October 23, 2008.

1. Introduction 2. Methods for I/O Operations 3. Buses 4. Liquid Crystal Displays 5. Other Types of Displays 6. Graphics Adapters 7.

NVIDIA nfinitefx Engine: Programmable Pixel Shaders

Shaders CSCI 4229/5229 Computer Graphics Fall 2017

Programming shaders & GPUs Christian Miller CS Fall 2011

Optimizing Games for ATI s IMAGEON Aaftab Munshi. 3D Architect ATI Research

Current Trends in Computer Graphics Hardware

OUTLINE. Learn the basic design of a graphics system Introduce pipeline architecture Examine software components for a graphics system

ECE 571 Advanced Microprocessor-Based Design Lecture 18

CS770/870 Spring 2017 Open GL Shader Language GLSL

CS770/870 Spring 2017 Open GL Shader Language GLSL

Advanced Computer Graphics (CS & SE ) Lecture 7

A Bandwidth Effective Rendering Scheme for 3D Texture-based Volume Visualization on GPU

frame buffer depth buffer stencil buffer

Computer Graphics (CS 543) Lecture 1 (Part 1): Introduction to Computer Graphics

Transcription:

Instructor Stephen J. Guy

Overview What is a GPU Evolution of GPU GPU Design Modern Features Programmability! Programming Examples

Overview What is a GPU Evolution of GPU GPU Design Modern Features Programmability! Programming Examples

Graphics Processing Unit What s a GPU? GPU = Graphics Processing Unit GPU : dedicated graphics rendering device CPU = Central Processing Unit A GPU implements a number of graphics primitive operations in a way that makes running them much faster than drawing directly to the screen with the host CPU.

A simple graphics system Frame buffer can be part of the main memory Similar layout to one in rasterization assignment Scan Controller CPU Main Memory Frame buffer System bus Problem?

Dedicated memory Video memory On-board frame buffer Much faster access Scan Controller Frame buffer CPU Main Memory System bus Can this be improved still?

Graphics Accelerator A dedicated processor for graphics processing Graphics Memory/ Frame buffer Graphics Processor Scan Controller CPU Main Memory System bus

GPUs!

The GPU Traditional Requirements (until early 90s) Drive display Simple video decoding New developments Feature sizes and pipeline 3D Graphics Computations Transformation and lighting Per-pixel effects High-definition TV

3D Graphics Card: ATI Radeon

The GPU What does the GPU do?

Graphics Accelerator A dedicated processor for graphics processing Graphics Memory/ Frame buffer Graphics Processor Scan Controller CPU Main Memory System bus Where s the bottleneck?

Graphics Bus Interface PCI based technology Graphics Memory/ Frame buffer Other Peripherals Graphics Processor Scan Controller PCI Bus 132 MB/s CPU System Bus 800MB/s Main Memory

Graphics Bus Interface PCI Bus becomes the bottleneck! Many devices are using it There is a lot of stuff needs to be transmitted from main memory to graphics memory (geometry, textures, etc) Example: 2M triangle, 90 Bytes each 180MB > 132 MB (PCI bandwidth)

Accelerated Graphics Port (AGP) A dedicated bus that allows direct access of main memory Graphics Memory/ Frame buffer Other Peripherals Graphics Processor AGP 1x: 518 MB/s CPU Scan Controller Fast!!! Main Memory PCI Bus 132 MB/s

AGP AGP 1x is four times as fast compared to PCI! Peaked at APG 8x No more local bus congestion! More geometry can be processed! Direct execution of many graphics operations from main memory

PCI Express Provide very high bandwidth to CPU Standard bus for GPUs as of 2009 Throughput varies with PCIe version

Evolution

Overview What is a GPU Evolution of GPU GPU Design Modern Features Programmability! Programming Examples

Recall the Generic Graphics Pipeline 3D Geometric Primitives Modeling Transformation Lighting Viewing Transformation Projection Transformation Transform in 3D word coordinate system Illuminate according to lighting and reflectance Transform into 3D camera coordinate system Transform into 2D screen coordinate system Clipping Scan Conversion Clip primitives outside camera s view Draw Pixels (also texturing, hidden surface, ) 20 Image 10/6/2010

GPU pipeline Program/ API [example from Mark Colbert] Driver GPU Front End CPU GPU Bus Vertex Processing Primitive Assembly Rasterization & Interpolation Fragment Processing Raster Operations Framebuffer

GPU pipeline Program Your Program API Either OpenGL or DirectX Interface Program/ API --------- Driver Black-box Implementations are Company Secrets Largest Bottleneck in many GPU programs Driver

GPU pipeline GPU Front End Receives commands & data from driver PCI Express helps at this stage GPU Front End Vertex Processing Normally performs 3D 2D transformations Programmable Vertex Processing

GPU pipeline Primitive Assembly Compiles Vertices into Points, Lines and/or Polygons Link elements and set rasterizer Primitive Assembly Rasterization Computes fragments (pixels) Barycentric Coordinates Depth, etc Interpolation (texture coordinates and colors) Rasterization & Interpolation Fragment Processing Per-pixel computations (e.g. lighting) Programmable Fragment Processing

GPU pipeline Raster Operations Depth Checking Check framebuffer to see if lesser depth already exists (Z- Buffer) Limited Programmability Blending Use alpha channel to combine colors already in the framebuffer Limited Programmability

GPU pipeline Program/ API [example from Mark Colbert] Driver GPU Front End CPU GPU Bus Vertex Processing Primitive Assembly Rasterization & Interpolation Fragment Processing Raster Operations Framebuffer

example Bus Program/ API Driver GPU Front End Vertex Processing Code Snippet. glbegin(gl_triangles); gltexcoord2f(1,0); glvertex3f(0,1,0); gltexcoord2f(0,1); glvertex3f(-1,-1,0); gltexcoord2f(0,0); glvertex3f(1,-1,0); glend(); [example from Mark Colbert] Primitive Assembly Rasterization & Interpolation Fragment Processing Raster Operations Framebuffer(s)

GPU example Program/ API [example from Mark Colbert] Driver Bus GPU Front End 01001001100. Vertex Processing Primitive Assembly Rasterization & Interpolation Fragment Processing Raster Operations Framebuffer(s)

example Program/ API [example from Mark Colbert] Driver Bus GPU Front End Vertex Processing viewing frustum Primitive Assembly Rasterization & Interpolation Fragment Processing Raster Operations Framebuffer(s)

example Program/ API [example from Mark Colbert] Driver Bus GPU Front End Vertex Processing Primitive Assembly screen space Rasterization & Interpolation Fragment Processing Raster Operations Framebuffer(s)

example Program/ API [example from Mark Colbert] Driver Bus GPU Front End Vertex Processing Primitive Assembly framebuffer Rasterization & Interpolation Fragment Processing Raster Operations Framebuffer(s)

example Program/ API [example from Mark Colbert] Driver Bus GPU Front End Vertex Processing Primitive Assembly framebuffer Rasterization & Interpolation Fragment Processing Raster Operations Framebuffer(s)

Overview What is a GPU Evolution of GPU GPU Design Modern Features Programmability! Programming Examples

Programmable GPU Why do we want programmability?

Shaders Small programs that run on GPU Definition of small evolves quickly Two main types: Vertex Shaders Input: Vertex Positions Output: New Vertex Positions Pixel /Fragment Shaders Input: Vertex Colors, Normals, etc Output: Pixel Color A quickly evolving field Geometry Shaders slowly becoming common Input: Mesh/Vertex Positions Output: New Mesh/Vertex Positions

GPU pipeline Program/ API [example from Mark Colbert] Driver GPU Front End CPU GPU Bus Vertex Processing Primitive Assembly Rasterization & Interpolation Fragment Processing Raster Operations Framebuffer

GPU pipeline Vertex Processing Vertex Processing Normally performs transformations Programmable vertex POSITION, NORMAL, BINORMAL*, TANGENT*, TEXCOORD[0-7], COLOR[0-1], PSIZE Vertex Processor shader textures data for rasterization PSIZE FOG data for interpolation POSITION TEXCOORD[0-7] COLOR[0-1]

GPU pipeline Fragment Processing Fragment Processing Programmable rasterized data DEPTH interpolated data TEXCOORD[0-7] COLOR[0-1] Fragment Processor shader data for raster ops DEPTH COLOR[0-3] textures

Programming Shaders Can be written in assembly language for specific GPU High level languages exist Better portability Slightly slower Much easier to code Most are small variants on C Cg C for Graphics (DirectX and OpenGL) HLSL High Level Shader Language (DirectX) GLSL OpenGL Shader Language (OpenGL)

Cg Language targeted specifically at graphics programming Vectors built in: i.e. float2, float3, float4 float4 v = float4(a,b,c,d); v[0], v[1], v[2], or v[3] v.xyzw, v.xxxx, v.wyzx v.rgba,.

Cg cont. Matrix built in e.g. float4x4 float4 v = float4(a,b,c,d); //Matrix is 4 vectors float4x4 m = float4x4(v,v,v,v); Linear algebra built in dot product, matrix-vector multiplication Geometric processing distance, length, noramal, refact Most of math.h Optimized version (2 nd order talyer approximation)

Vertex Shaders Example Time! Cg Vertex Shader

Vertex Shaders Commonly used for Environmental effects Complex character animation Procedural deformation Motion blur Custom Lighting

Pixel Shaders Example Time! Cg Pixel Shader

What Pixel Shaders Can Do Bump Mapping Per-pixel lighting Cartoon rendering Isotropic BRDF(Bi-Directional Reflective Distribution Function) Based Lighting GPU ray-tracing

More Shaders Parametrically specify complex textures Stages of a Procedural Brick Shader

Complex Examples Reflective bump-mapping

Far-cry Screen Shot

ATI Research Groups NPR

GPGPU How does GPU growth compare to GPU?

Why are GPUs so fast!? Hardware is designed to exploit parallelism! Same exact shader running over millions of vertexies or pixels Known as SIMD (Single Instruction Multiple Data) If-statements diminish effectiveness Best performaning Shaders are aware of this.

Modern Parallelism + pipelining: ATI Radeon 9700 4 vertex pipelines 8 pixel pipelines

GPGPU General Purpose GPU Program graphics card for non-graphics GPGPU programs must be aware of SIMD nvidia has popular language specifically for this CUDA nvidia.com/cuda for more details

More GPGPU Links nvidia ATI http://developer.nvidia.com/ http://www.ati.com/developer/ General Purpose GPU Programming http://www.gpgpu.org

Review What s Video Memory?