What's up with GPUs under Linux?

Coders forum. Discuss techniques, swap code snippets, ask for help etc. relating to all forms of software development.
User avatar
KlaxonCow
Baaaaaaa!
Baaaaaaa!
Posts: 8444
Joined: Fri Dec 13, 2002 3:46 am 0
Location: A large grassy field.

Re: What's up with GPUs under Linux?

Post by KlaxonCow »

zip accident wrote:From what I'm hearing, if you want to make anything like full use of a strong PCIe graphics card, you must use Windows.
Who told you that?

I've got an RTX 3070 Ti (mobile) in this laptop and I run Linux. It's all been fine for me.

For example, Quake II RTX - running via Proton, with all the ray-tracing goodness turned on - can score a steady 60fps at 1080p. If I turn VSYNC off, then it's around 75fps. The laptop has a 1440p screen, so if run in windowed mode, then it's around 50-60fps.

Like, in a fully ray-traced game, I can hit a rock steady 60fps. Ergo, I would say "where's the problem?".

Because unless you're a competitive player (but, if you are, you wouldn't be competing with ray-tracing turned on) then I'd say there's no point turning VSYNC off. I mean, you could do so to show off that "look, my machine can do 100fps in this game" but, in terms of playing, I'm of the view that if you can hit a steady 60fps frame rate then that's perfect and there's no need for anything else. I'm not of any skill level where 60fps versus, say, 120fps would make any fucking difference.

It all runs fine for me. But, granted, I'm not the biggest gamer ever - but I do have games and I have played them, and they're all a-okay for me.

But, yeah, I might not be a great measuring stick here, as I tend to play indie games mostly. And, like, FTL - my most played game - could run on a potato happily.

That said, I have No Man's Sky and that's good.

Plus I bought the Tomb Raider bundle - so the new Tomb Raider, Rise of the Tomb Raider, Shadow of the Tomb Raider - and I played through and completed all those. Those played just fine. It's also worth noting that these new Tomb Raider games do actually have Linux native versions.

