1. Computers
  2. Display Drivers
  3. Graphics Cards
  4. Memory
  5. Motherboards
  6. Processors
  7. Software
  8. Storage
  9. Operating Systems


Facebook RSS Twitter Twitter Google Plus


Phoronix Test Suite

OpenBenchmarking.org

How Valve Made L4D2 Faster On Linux Than Windows

Valve

Published on 09 August 2012 03:58 PM EDT
Written by Michael Larabel in Valve
103 Comments

Following this morning's Here Is Valve's Source Engine Left 4 Dead 2 On Linux article, here is most of the details that were shared during yesterday's SIGGRAPH presentation about Left 4 Dead 2 running natively on Linux with OpenGL and outperforming the Windows version.

Valve's big SIGGRAPH Linux presentation centered around their OpenGL work and how the Linux version is faster than the Windows version -- for both the OpenGL and Direct3D renderers.

Valve is supposed to be posting the slides (presumably on their blog) and hopefully a video will emerge, but since there's nothing yet, it will probably take until next week before they share anything. As a result, below are the pertinent details they shared from their slides that were presented last night at SIGGRAPH Los Angeles. With SIGGRAPH being an industry-leading graphics conference, most of the talk was filled with low-level technical details. Enjoy!

- The presentation was made by Rich Geldreich of Valve and entitled "Left 4 Dead 2 Linux: From 6 to 300 FPS in OpenGL."

- The Source Engine with OpenGL is on average about 11% faster with OpenGL than Direct3D 9 on a NVIDIA GeForce GTX 680. It's believed that another 5% higher performance for GL is still easily obtainable by reducing overhead in their Direct3D -> OpenGL layer.

- Yes, the way the Source Engine is hitting on OpenGL right now is through a non-deferring, locally-optimizing abstraction layer to basically convert their longstanding Direct3D calls into OpenGL. However, it's not the same way that Wine does Direct3D to OpenGL conversion. The Source Engine targets a D3D9-like API with extensions that translates GL calls dynamically. This also works for Shader Model 2.0b with Shader Model 3.0 support coming soon. Valve's implementation is nearly a 1:1 mapping between D3D and GL concepts.

- The overhead attributed to the Direct3D to OpenGL translation is about 50/50 split between CPU cycles spent calling GL vs. translation overhead. For single-threaded graphics drivers on the other hand, it's about 80% in GL and 20% translation overhead. But again, even with this extra layer, OpenGL is faster. NVIDIA's proprietary Linux team has done a lot of work with their driver's multi-threading abilities.

- Valve's worked with all major vendors (Intel, AMD, and NVIDIA) for improved driver support and optimizations. Valve's Linux team originally had "little practical OpenGL experience." Their process came down to devising/conducting experiments, test results with known workloads, refining/updating mental model of system's behavior, repeat. The goal was to account for every micro-second spent in the Direct3D to OpenGL layer and render thread.

- Interpreting the experimental results were a bit challenging with the game being multi-threaded, the driver's server thread is invisible to most profiling tool, and the Source Engine is extremely configurable/scalable.

- RAD Game Tools' Telemetry was used a lot plus a custom batch trace recording mode for analyzing their translation layer. Telemtry offers cross-platform performance visualization systems via a visualizer app, run-time component, and server.

- Some of Valve's optimizations made so far is multi-threading support with the GL mode, removing most calls to glXMakeCurrent, pthreads usage fixes, reducing translation overhead by rewriting the hottest D3D->GL code paths, improved dirty range tracking, added separate uniform array for bone matrices, dynamic buffer updating improvements, and compiler optimizations. The compiler improvements were building the game/engine with -ffast-math and removing -fPIC.

- Extra details not covered during the presentation will be shared via their Linux blog in the coming days.

About The Author
Michael Larabel is the principal author of Phoronix.com and founded the web-site in 2004 with a focus on enriching the Linux hardware experience and being the largest web-site devoted to Linux hardware reviews, particularly for products relevant to Linux gamers and enthusiasts but also commonly reviewing servers/workstations and embedded Linux devices. Michael has written more than 10,000 articles covering the state of Linux hardware support, Linux performance, graphics hardware drivers, and other topics. Michael is also the lead developer of the Phoronix Test Suite, Phoromatic, and OpenBenchmarking.org automated testing software. He can be followed via and or contacted via .
Latest Linux Hardware Reviews
  1. Scythe Mugen MAX
  2. Intel Core i7 5960X Haswell-E On Linux
  3. Intel 80GB 530 Series M.2 SSD On Linux
  4. With A New Motherboard, The Core i7 5960X Haswell-E Lights Up
Latest Linux Articles
  1. RadeonSI GLAMOR Benchmarks With X.Org Server 1.16
  2. RadeonSI Gallium3D vs. Catalyst At 4K UHD On Linux
  3. MSAA RadeonSI Gallium3D Performance Preview
  4. Intel Core i7 5960X CPU Core Scaling Under Linux
Latest Linux News
  1. Ubuntu Touch/Phone Reaches Its First RTM Image
  2. The KMS Mode-Setting Driver Was Imported For X.Org Server 1.17
  3. SNA & UXA Intel Benchmarks With X.Org Server 1.16
  4. Graphics Driver Changes Coming In The Linux 3.18 Kernel
  5. Tropico 5 Being Released For Linux Gamers This Week
  6. Eclipse IDE Starts Firing Up On Wayland's Weston
  7. OpenSUSE Announcement On SUSE's Recent Merger
  8. Valve Begins Publicly Tracking AMD Catalyst Linux Issues
  9. Digia Qt Spinoff Is Called "The Qt Company"
  10. GNOME 3.14 Makes More Progress In Running Natively On Wayland
Latest Forum Discussions
  1. New Group Calls For Boycotting Systemd
  2. Updated and Optimized Ubuntu Free Graphics Drivers
  3. Stop grabbing my keyboard :(
  4. Best Radeon for a Power Mac G5?
  5. New stress testing utility for GPU's
  6. Hd 6850
  7. support for first generation UVD blocks (RV6xx, RS780, RS880 and RV790)
  8. Nvidia joins the ranks of Apple and Microsoft