
Valve Source Engine Running Faster on Linux than Windows - learc83
http://blogs.valvesoftware.com/linux/
======
exDM69
I have to say that this is nothing short of a miracle. The OpenGL API is
really hairy to implement at all, let alone making it fast. There's 20 years
of accumulated legacy and design mistakes that the driver vendors need to care
about. D3D, on the other hand has been re-designed on every iteration and
backwards compatibility has been broken in every major release.

On the other hand, porting from D3D code, you don't touch the hairy parts of
OpenGL at all because D3D is functionally quite close to the "clean parts" of
GL. But there's still some software overhead to overcome. They might also be
using a proprietary D3D-on-OpenGL layer, like the ones being used for some Mac
ports of Windows games (edit: seems like they are not).

I hope that Steam, and gamers that use Mac and Linux in general, will push for
bigger changes in OpenGL, both specs and implementations.

disclaimer: I write GPU drivers for living

~~~
vrodic
Isn't "OpenGL - The good parts" actually called OpenGL 2.0 ES?

~~~
rbanffy
I don't think jwz (who is much smarter than me) has many good things to say
about OpenGL ES

[http://www.jwz.org/blog/2012/06/i-have-ported-
xscreensaver-t...](http://www.jwz.org/blog/2012/06/i-have-ported-xscreensaver-
to-the-iphone/)

~~~
klodolph
JWZ isn't saying that OpenGL ES isn't the good part of OpenGL, he's saying
that nobody should ever have removed things from OpenGL in the first place,
because he wants to port ancient code to modern systems.

~~~
rbanffy
Another way to take it is that ES removes too much from OpenGL.

In any case, I submit to the opinion of experts - my experiments with OpenGL
have been simple and, when I attempted anything more complicated, they
resulted in much more frustration than learning.

------
cs702
For those who, like me, use desktop Linux full time, Valve's close
collaboration with NVIDIA and AMD (i.e., ATI) to improve the performance of
proprietary graphics drivers is a huge win.

Quoting from the blog post: "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."

Leaving aside the amazing fact that Valve is achieving higher FPS on Linux
than on Windows, the great thing about efforts like this one is that we can
all expect the Linux desktop to become even smoother, faster, more seamless. I
love it!

~~~
nathanb
Seems to me like a huger win would be if the open-source graphics drivers
would get improved.