Yeah, I am the mad bastard who runs Linux on "gaming" class hardware (admittedly, I got the beefy hardware more for Blender performance than "being a gamer", but I've got it and it all works fine for me).

The only reason, from actual experience, to maybe warn a "real gamer" about Linux is multiplayer games. The ones with "anti-cheat". A lot of them won't work as the "anti-cheat" thinks that Proton is a "cheat bot" and refuses to run. This isn't because Linux can't run the games, it's an anti-cheat thing. But I don't care much for the "modern military shooter" FPSes, so it doesn't bother me personally.
"Words ought to be a little wild - for they are assaults of thought on the unthinking."
- John Maynard Keynes
User avatar
Little stoned kiwi
Baaaaaa!
Baaaaaa!
Posts: 4597
Joined: Mon Oct 27, 2003 6:05 am 0
Location: Christchurch

Re: What's up with GPUs under Linux?

Post by Little stoned kiwi »

Something I'm curious about is game specific driver features.
Master racing isn't just having the right OS but having the right hardware with the right driver on the right OS for the game.
Last edited by Little stoned kiwi on Sun Oct 08, 2023 1:27 am 0, edited 1 time in total.
If they think you're crude, go technical; if they think you're technical, go crude. I'm a very technical boy.
User avatar
Little stoned kiwi
Baaaaaa!
Baaaaaa!
Posts: 4597
Joined: Mon Oct 27, 2003 6:05 am 0
Location: Christchurch

Re: What's up with GPUs under Linux?

Post by Little stoned kiwi »

Little stoned kiwi wrote:Bugger
If they think you're crude, go technical; if they think you're technical, go crude. I'm a very technical boy.
User avatar
WiteWulf
Sheepie Whore
Sheepie Whore
Posts: 10125
Joined: Mon Aug 23, 2004 11:20 am 0
PSN: WiteWulf
Location: Loughborough(ish)

Re: What's up with GPUs under Linux?

Post by WiteWulf »

Little stoned kiwi wrote:Something I'm curious about is game specific driver features.
Master racing isn't just having the right OS but having the right hardware with the right driver on the right OS for the game.
This is why I’m a console gamer, ain’t got time for that :lol:
:::G:::

PSN: WiteWulf
Switch: SW-3941-2878-7584
Steam: WITEWULF66
User avatar
Little stoned kiwi
Baaaaaa!
Baaaaaa!
Posts: 4597
Joined: Mon Oct 27, 2003 6:05 am 0
Location: Christchurch

Re: What's up with GPUs under Linux?

Post by Little stoned kiwi »

My Xbox One is the last console I'll buy. They have lost a lot of their advantages.
I'd considered building a better rig for gaming. I stopped when trying to pick a motherboard; they are all overpriced with shiny metal and leds glued to them to justify it.
If they think you're crude, go technical; if they think you're technical, go crude. I'm a very technical boy.
User avatar
zip accident
Sheepie Whore
Sheepie Whore
Posts: 13928
Joined: Sun Feb 20, 2005 1:58 pm 0
Location: Bristol, UK

Re: What's up with GPUs under Linux?

Post by zip accident »

Little stoned kiwi wrote:My Xbox One is the last console I'll buy. They have lost a lot of their advantages.
I'd considered building a better rig for gaming. I stopped when trying to pick a motherboard; they are all overpriced with shiny metal and leds glued to them to justify it.
There were so many motherboards it was not clear which was best (been a while).
"My way is the way of not fighting":- the book of Enter the Dragon.
User avatar
Dio
Sheepie Whore
Sheepie Whore
Posts: 18887
Joined: Mon May 31, 2004 1:08 pm 0
Location: Newcastle UK

Re: What's up with GPUs under Linux?

Post by Dio »

Since about 1995 in fact.
User avatar
Little stoned kiwi
Baaaaaa!
Baaaaaa!
Posts: 4597
Joined: Mon Oct 27, 2003 6:05 am 0
Location: Christchurch

Re: What's up with GPUs under Linux?

Post by Little stoned kiwi »

Motherboards before 1995 are guaranteed the wrong socket type to choose for future upgrades.
If they think you're crude, go technical; if they think you're technical, go crude. I'm a very technical boy.
User avatar
gilesgoat
Sheepie Whore
Sheepie Whore
Posts: 27258
Joined: Wed Sep 03, 2003 7:54 am 0
Location: Monfalcone, Italy
Contact:

Re: What's up with GPUs under Linux?

Post by gilesgoat »

Anyway I'll say it once more .. I did ask "if they wanted a native Linux version" .. but the fact that it already ran ( on the Deck ) "good enough" with some fiddle was enough for them.
Giles the billy goat
"Baa"
User avatar
Little stoned kiwi
Baaaaaa!
Baaaaaa!
Posts: 4597
Joined: Mon Oct 27, 2003 6:05 am 0
Location: Christchurch

Re: What's up with GPUs under Linux?

Post by Little stoned kiwi »

It's the path of least resistance to implement and doesn't have a maintenance burden. Proprietary binaries in Linux are impractical unless they are wrapped in something.

Steam on Linux provides a stable binary environment for native Linux game binaries to run in. If you are running on the Linux OS itself you have to depend on the the dependencies being provided and stable.
Because Linux is largely open-source, when something changes you recompile the source-code. Which works well for open-source.
If they think you're crude, go technical; if they think you're technical, go crude. I'm a very technical boy.
User avatar
KlaxonCow
Baaaaaaa!
Baaaaaaa!
Posts: 8444
Joined: Fri Dec 13, 2002 3:46 am 0
Location: A large grassy field.

Re: What's up with GPUs under Linux?

Post by KlaxonCow »

It's worth noting that there are Linux native ports of many games.

I mean, perhaps unsurprisingly as they make Steam, all of Valve's titles have been given the Linux native treatment.

The new Tomb Raider trilogy by Feral, as I earlier mentioned.

Borderlands. Valheim. Bioshock Infinite. Life is Strange.

A lot of the Paradox strategy games have Linux native ports.

Then there's a ton of indie games like Rimworld, Terraria, Factorio, Dead Cells, Vampire Survivors. Transistor. Bastion.

They absolutely do exist.

But, indeed, one of the things with Valve's Proton is that it's so seamless, it's actually hard to know when you are or aren't playing a Linux native title. Like, nothing pops up on the screen to tell you - and though one way to find out is to fully disable Proton on Steam and then filter your library by Linux titles (the little Tux penguin icon that you can find in "Steam for Linux"), to see which of your games are native.

It's a market thing, not a technical thing.

Basically, why go to the effort and expense of a Linux native title, when your Windows title probably already works under Proton (or only requires minor tweaking to ensure it works with Proton)?

Like, Proton is a double-edged sword in that regard. I mean, if you create a Windows game and then try it out in Proton, and it just works then, okay, job done.

Why would you even think or be bothered to consider a native Linux port? If it already "just works" through Proton, then it's extra work to end up with what you've already got through Proton anyhow. Or even when it doesn't quite work, it's usually easier to tweak it to make it work with Proton, than make a full-blown native port, right?

And I hate to admit it, as I don't want to discourage anyone, but there is truth to the fact that Linux will give you a bigger support headache, just because there's, like, dozens of popular distros. At their core - like, literally the kernel - they're essentially the same, but they're all a little different - default packages, package managers, etc. - so there naturally will be more variance. And, when you're providing support, diversity and variance isn't your friend.

Plus, it's just pragmatics. If I wanted to hire a team of people to provide Windows technical support, that's easy. If I wanted to do the same thing with Linux... yeah, not so much. Less people have the required expertise (I mean, that's why, if you do have Linux expertise, then you can often get paid better in the jobs that require it, as you're a rarer beast to find).

It really is not a technical issue. It's everything else. The market just ain't big enough to interest developers.


Though, yes, there totally is a catch-22 / self-fulfilling prophecy thing there.

Hearing plenty of people saying "oh, if Linux had more games, then I'd switch over" and then developers are saying "oh, if Linux had more gamers, to ensure ROI, then we'd port our game over". So there's, like, a Mexican stand-off going on there. Gamers are waiting for the games to show up, developers are waiting for the gamers to show up.

Which might seem a bit silly, really. But that really is the largest part of what's going on there.

And, of course, Windows has no such problem because it's pre-installed on 95+% of all PC desktops and laptops in existence.

You already own it. You already paid for it. That has a major effect.

I mean, I'm very much a Linux user. But even I've still got my legit copy of Windows 11 on a second NVMe drive here.

I don't doubt that, technically, I'm actually on Microsoft's stats as being "a Windows user" for their boastful claims to have 95+% market share. Because, after all, how would anyone know that I have since installed Linux and have never booted into Windows since? Linux doesn't have spyware installed. No-one's measuring that directly. You can only find out by asking people.

Like, do not underestimate the power of the pre-installation. If PCs came empty of OS - or we'd always have been given a free choice of OS at the store when purchasing - then I reckon the stats would be completely different. Some people would still choose Windows as their preference, of course. But I don't think it'd be anywhere near what it is, thanks to pre-installation basically making the choice for you (and, really, your choice is only, after the fact, whether you can be arsed to wipe the OS and install a new one - remembering that installing an OS is NOT a particularly technophobe-friendly operation, whatever OS we're talking about. It potentially wipes out all your data. Meaning that the optimal time to do it is immediately upon getting your machine. But, ah, you want to use it, not piss around with installers. And once you start using your PC, you have data. It's now very hard to shift, as you've now got a data investment. Possibly in Microsoft proprietary formats, like Word or Excel)

