Valve Ports Left 4 Dead 2 to Linux OS
Let's get technical.
When Valve delayed the Cold Stream DLC for Left 4 Dead 2, they attempted to soften the blow with the announcement of native L4D2 support on Linux operating systems. Today, Valve revealed that they finally have the zombie-survival FPS running on the open source OS.
In an official blog post, Valve first established a high-end configuration they used to run the port:
Intel Core i7 3930k
NVIDIA GeForce GTX 680
32 GB RAM
Windows 7 Service Pack 1 64-bit
Left 4 Dead 2
Ubuntu 12.04 32-bit
Although they are currently running L4D2 on a 32-bit version of Ubuntu, Valve explained that a working 64-bit version is in the cards for the near future. Valve determined that when running the game on Windows 7 with Direct3D drivers, they can achieve 270.6 FPS. When they first starting porting to Linux, a grand total of 6 FPS was achieved. From there, Valve took a few key steps to up the performance:
- Modifying L4D2 to work better with the kernel - By implementing the Source engine small block heap to work under Linux, Valve changed the memory allocator to use more appropriate Linux functions, upping the overall efficiency.
- Modifying L4D2 to work better with OpenGL - Valve reduced the CPU overhead in calling OpenGL to maximize performance and also extended the renderer with new interfaces for better encapsulation of OpenGL and Direct3D.
- Optimizing the graphics driver - Valve worked with hardware manufacturers to iron out issues with their individual drivers and improve the public driver, benefitting all games. Two specific fixes that came about as a result of the L4D2 port were identifying driver stalls and adding multithreading support in the driver.
So after all has been said and down, Valve has Left 4 Dead 2 running at 315 FPS on Linux. In looking back at some OpenGL changes that were made to the Linux OS, adjustments were made to the Windows version and now L4D2 is running at 303.4 FPS with the new configuration.
It's a lot of work to get a three-year-old title working natively on an OS that isn't considered "mainstream" by any sense of the word, but Linux users are massively appreciative. The Linux library will continue to grow without needing a conversion program like Wine to translate Windows-based titles. Just another thing indebting us to Valve.