Valve gets L4D2 running faster on Linux than Windows

ponder

Honorary Master
Joined
Jan 22, 2005
Messages
98,698
Reaction score
31,378
Location
Niflheimr
http://blogs.valvesoftware.com/linux/

Faster Zombies!
August 1, 2012

One factor in creating a good gaming experience is throughput. This post discusses some of what we’ve learned about the performance of our games running on Linux.
As any software developer can tell you, performance is a complicated issue. In the interests of simplicity, we’ll concern ourselves with the following high-end configuration:

Hardware

Intel Core i7 3930k
NVIDIA GeForce GTX 680
32 GB RAM

Software

Windows 7 Service Pack 1 64-bit
Left 4 Dead 2
Ubuntu 12.04 32-bit

We are using a 32-bit version of Linux temporarily and will run on 64-bit Linux later.
Running Left 4 Dead 2 on Windows 7 with Direct3D drivers, we get 270.6 FPS as a baseline. The data is generated from an internal test case.

When we started with Linux, the initial version we got up and running was at 6 FPS. This is typical of an initial successful port to a new platform.
Performance improvements fall into several categories:

Modifying our game to work better with the kernel
Modifying our game to work better with OpenGL
Optimizing the graphics driver

An example of the first category would be changing our memory allocator to use more appropriate Linux functions. This was achieved by implementing the Source engine small block heap to work under Linux. The second category would include reducing overhead in calling OpenGL, and extending our renderer with new interfaces for better encapsulation of OpenGL and Direct3D.
The third category is especially interesting because it involves working with hardware manufacturers to identify issues in their drivers and, as a result, improving the public driver which benefits all games. Identifying driver stalls and adding multithreading support in the driver are two examples of changes that were the result of this teamwork.
After this work, Left 4 Dead 2 is running at 315 FPS on Linux. That the Linux version runs faster than the Windows version (270.6) seems a little counter-intuitive, given the greater amount of time we have spent on the Windows version. However, it does speak to the underlying efficiency of the kernel and OpenGL. Interestingly, in the process of working with hardware vendors we also sped up the OpenGL implementation on Windows. Left 4 Dead 2 is now running at 303.4 FPS with that configuration.

OpenGL versus Direct3D on Windows 7

This experience lead to the question: why does an OpenGL version of our game run faster than Direct3D on Windows 7? It appears that it’s not related to multitasking overhead. We have been doing some fairly close analysis and it comes down to a few additional microseconds overhead per batch in Direct3D which does not affect OpenGL on Windows. Now that we know the hardware is capable of more performance, we will go back and figure out how to mitigate this effect under Direct3D.

Working with hardware vendors

We’ve been working with NVIDIA, AMD, and Intel to improve graphic driver performance on Linux. They have all been great to work with and have been very committed to having engineers on-site working with our engineers, carefully analyzing the data we see. We have had very rapid turnaround on any bugs we find and it has been invaluable to have people who understand the game, the renderer, the driver, and the hardware working alongside us when attacking these performance issues.
This is a great example of the benefits that are the result of close coordination between software and hardware developers and should provide value to the Linux community at large
 
Modifying our game to work better with the kernel
Modifying our game to work better with OpenGL
Optimizing the graphics driver

this is some bluff against MS that will fail. I say that because I do not believe that Valve would release a game which would mean that they have to potentially open their software.

i like that it shows linux's efficiency
 
This is interesting; I wonder what will happen with Windows as a gaming platform going forwards. It's already under threat from tablets, but gaming is one of the reasons it's still relevant. If Valve gets Steam onto Linux though it'll be a major coup.

Problem is, OGL might be faster than DX but it's also quite far behind it in terms of features from what I can gather, esp with DX11.
 
Last edited:
Can Gabell and his team just commit to date already?! Talk, talk, talk... To be fair, the whole Steam on Linux thing has been discussed as early as November 2008 (http://www.phoronix.com/scan.php?page=article&item=steam_confirmation&num=1).

I just feel like the Linux community is getting jerked around some more.

Now is the time for Linux gaming. C'mon dragonboy - throw some weight (and moola) behind the initiative!
 
This is interesting; I wonder what will happen with Windows as a gaming platform going forwards. It's already under threat from tablets, but gaming is one of the reasons it's still relevant. If Valve gets Steam onto Linux though it'll be a major coup.

Problem is, OGL might be faster than DX but it's also quite far behind it in terms of features from what I can gather, esp with DX11.

It will open up the market for better consoles. I bought Enemy Territory Quake Wars as it supported Linux and the performance difference was amazing compared to playing it on Windows.

Personally I believe the hard core gamer will use Windows OS with his bleeding edge hardware, but the average joe is using older hardware that is well supported under Linux.
 
Personally I believe the hard core gamer will use Windows OS with his bleeding edge hardware, but the average joe is using older hardware that is well supported under Linux.

I think it will go the opposite way. MS are pushing the closed ecosystem concept even further with Win8.

Linux will become tweakers paradise. Once the motivation exists to put solid effort into openGL, DirectX is going to get a hiding.
 
Problem is, OGL might be faster than DX but it's also quite far behind it in terms of features from what I can gather, esp with DX11.

Biggest issue from my understanding is the API. DX also handles everything, video, sound, input. OpenGL only handles video.
 
blah.. blah.. blah... whatever...

Steam on linux is going to rock, that's what I'm hoping for. Mac gaming is growing which shows that OpenGL is a solid platform, once linux becomes viable and profitable it will take off, then valve will release it's own console based on Linux.
 
Just when I started to like Windows 8.....Now im going to have to get linux on my main laptop?

Why is valve leaving windows for linux?
 
Just when I started to like Windows 8.....Now im going to have to get linux on my main laptop?

Why is valve leaving windows for linux?

Microsoft wants to launch it's own digital distribution platform (compete with Steam).

Might explain why Valve is looking to push towards more platforms. You can already play TF2 on Mac, so they have some experience with it.
 
Just when I started to like Windows 8.....Now im going to have to get linux on my main laptop?

Why is valve leaving windows for linux?

It won't be any time soon. Gabe is pissy because he's afraid MS replace Steam with their gaming marketplace. Seems the Win8 marketplace is now tightly integrated with the Win8 ecosystem.

I smell another antitrust suit coming if Gabe is right.
 
I think it will go the opposite way. MS are pushing the closed ecosystem concept even further with Win8.

Linux will become tweakers paradise. Once the motivation exists to put solid effort into openGL, DirectX is going to get a hiding.

I hope this is true. I've not stayed in the loop as to what MS are up to with Win8 but if they are moving to a closed system like with their mobile OS, then Linux will get the boost it needs.
 
I would only switch to linux for gaming if my ENTIRE steam collection will work. Otherwise - I will keep my windows rig.
 
Let me guess,an article willbe made that apple made a new "app":wtf:

Say what? Who said anything about apple? :erm:

And just so you know, by doing all this they improved their OpenGL implementation on Windows quite a bit, so it is not just the Linus version that gained from this process.
 
It will open up the market for better consoles. I bought Enemy Territory Quake Wars as it supported Linux and the performance difference was amazing compared to playing it on Windows.
Carmack has always been an OGL evangelist but just because it runs faster doesn't mean it's a better API overall. I can run apps faster on XP than Windows 7 but Win7 is a better OS than XP.

Personally I believe the hard core gamer will use Windows OS with his bleeding edge hardware, but the average joe is using older hardware that is well supported under Linux.
Average joe gamers using linux? Really? I...don't see that happening. I can see it becoming a strong gaming platform though if more devs like Steam get on board.
 
Top
Sign up to the MyBroadband newsletter
X