Put it this way, in mobile, Microsoft have no bundling deals. Where are they in mobile? Absolutely nowhere. And that's not at all for want of trying.

They are literally non-existent in the supercomputer space. Like, pull up a list of the "top 100" supercomputers in the world and there is literally not a single one that isn't a UNIX, and most of them are Scientific Linux. Because if you're buying a big supercomputer, you have a specific application in mind, and open source is the way because then you can exactly configure the OS to your specific application. In the supercomputer space, closed source is a no-no.

In the server space, Microsoft do okay. But they're just one of many other players. Nothing spectacular. And that's with the advantage of having offices full of Windows PCs and the IT department just thinks that, ah, it makes sense and is the easy option to have a Windows server to serve all those Windows PCs.

But when it comes to the top websites on the Internet - Facebook, X / Twitter, Google, YouTube, Wikipedia, etc. - they're all built on Linux. The only exception is Microsoft but, even there, their Azure cloud servers and shit are Linux, so it's now probably not even 100% with Microsoft anymore either. When you have large tech companies, who have a free choice of OS from the fact that they know what they're doing, none of them are choosing Windows.

The old joke, of course, is "Year of the Linux Desktop". When will Linux take over the desktop? Well, never. Because Windows is already pre-installed on nearly all of them.

But if it was "Year of the Linux Mobile". Well, Android. Billions of devices. "Year of the Linux supercomputer". Yeah, Linux basically has pretty much 100% dominance there for decades (and if we include BSD, then it literally is 100% between them). "Year of the Linux embedded device". Already happened - people making embedded and IoT devices do NOT want to pay the Windows licence for every single device shipped.

Think about it. You never consciously chose to have Windows. It was already on the hard drive when you bought it. It's the default "do nothing" option.
"Words ought to be a little wild - for they are assaults of thought on the unthinking."
- John Maynard Keynes
User avatar
WiteWulf
Sheepie Whore
Sheepie Whore
Posts: 10125
Joined: Mon Aug 23, 2004 11:20 am 0
PSN: WiteWulf
Location: Loughborough(ish)

