A Look At AMD's GPU Performance Studio 2



Company: AMD
Author: James Prior
Editor: Sean Ridgeley
Date: April 4th, 2013

The value of optimization

AMD had an interesting presentation on the morning of Wednesday, March 28th at GDC 2013. It was all about the tools used to optimize Far Cry 3, Left 4 Dead 2 and Assassin's Creed 3 and the room was packed, more than full attendance with people lining three walls. They weren't just there because one lucky attendee would win a Sapphire Radeon HD 7970 card, but because GPU Perfstudio 2 was of massive interest to the population of GDC '13. The presentation was delivered by AMD's Gordon Selley, Senior Member of technical staff and team leader for GPU PerfStudio 2; Rich Geldreich, Software Engineer, Valve Corp. and Jean-Francois St-Amour, Lead Graphics Programmer, Ubisoft Montreal.

Click to Zoom & Enlarge
Click to Zoom & Enlarge

For developers working with games, AMD offer two free tools: CodeXL and GPU PerfStudio 2. These are slightly different tools: CodeXL is more aimed at heterogeneous compute solutions with the ability to look at OpenCL and OpenGL with profiling across both CPU and GPU (i.e. perfect for APUs); GPU PerfStudio 2 helps speed up the process of finding and fixing problems with an integrated frame profile and debugger, plus a shader debugger.

Click to Zoom & Enlarge

GPU PerfStudio 2 permits developers to see instantly inside their running code and quite easily track down problems and issues. It runs as a client/server style app, reporting via web application -- you don't need to debug on the same machine if you don't want to. Developers can put in their 90 hour weeks over VPN or from conference rooms, perhaps leveraging high performance workstations located in the datacenter instead of under the desk.

Click to Zoom & Enlarge
Click to Zoom & Enlarge

The presentation first used Assassin's Creed 3 sample scenes to demonstrate how to use GPU PerfStudio2 and display the useful information contained within. API tracing allowed the contents of multiple command lists and the execution sequence to be seen. Combined with GPU execution time visualization plots, high cost code can be identified and addressed.

A common sentiment in the session was "all tools are special flowers". The aim of GPU PerfStudio 2 is to try and reduce the chopping and changing of applications to solve problems, reducing the number of tools an individual needs to be intimately familiar with to be effective at their task. Special flowers do their one thing great, but a vase full of special flowers can be tedious if the colors, shapes, and scents don't match up. This view was expressed by Jean-Francois St-Amour of Ubisoft Montreal, and followed by a simple statement: "GPU PerfStudio2 was the most reliable by far for Assassin's Creed 3." A sterling endorsement, if I ever heard one.

Click to Zoom & Enlarge
Click to Zoom & Enlarge

Ubisoft's use for Far Cry 3 and Assassin's Creed 3 was a big draw, but Valve and Left 4 Dead 2 really got everybody's attention. As the first session of the day, that's quite a feat, but then, what AMD and Valve talked about was quite a feat, too: optimizing OpenGL for Linux under Windows.

Click to Zoom & Enlarge

Last year, Valve made the decision to get the source engine working on Intel powered Apple products, which required the transition from DirectX under Windows to OpenGL on OSX. This wasn't trivial and there were some notable problems along the way, including performance parity; it took some hard and heavy optimizations to get performance on Mac titles comparable to Windows ones.

After doing that, Valve turned their attention to Linux. It's an open secret another AMD console win is the Valve Piston, based on the Xi3 design featuring the AMD A-series APU (currently Trinity, soon to be Richland). While we're waiting for AMD and Valve to get over their coyness and announce already, behind the scenes work is going on to throw off the shackles of Microsoft's OS and API and move to the venerable, just-won't-die operating system of highly reliable, embedded, latency sensitive, real-time capable, secure operations everywhere: Linux.

It's long been rumored that Valve have opted for an open source OS as the cylinder lining for their Piston, and this seems to drive the point home. Along with actually getting the Source engine games working under Linux, Valve are showing off how they did it and the benefits they received when they began the Win32 to Linux port a year ago.

Click to Zoom & Enlarge

Rich Geldreich, Valve Corp., Software Engineer, espoused how easy it is to work with GPU PerfStudio 2, and the increased level of detail it provides over AMD's similar CodeXL tool. Geldreich states that use of GPU PerfStudio 2 permits them "to make a single build that can be compiled to DirectX, Windows OpenGL, or Linux OpenGL." This is quite a boon for saving time and increasing quality; less places for code to be changed means increased consistency and better quality. This feat is possible because, Geldreich says, "99% of driver code is the same; an OpenGL developer can use either Windows or OSX platform before porting to Linux."

Click to Zoom & Enlarge

Cross API compatibility is important to those wanting to increase consistency and efficiency. GPU PerfStudio 2 is the only application that Geldreich says Valve have implemented "that works for OpenGL, even for three thousand-plus draw calls."

Valve determined making an OpenGL version of Left 4 Dead 2 introduced a lot of bugs which Valve's team were able to track down by beginning with the API trace. This element of GPU PerfStudio 2 allows developers to see the version and extension of OpenGL calls used -- very helpful for tracking changes over different revisions of the standard and the expected inputs and outputs.

In conclusion, Geldreich uttered a sentiment not heard in public in recent time: gratitude for AMD's investment in OpenGL.

"All tools are special flowers, needing some fiddling and coaxing to work. The best tools amplify productivity, so keep trying to make it capture and start simple to learn your way. Thank you to AMD for continuing investment, keeping faith with GL, and supporting GL. You can achieve parity with Direct3D; the backend optimizations can be within 10% easily. Direct3D appears stagnant; it doesn't make sense to continue investing."

With AMD's latest hardware feature -- mega-texturing through partially resident textures (PRT) -- still not supported by DirectX, it's easy to see on what Geldreich is basing his opinion. If the path to great Linux gaming is as simple as laid out by AMD and Valve, the promise of Linux gaming is high and should attract many developers to whatever ecosystem Valve build for their platform.