I'm not even talking ideologically here. The OSS drivers are included along
with the kernel in most distros. They're what you get by default when you boot
a new Linux install. They get upgraded alongside other core packages by the
distro's package manager and are generally quite up-to-date compared to the
"official" drivers in the package repository (if they're even there at all).

I use the OSS radeon driver at home and the OSS nouveau driver at work, and
both are quite adequate for my purposes (which involve no real 3D). I think it
would be a bigger improvement to the ecosystem to have these drivers get some
love.

(Or, alternately, for the proprietary drivers to go open-source and be
included with the kernel).

~~~
jlgreco
My impression is that there are issues with 3rd party licensing of various
sorts in the proprietary drivers that would prevent open sourcing them even if
Nvidia/AMD wanted to.

Of course that probably doesn't prevent them from giving the OSS drivers some
love, but that is another story.

~~~
elmindreda
nVidias argument for not opening up the Linux driver is that it shares a lot
of code with the Windows driver. I'm not saying that this argument makes
sense, but it's the one they use.

~~~
drivebyacct2
I don't understand why that prevents them from releasing the source? There's
no reason the Windows driver _need_ be closed-source.

~~~
robryan
That depends, how much of their competitive advantage over AMD is in software
and how much of it is hardware?

------
yobbobandana
Here's the submission that linked to the actual blog post, not to the whole
damn blog:

<http://news.ycombinator.com/item?id=4326619>

~~~
learc83
And that post didn't make it to the front page, because the title wasn't very
descriptive.

I wanted to read some real hacker news discussion, which we're now getting
with a better title.

~~~
mtgx
Yes this is a "problem" on HN sometimes. The original posts don't get upvoted,
but some summary/repost by another more known site does. Yesterday there was
an article that was submitted from multiple sources, but it was only the
Engadget one of all the sites got to the front page.

~~~
estel
I'm unsure how that's necessarily a problem with HN so much as it's a problem
for headline writers. There are a lot of articles hitting /new every hour;
it's the original headline writer's job to grab our attention and make us read
them.

~~~
dllthomas
To be fair, mtgx said it was a problem "on" HN, not "with"...

------
NPC82
Steam working with hardware vendors on Linux drivers means everyone in the
Linux community benefits. This is fantastic news.

~~~
mlitwiniuk
Yeah. And one of anti-linux arguments for Windows fans is just getting killed
- gemes do run on Linux. If this experiment will be a success for Valve, we
only can wait for other game producers to follow their steps. And taking under
consideration that not everybody is going to like Windows 8, this can be a
beginning of revolution!

~~~
Nicole060
"Windows fans" is a bit strong of a word for many. Does the fact that one
_needs_ windows to run some of the software they like makes them a "windows
fan" ? I used the three major desktop OSes on a regular basis. My laptop is a
MBA running OS X, since that's what works best for me in a mobile computer. My
desktop used to have a dual boot of linux for my main, daily computing needs,
and Windows for games. I had to stop using linux since I switched to an ATI
card that couldn't even tolerably work with Gnome 3.

Free software proponents tend to be less level headed on the issue. I think
there aren't a lot of true "windows fans", but on the other hand, there are a
lot of "linux fans" who live for the politics of free software. Lots of people
use both proprietary and free software. I do. We are the ones who don't care
for your politics. Unlike lots of hardcore linux proponents who are actively
hostile to closed source software. On purely technical terms, I like linux
better than windows because of its ecosystem (terminal software, scripting,
unix philosophy) but certainly not because I'm enamored with the politics of
the FSF. OTOH I use windows not because I love it, but because I need it.
That's being practical.

People who put other groups into boxes, like "anti linux" "Windows fans"
aren't practical, they're turning software into a religion. You're even
speaking of a "revolution".. for god's sake.

~~~
Dylan16807
You're reading way too far into that comment. A "windows fan" is the kind of
person that says windows is 'better' because 'it has games'. It's not an
insinuation of being a crazy fanboy. It's not something that applies to anyone
that uses windows for any reason.

You're the only one here treating it as a serious and solemn issue.

~~~
mlitwiniuk
Yes, that was exactly my point. Thanks for clarifying. And by the "revolution"
I meant, that this may be beginning of serious user migration from Windows to
Linux. Of course, there is Ubuntu, Linux for human beeings, some people do use
it, but it's still "some", small number, that you do not take under
consideration when planning/developing a game.

------
johnchristopher
> 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.

Why wouldn't they switch back to OpenGL on windows then ?

Besides the absolute numbers I wonder how the hardware is behaving regarding
resource intensive applications games are. From personnal experience every
laptops and computers I have owned had had their fans spinning much louder
when running ut2004 (and other games) on linux than on windows. Whether
because it's getting hotter for less computational power or because of more
aggressive default fan settings in distros.

~~~
exDM69
> Why wouldn't they switch back to OpenGL on windows then ?

Because no-one likes to program with OpenGL. Because of it's history, it is
one of the hairiest APIs out there. Try to propose using OpenGL to a game
developer and you'll be laughed at.

Many GPU vendors have been doing a bad job with OpenGL windows drivers and
they have been really buggy, but the situation is improving.

I write OpenGL because I don't use Windows. I still hate it.

~~~
jiggy2011
I thought stuff like SDL was used precisely because it abstracted away all the
crappy parts of openGL and gave you an easier API to work with?

~~~
eropple
If it meaningfully abstracted away the crap as it was originally billed to do,
yes. It doesn't really do that, IMO, and mostly just makes you deal with even
more mental state. It's very common to see people use SDL more or less only
for creating a window and pulling input (which it does do pretty well).

SFML is better, but the developers are pretty uninterested (SFML 1.x was
declared "legacy" while there was a bug that prevented it from running on
modern AMD graphics cards) and I wouldn't trust it as far as I could throw it.

~~~
peacemaker
Can you explain why you wouldn't trust SFML? I've been using it for a few
months now and haven't had any problems.

~~~
eropple
I don't trust people who leap to a new, breaking major version while ~40% of
people can't run the in-theory-supported old one. Their prerogative, but I
won't use their library because of it.

------
Mavrik
I might be the only sceptic here, but the fact that it seems that Valve has
conflict of interest when it comes to Microsoft lately (see Gabe's comments)
makes me doubt the authenticity of these results.

I'd love to see real performance improvements when it comes to Linux, but
right now I just see a company that (it seems) has something to gain by
smearing Microsoft giving out results without any methodology or explanation.
They never even said how they avoided the typical pitfall of "FPS"
benchmarking - making sure the GPU and the engine is actually drawing the same
things (that means making sure all the same shaders are executed, similar
extensions are used so that image quality is identical).

Until we get some confirmation in the wild I'll remain highly sceptical
towards claims on the blog.

~~~
SCdF
You're not the only one. Valve are not the first people to port Windows games
to Linux, and while _some_ people claim they're faster, the general
benchmarked consensus I've seen over the years is that both platform are,
within 10% or so, basically identical.

~~~
Periodic
Their results are basically within 15-20%. The major achievement is just
having acceptable performance. After that there tends to be so many other
factors that you can tweak that only two metrics make sense: FPS and image
quality without any non-automatic tweaks, and then the maximum that can be
obtained by extensive optimization.

For most people, they just want the game to run such that the difference is
not big enough to warrant switching OSes for gaming. For me, I just want it to
be close enough that I can't be bothered to reboot.

I've been getting some great performance through wine for some games for quite
a while now. Under the same settings I've occasionally had slightly better or
slightly worse performance depending on the game, patch-level and settings.
For me the bar is whether it is playable and looks decent at all.

------
jcfrei
I've noticed that quakelive runs noticeably faster on linux than on windows.
strangely though this doesnt seem to be related to fps, but rather appears to
stem from mouse latency (in other words the game just appears more responsive
on linux) - has anyone made similar observations?

~~~
Karunamon
Could be the mouse acceleration.. great for general use, rubbish for gaming.

Windows makes you jump through many hoops (think registry hacks) in order to
disable that function on almost any version of their OS. I don't know of any
Linux distros (correct me if I'm wrong here) that do that by default.

~~~
gcp
Disabling mouse acceleration in Windows is a single checkbox exactly where
you'd expect it: in the mouse control panel.

Disabling it in Linux: depends on the desktop environment. KDE has it on by
default, can be disabled in much the same way as on Windows. Same for the
GNOME desktop in Ubuntu: enabled by default.

Disabling mouse acceleration if your mouses' firmware does it: hopeless in
Linux and in Windows. If you're lucky the mouse vendor has some Windows
program that allows access to it.

Note that in all cases, disabling is easier or possible on Windows than on
Linux.

~~~
Karunamon
>Disabling mouse acceleration in Windows is a single checkbox exactly where
you'd expect it: in the mouse control panel.

No it isn't. If you uncheck the pointer precision box, there's still a level
of acceleration happening behind the scenes, as late as Windows 7, that still
requires registry changes to disable.

[http://donewmouseaccel.blogspot.com/2010/03/markc-
windows-7-...](http://donewmouseaccel.blogspot.com/2010/03/markc-
windows-7-mouse-acceleration-fix.html)

~~~
gcp
The post actually explains this is only needed for some old Windows games
(predating Windows XP!) that mistakenly re-enable mouse acceleration
themselves.

~~~
ricardobeat
Quake, mentioned by the OP, is one of those old games where this fix is
needed. You'd know this if you played Counter-Strike :)

------
rogerbraun
As a counterpoint to the "OpenGL needs to start from scratch" discussion, take
a look at JWZs blog about porting XScreenSaver to iOS:
[http://www.jwz.org/blog/2012/06/i-have-ported-
xscreensaver-t...](http://www.jwz.org/blog/2012/06/i-have-ported-xscreensaver-
to-the-iphone/)

~~~
ajross
Indeed. The death of the immediate draw APIs is something that only driver
writers and serious optimization wonks think is a good idea. For everyone
else, it simply makes ES2 an API that is basically impossible to learn.
Without exception, everyone I know who does any 3D work at all learned first
on 1.1 doing flat shaded fixed function stuff.

And all those APIs are gone. The amount of code required in ES2 to put
_anything on the screen at all_ is staggering.

But that said: the per-vertex APIs really are broken from an optimization
sense, and serious apps absolutely must do their work on buffer objects.
(Display lists have historically been a way to cheat this, at the expense of
huge complexity in the driver. This is one of the bad APIs exDM69 is talking
about, I suspect.)

~~~
kcbanner
There is really no use for immediate mode anymore; I'm of the opinion that if
you lament the loss of immediate mode, you simply don't want to learn the
newer, more efficient ways of doing the same thing.

Ask yourself this, if immediate mode never existed, would you still say that
the ES2.0 method is still "basically impossible to learn"? I assure you that
it is very possible to learn.

~~~
ajross
Terminology quibble: you don't mean "immediate mode" in the sense it's been
used in the community. OpenGL is still an immediate mode API under all
circumstances. There is no scene graph. I probably should have said "streamed
vertex" or "begin/end" to make things clearer.

Did _you_ learn ES2 (i.e. create a buffer object, fill it, pass in attribute
pointers, goof up the stride values, do it again, draw)? Or did your first
triangle come out via begin/vertex/vertex/vertex/end?

~~~
kcbanner
My first triangle came out when there was no programmable pipeline, so yep,
via immediate mode (any by that I mean begin/end). Then, when OpenGL 2.0 came
out, I learned how to use buffers to do it instead.

Are you saying that immediate mode should be used in all cases, even for
rendering a complex mesh where you will need to spend CPU cycles iterating and
uploading vertices to the CPU _every frame_?

~~~
ajross
Goodness no. I think you missed the last paragraph I wrote in the note you
responded to.

I'm saying that the begin/end APIs should not have been dropped from the spec
in ES2. There needs to be some kind of equivalent, because high performances
games and driver writers aren't the only users of the API.

~~~
rrmm
It seems like the API could probably be replicated in glu or glut, so people
who just want the fixed pipeline could get it easily.

~~~
ajross
Sure, it could be. But the problem was it wasn't, so ES2 came out and
effectively abandoned huge chunks of existing code the relied on the fixed
function pipeline. And they had no answer for what people were supposed to
replace it with. Thus the aggrieved flaming from people like jwz who just want
to port some software.

------
timkeller
2013 - the year of the Linux desktop! We always knew it would happen,
eventually.

~~~
Auguste
Rejoice! Now the 'But does it play X' game meme can finally die!

~~~
Derbasti
At least for values of X that are associated with Valve...

~~~
Karunamon
This is just the proverbial thin end of the wedge. Look what happened with
Steam on Mac OS, first they got Steam and the Source games running, then more
and more developers started releasing games on Steam for Mac (some of them
even being cross compatible between systems).

The current state of the Mac side of the Steam store is way behind the Windows
one, but it's still quite formidable.

~~~
dhugiaskmak
Even with a boatload of patience and very, very low expectations calling the
current state of Mac gaming "formidable" is extremely charitable. It's better
than it was pre-Steam & pre-App Store, but that's not saying much. I'll get
excited when big studios other than Valve and Blizzard are targeting the Mac
as a first-party platform rather than relying on half-assed third-party Cider
or Wine-based ports that barely work on even the latest hardware.

------
hxf148
I still would like to know what Valve and Blizzard have encountered with Win8
that makes it trouble. I have not had any problems with Steam and WoW. Maybe
they do mean drivers though..

~~~
__alexs
The VentureBeat interview [1] makes it look like gaben is referring to the
changes in app ecosystem (eg. integrated Windows Store with 30% margins)
rather than a specific technical problem. Although I suspect a major games
studio coming to Linux might also enjoy the ability to poke around the source
for the few graphics drivers which are open.

1\. <http://venturebeat.com/2012/07/25/valves-gabe-newell-talks/>

~~~
cageface
Seems likely. I think Apple only got away with the shift to the Mac App store
because the market for third-party Mac software is minuscule compared to that
of Windows and includes a lot of smaller devs for whom relinquishing control
of sales and distribution is as much a blessing as a liability.

On Windows big players like Valve are going to be less willing to play
sharecropper.

~~~
scott_w
I believe that OS X doesn't prevent you installing your own "App Store", so
you can get Steam on OS X.

~~~
freehunter
Windows 8 doesn't prevent you from installing Steam, either. I'm running it
right now on the Release Preview.

Windows RT does, but that's like comparing OSX to the iPad.

~~~
Dylan16807
That's because Steam isn't a Windows 8 program. If you want to use Metro you
have to go through the App Store.

~~~
freehunter
Steam _is_ a Windows 8 program. It's not a WinRT program. Steam works
perfectly in Windows 8.

The point I was making is that Steam doesn't work on Microsoft ARM tablets
powered by Windows RT, but that shouldn't be a big surprise considering no
desktop software works on ARM computers without being recompiled for that
platform. It's no different than OSX vs iOS.

~~~
Dylan16807
You're ignoring WinRT on x86. This is where people are upset about Microsoft's
sudden monopolizing. I don't consider it a true 'Windows 8' app if it's tucked
away in the legacy desktop.

~~~
freehunter
You're technically correct, but you're really just splitting hairs. If it runs
on Windows 8, it's a Windows 8 program. Windows 8 was designed to run both
desktop and Metro applications. We're not talking XP Mode from Windows 7 here.

~~~
Dylan16807
The desktop is even more segregated from metro than XP mode was (since you had
the seamless option for XP mode). As far as I can tell the _point_ of Windows
8 is Metro and everything related, so I don't feel like it's splitting hairs
to focus on it. If you want to get in on that new Windows 8 touchable tiled
wonderful candy _unavoidable primary interface_ you have to play by
microsoft's app store rules.

Edit: haha I wonder if this article is true about microsoft abandoning 'metro'
in favor of 'windows 8-style ui' Seems relevant.

------
nbevans
They don't state whether the comparison between DX and OGL was running
identical quality rendering or not. Given that OGL doesn't support many
niceties that DX does; one can assume not.

Which would make the entire comparison completely pointless. To the point of
the blog post almost being a trollpost. Valve have a clearly defined agenda
here, remember.

~~~
exDM69
> Given that OGL doesn't support many niceties that DX does; one can assume
> not.

This is incorrect. OpenGL is almost feature equivalent to D3D.

Properly done, they should be able to get similar results. If they spend a lot
of effort on it, they should be able to get bit accurate results.

~~~
nbevans
The blog post makes no mention of the steps they went through to achieve
quality parity though. So one can assume that they did not.

------
SkyMarshal
I wish they'd add Wine as a 3rd 'OS' for comparison. Currently they're
comparing Ubuntu 12.04 native vs Windows 7, would be really interesting to add
the benchmarks for the Windows version running on the latest Wine on Ubuntu
12.04.

------
xentronium
Take these results with a grain of salt:

> We are using a 32-bit version of Linux temporarily and will run on 64-bit
> Linux later.

~~~
mtgx
Why? Aren't 64 bit versions supposed to be even faster?

~~~
singular
I wonder whether larger pointers could result in being able to cache less
media. But that's a wild guess.

~~~
tene
If they use the X32 ABI, that won't be a problem.

~~~
singular
Ah yes of course. But if so, wouldn't they have issues interacting with the
driver, since they have to be x64?

------
alexholehouse
Maybe a stupid question and I've missed something, but why even bother telling
us they're using 32GBs RAM for benchmarking if they're using 32-bit Ubuntu?
Just to be totally transparent? Is Windows a 32-bit W7 too?

~~~
rmk2
I'm not sure if this is the right answer or not, but the Linux kernel has
supported PAE[1] for ages, which allows for more than 4GB of RAM in a 32-bit
OS (though it remains unusable by a single process, if I understood that
correctly). Maybe someone else with a better understanding of the 32bit/64bit
differences can chime in.

[1]: <https://en.wikipedia.org/wiki/Physical_Address_Extension>

~~~
kbolino
PAE would definitely enable them to use all 32GBs of _physical_ memory.

Both Windows and Linux have PAE support, but non-server editions of Windows
still limit the physical address space to 4GB (although this might seem to
make PAE support pointless, there are other advantages of PAE, like the NX/XD
bit used for DEP).

You are also correct that the per-process limit of 4GB of _virtual_ memory is
not affected by PAE. In case the advantages of PAE once again seem pointless,
remember that a system can execute multiple 32-bit programs each with its own
independent address space, so you can have, in theory, eight programs each
using its own 4GB on a 32GB system without running out of memory.

In practice, the platform imposes a limit of <4GB for physical memory, with
the remainder used for legacy support and hardware DMA. Also, the operating
system imposes a limit of <4GB for virtual memory, with the remainder used by
the kernel.

------
geon
315 FPS?

I was told that frame rates over what you can actually see tells you very
little about the actual performance. So implementation A at 315 FPS being 10%
faster than B might very well be 50 % slower than B at 60 FPS.

What is interesting is if the frame rate can keep a steady 30/60/120 FPS.
Anything above that is just not indicative of actual performance.

~~~
jiggy2011
Surely if they are both doing 60fps then by definition the performance will be
the same? I guess the time spent doing the actual rendering vs waiting to do
the next frame might be different, not sure if there is a reason that the
characteristics would be different at 300FPS and 60FPS though since surely the
only difference is how often the render code is called?

Bare in mind that Valve is running this test on a much higher end PC than most
consumers are likely to have. People will want to be able to run these games
on their $500 laptops , so the difference between 270 and 315 FPS might
translate into a difference between 50FPS and 60FPS which would be noticeable.

~~~
lmm
If the code is "rendering" 300 FPS but only displaying 60, it could be doing
anywhere from 1x to 5x as much work as if it were rendering at 60, depending
on arbitrary driver internals. So it would be much more convincing if Valve
had an example of "on this hardware, at these settings, it can sustain smooth
60fps under opengl and not under directx".

------
jeffool
Maybe someone smarter than me can tell me why they don't reboot OpenGL? Or
better, leave the current run as is for the CAD folk, then run a new API,
"OGL-Game".

Also, I got bored the other day... I can't help but wonder if Valve would push
a desktop of their own devising?

Anyone know of any interesting hires that may have gone under the radar?

~~~
sp332
Maybe OpenGL ES? <http://news.ycombinator.com/item?id=4134426>

------
jeffool
While I love the idea of free and open software, I have to admit an ignorance
to it in application (well, at least Linux).

Valve creates a Steam client, and gets the Source game engine running
awesomely on "Linux". How do all the different desktops factor into this?

------
ktizo
PC games players are speed junkies. If this all goes through, then I would not
be surprised to see games players migrate to linux in droves.

~~~
HelloMcFly
I really don't see this happening. They might give it a try, sure, but I'd bet
the lion's share of them would be back on Windows in a week. Linux is just not
as easy to use for most people, and when push comes to shove they'll go back
where they feel safe knowing how things work, and knowing that things will
work in the first place.

I know many people are diehard about Linux, but it's a big commitment to
switch and it isn't easy. Even so, many users might make the switch to find
Linux seems to introduce a lot of headache and perceived restrictions on
capabilities that Windows doesn't. Sure, they could probably tweak their way
past the difficulties, but after troubleshooting on a wiki or in forums for a
couple of hours it would lose the flavor for the masses.

~~~
ktizo
Given how ridiculously easy it is on most hardware to install a second ubuntu
partition on a windows box these days, I am not sure that is really too much
of an issue.

Also, the least hassle I have had with migrating people to linux has been with
people who really have no idea about computers, possibly as they have no
expectations of how things should be and don't fiddle with things as much.

And besides, there is no real switching. I run osx, windows7 and linux mint,
mostly, (often on the same computer, although I have found triple boot on
hackintoshes to be a bit temperamental). Using a new OS doesn't mean you no
longer use the old one. It doesn't restrict you really at all, it just gives
you more perspective and a wider range of expertise. I highly recommend it.
Linux mint is not a bad place to start as it is compatible with ubuntu (and
therefore debian, to a large extent), but currently has a bit more polish. -
<http://www.linuxmint.com/download.php>