Re: What's up with GPUs under Linux?

Post by WiteWulf »

The Life Is Strange games are a specific and known example of the native Linux ports being notably worse than the Windows versions when running on a Steam Deck or a general purpose computer running Linux.
:::G:::

PSN: WiteWulf
Switch: SW-3941-2878-7584
Steam: WITEWULF66
User avatar
Little stoned kiwi
Baaaaaa!
Baaaaaa!
Posts: 4597
Joined: Mon Oct 27, 2003 6:05 am 0
Location: Christchurch

Re: What's up with GPUs under Linux?

Post by Little stoned kiwi »

KlaxonCow wrote:Though, yes, there totally is a catch-22 / self-fulfilling prophecy thing there.

Hearing plenty of people saying "oh, if Linux had more games, then I'd switch over" and then developers are saying "oh, if Linux had more gamers, to ensure ROI, then we'd port our game over". So there's, like, a Mexican stand-off going on there. Gamers are waiting for the games to show up, developers are waiting for the gamers to show up.
It's not like that though. Anyone waiting in the wings for proprietary software they want to be on Linux is doing it wrong. They are losing freedom if that software is Steam's walled-garden.
If they think you're crude, go technical; if they think you're technical, go crude. I'm a very technical boy.
User avatar
zip accident
Sheepie Whore
Sheepie Whore
Posts: 13928
Joined: Sun Feb 20, 2005 1:58 pm 0
Location: Bristol, UK

Re: What's up with GPUs under Linux?

Post by zip accident »

KlaxonCow wrote:Though, yes, there totally is a catch-22 / self-fulfilling prophecy thing there.

Hearing plenty of people saying "oh, if Linux had more games, then I'd switch over" and then developers are saying "oh, if Linux had more gamers, to ensure ROI, then we'd port our game over". So there's, like, a Mexican stand-off going on there. Gamers are waiting for the games to show up, developers are waiting for the gamers to show up.
Yep, that is the problem.
And, of course, Windows has no such problem because it's pre-installed on 95+% of all PC desktops and laptops in existence.
Windows 11? nothing like it. I dunno, is Windows 11 even 50%?
"My way is the way of not fighting":- the book of Enter the Dragon.
User avatar
KlaxonCow
Baaaaaaa!
Baaaaaaa!
Posts: 8444
Joined: Fri Dec 13, 2002 3:46 am 0
Location: A large grassy field.

Re: What's up with GPUs under Linux?

Post by KlaxonCow »

WiteWulf wrote:The Life Is Strange games are a specific and known example of the native Linux ports being notably worse than the Windows versions when running on a Steam Deck or a general purpose computer running Linux.
That is another aspect to this.

Simply being "Linux native" doesn't necessarily mean you've got better performance, unless you're optimising for that platform. If you're just taking your code and blindly re-compiling it for Linux, then this could well end up worse performing than taking your well-optimised Windows binary and running it through Proton.

E.g. well-optimised game + light-touch translation layer > not-optimised blindly re-compiled native version.

So the other thing with choosing to do a Linux native version - exactly as you did with the Windows native version - you've got to optimise it for that platform to squeeze out the performance (or, indeed, with a game, typically the point is to optimise the graphics pipeline, regardless of underlying OS, because that's where the "performance sink" for most games lies).

Though, you know, that's a logical thing, not a Linux specific thing. You are also, of course, optimising your Windows version (but you just might think of that as "taken as read" during development - but you are also doing that or the Windows version will be shite performance as well. It's not a specific OS thing, it's just a general thing that if you want the best performance, you need to be optimising your code. And if you're switching underlying platforms - not just Linux to Windows, but also DirectX to Vulkan - what is "optimal" might well change).

And, honestly, with games, it's the graphics pipeline.

That is, DirectX vs. Vulkan, and optimising them. That's where it really matters.

The OS API is doing what exactly? Loading stuff from disk? They can both max out the bus speed (and, at the real extremes of that, I notice that whenever Linus Tech Tips is pushing their "insane" SSD servers to the absolute theoretical max that the hardware can manage, they always do those benchmarks with Linux, as Windows file copying is known not to be optimal - so it's not just that Linux should not be holding you back there, it's actually better, when CPU-bound. Well, unless you're using "DirectStorage" to get the GPU to do it, then Windows already has a lead on that right now. Back and forth. Back and forth. Truth is, all this sort of stuff balances out. It's not the OS itself that's going to cause the performance issues, it's going to be all in the graphics pipeline. That's where the "make or break" for a game is bound to lie, in reality. Are you using Vulkan optimally? And, even considering the OS / CPU side of things, Linux is "lean and mean" compared to Windows - it's certainly matching it blow-for-blow, if not handily exceeding it in certain spheres).

