Graphics Reference
In-Depth Information
38.10 Discussion and Further Reading
The design of graphics hardware is a special, but important, case of computer
architecture design. Anyone interested in studying the subject more closely should
first read the classic book by Hennessy and Patterson [HP96], where tradeoffs of
the kind discussed in this chapter are covered in great detail.
Even if you don't want to design the next great GPU, you should be familiar
with some aspects of architecture so that you can better understand how they influ-
ence your use of the GPU you've got. A great starting point is Ulrich Drepper's
“What Every Programmer Should Know About Memory” [Dre07].
For years, computers have improved—processor cores are faster, bandwidth
is greater, networks are faster, memory is larger and less expensive—and many
of these improvements have followed exponential patterns, the classic being
Moore's Law. But the observation that everything is improving exponentially
masks the critical point that the constants in the exponents are different: GPUs
have improved faster than CPUs, for instance. Even within a single device like a
GPU, differing constants shift the landscape. If you want to understand how GPUs
will change in the future, these differing constants (and the eventual leveling off
from exponential growth) will be important predictors.
38.11 Exercises
Exercise 38.1: Recall that annual growth at rate r for y years results in t = r y
compound growth (see Section 38.2). For example, 1.5 x annual growth for five
years results in 7.59 = 1.5 5 compound growth. Derive the formula that gives r
as a function of y and t . Using this formula, compute the annual growth rates for
ten-year compound growths of 10 x , 100 x , and 1,000 x .
Exercise 38.2: Accurate performance measurement is a great way to under-
stand the implementation of an architecture, and it's a prerequisite to tuning your
own graphics programs. Using either Direct3D or OpenGL, write a program that
initializes graphics state, performs a simple rendering task repeatedly for a spec-
ified number of times, and then returns the time required per iteration. Use this
program to measure the rate that triangles of various sizes are rendered. Is there
a size below which there is no significant change in performance? What might
explain this?
Here are a few tips for accurate performance measurement.
• Neither Direct3D nor OpenGL provides timers, so you'll have to learn your
operating system's commands for this.
• To get accurate timings you must flush the GPU before starting the timer
and before stopping it. OpenGL provides the glFlush() command for this
purpose. Why is this important?
• Don't swap buffers during a timing test.
• Don't run other applications during a timing test.
• Run your test repeatedly to test for consistency.
Think about other things that might affect your measurements.
Exercise 38.3: Look for performance dependencies on data coherence,
using the framework developed in the preceding exercise. Using linear image
 
 
Search WWH ::




Custom Search