Previous | Next --- Slide 21 of 54
Back to Lecture Thumbnails
Sherry

Will this new "compute mode" be a replacement or complement to traditional OpenGL in Graphics? Games like World of Warcraft still requires DirectX or OpenGL support instead of CUDA or OpenCL.

kayvonf

Real-time graphics programs like games are still written using systems like OpenGL and Direct3D. There are a lot of reasons why a graphics-specific system is a better framework for writing graphics programers than a generate compute-centric one.

The biggest answer is performance: there are many specialized execution units in a GPU that remain only accessible through graphics modes: such as tessellation units, Z-buffers, occlusion culling, etc. These units provided highly efficient hardware for common parts of rendering algorithms. Similarly, GPUs provide a very highly optimized implementation of the graphics pipeline, something that would be very hard to equal if implemented by hand. (In fact, you are implementing a mini-rendering by hand in assignment 2.)

You may be interested in the slides from 15-869 which talk in great detail about how GPUs execute graphics operations very efficiently.

http://15869.courses.cs.cmu.edu

kayvonf

Question: Would you consider the introduction of GPU compute mode an abstraction or implementation change to a GPU?

VP7

I consider it as more of an abstraction (change in abstraction) than an implementation change. It is a totally different programming interface for a heterogeneous parallel programming system (?)

Let me try to explain my view, from the perspective of a non-graphics person. If you are a non-graphics person, you would see GPUs as a heterogeneous many core system which drastically boosts up general purpose computations' throughput.

  1. A graphics pipeline in general should be treated as an abstract machine. (As described here: )
  2. The APIs like OpenGL and Direct3D lets you program that structure treating each of the stages as black boxes. Imagine using handcrafted C++ code for same? (scary!). On the contrary a computer vision enthusiast's friend OpenCV cannot be seen like an abstract machine, as it is only a grab bag of algorithms which can be obviously mapped on to a GPU. (How? Is the existing abstraction of a graphics pipeline directly handy? )
  3. But like any other system in the universe, over the years the pipeline evolved with more and more flexibilities but still the abstractions remain unchanged.
  4. GPUs essentially have a number of fixed function ASICs to which these blocks get mapped to efficiently.
  5. Then came the realization that these ASICs are well capable of doing a lot of general purpose computations as the domain's over which the GPU's capability could be used, expanded quickly. But if we use the same abstractions, then we will be rasterizing triangles for anything and everything that is not even close to graphics.

Kayvon says, "We are the victims of our own success".

Compute mode is probably a (partial) solution for this

  1. Compute mode adopts the philosophy of streaming programming model. Graphics also have streaming aspects. (so Yeeeh!) (CUDA <==> OpenCL || Microsoft Compute Shaders).
  2. It is a low abstraction, which uses SPMD constructs (kernel) for efficient mapping on to the underlying hardware.
  3. The additional pain here probably was the design/ SPMD extension of the compilers for the same. (I am not sure if there is a PTX like intermediate byte code format for OpenCl or MS Compute Shaders)

Question : Can anyone envision a single / unified abstract machine which could scale intelligently for applications in fundamentally different domains? (Like Graphics and computational finance).

Future Trend: ????

Recommended Resources

  1. Compute-Mode GPU Programming Interfaces ,visual computing systems
  2. A familiar face and voice.
  3. sounds familiar again?