So, yeah, the sort of implicit thing here is that when we say "Linux native", we don't just mean that we've got an ELF binary. Any native version - whatever the platform - needs to be using it optimally, or what's the point?

Which brings another added dimension to "native port vs. Proton". You're not just re-compiling it for Linux, but need to be optimising it too.

When we say that creating a "Linux native" version is effort and expense, that's really what we mean. The effort and expense is optimising it. If you're using compatible tech - e.g. using Vulkan, not DirectX, on Windows - and it's coded in C / C++, then re-compiling it for Linux ain't typically that hard. But there's more to a "native port" than just getting the binary to run on another platform.
Little stoned kiwi wrote:Anyone waiting in the wings for proprietary software they want to be on Linux is doing it wrong. They are losing freedom if that software is Steam's walled-garden.
Ah, well, if you want to get all philosophical and "Richard Stallman" on me then, yes, there is that too.

And, like, I'm the 100% open source / Linux user here. I don't disagree with that, as being outside everyone's walled gardens is a freedom I enjoy.

(Though I'm not at all "Stallman" about this. I'll use proprietary software - I have nVidia's proprietary blob drivers, not the open source equivalents - if necessary. I'm a pragmatist, so "getting shit done" always wins. But if I can get shit done and avoid proprietary walled gardens then I'll preferably do that. I'll look for the open source way, and only fall back if there really is no useful / feasible options available.)

But, like, let us not fall for the naturalistic fallacy. I was reporting "what is", not "what ought to be". People should not be waiting - that is "what ought to be" - but they actually are doing that - that is "what is".

Also, the status of Steam as a "walled garden" is interesting. I mean, it absolutely is. But it's a DRM / payment walled garden - Valve throw up the walls to ensure they get paid.

But SteamOS, for example, is almost all open source components - except for the Steam Store itself. On a Steam Deck, you can "exit to desktop" and have yourself a Linux handheld. You can alternatively install Windows, if you want.

Steam is a walled garden. But it's one that's only concerned with getting paid for the games sold. Beyond that, Valve refreshingly tend not to overstep the mark. They have, indeed, made a number of enhancements and they're pushing them back upstream (they're trying to get a few things into the Linux kernel - a "WaitForMultipleObjects" API that works closer to how Windows does it, to make Proton perform better. But they haven't just done it and kept it in SteamOS to themselves. They're pushing it back to the kernel, so that the whole ecosystem can benefit. Like, Linux web server could start handling even more connections faster, by using Valve's work in the kernel).

It is an interesting one, though. Because Valve's work in the Linux realm does create conversations. For the pragmatists, it's clearly a good thing. But for the philosophers, they are uneasy that, yeah, Steam is a walled garden, even if it's the least objectionable of the walled gardens out there.
zip accident wrote:
And, of course, Windows has no such problem because it's pre-installed on 95+% of all PC desktops and laptops in existence.
Windows 11? nothing like it. I dunno, is Windows 11 even 50%?
Well, I said "Windows". As in generally. All versions of Windows combined.

I mean, that unto itself speaks volumes. Because folks are often grudgingly made to upgrade by Microsoft. They skip over every other version - because only after two versions is there really enough difference to justify bothering. Often, Windows is only upgraded with the machine - you stick with what you've got, until you need a new PC and if it comes with the newer Windows then, ah, you'll go with it.

That all just feeds into what I was saying, though. You're not really choosing Windows. You get given it, pre-installed, when you upgrade your machine. And it's already there, and you've already paid for it. So the line of least resistance is to go along with it all. It's rarely a positive choice for Windows, but just the default "do nothing" option. Just going along with it.

Whereas, on Linux, folks do tend to upgrade to new releases of their distro, as and when. I know I do. And I know that Linux websites make a fuss of new distro versions, letting people know what the new features are and they're popular articles, with many comments. And what's very interesting about that is that, unlike with Microsoft, there is zero compulsion. If you want to stick with some ancient version of a particular distro forever, then you absolutely can (though, security-wise, you probably shouldn't).

From my experience, there tends to be inertia in Microsoft getting people to upgrade, even though Microsoft try to compel it. Whereas I tend to find there's more momentum in the Linux world for upgrading, despite there being no real compulsion to do so.
"Words ought to be a little wild - for they are assaults of thought on the unthinking."
- John Maynard Keynes
Post Reply