r/linux_gaming • u/Khorsaturas • 23h ago
graphics/kernel/drivers When do new AMD features come to Linux?
AMD recently announced they added "background shader compliation" to Windows driver. This was mentioned in a recent HardwareUnboxed video. We know this applies to Windows drivers marked with version 26.9.2:
https://www.amd.com/en/resources/support-articles/faqs/PA-296.html
When do these "new features" make it to Linux? How does it work? I'm a novice, but I know that Linux doesn't have separate GPU drivers, and that we simply update the kernel and Mesa.
I'm wondering how adding this kind of thing to Windows/Linux generally works? Is it relatively parallel?
72
u/Atecep 23h ago
Linux already have shader compilation. Way earlier than Windows.
4
u/Khorsaturas 23h ago
Does this work regardless of the launcher? For example, do I have to use Steam or a specific version of Proton?
15
3
2
u/istros 23h ago
just make sure you're using the latest mesa driver available for your distro and the latest Proton available (proton-cachyos, ge-proton & proton experimental are recommended).
And yes, use Steam, because Proton only works with Steam (officially).2
u/Khorsaturas 23h ago
Thanks! I buy games only on GOG and Steam, but always play only via Steam (using GOG offline installers added to Steam library).
2
u/Indolent_Bard 16h ago
It's a little more complicated than that. Umu launcher (not a launcher, despite the name) is a way for other launchers like heroic to use proton.
1
u/Khorsaturas 16h ago
I do not need and I do not want to use Heroic. I can download an offline installer/exe directly from GOG and then 'install' the game via Steam.
2
u/friendlyreminder_ 13h ago
You need to use a game you bought on steam an Valve's official Proton versions. Adding a game manually from steam from another launcher like gog doesn't work.
2
u/Khorsaturas 13h ago
But what if I add to Steam library not the game from another launcher but directly an offline exe downloaded from GOG? In other words:
1. download an offline installer file from GOG, do NOT use Heroic Games Launcher etc. 2. go to Steam > choose to add external game to Steam library > point to the offline game installer 3. install game 4. change the path to exe to the installed game executable instead of installer 5. now I have a non-Steam game added to Steam library, I can launch it via Steam 6. change the game ID to match the one used by Steam, for Cyberpunk it is 1091500 or something like that 7. game is launched via Steam, I have acces to Steam Overlay etc.this works surprisingly well for my games so far, I have even access to Steam community controller layouts as Steam 'think' this is regular Cyberpunk after I changed the game ID. I was wondering if it works the same for shader compilation feature.
3
u/friendlyreminder_ 13h ago
That doesn't work either. Needs to be a game bought on Steam.
The games will often still work really well as on-demand pipeline shader generation is quite good, but you don't get the precompiled shaders.
Edit: I skipped over your game ID modification. I don't know if that works or not. Never heard about that before.
17
u/zappor 22h ago
Some features are true driver features, like hardware ray tracing, and for those that is a very good question.
Other features are more platform features, like Radeon Chill or this background shader compilation. And then it's a bit harder to answer since everything is so different.
I don't think we have this exact thing on Linux right now. What you can do with Steam Shader pre-caching is more like SCSKiller I would say...
8
u/Possibly-Functional 17h ago edited 17h ago
Arguably it has already been available on Linux for around 7-8 years IIRC with Fossilize.
5
u/SebastianLarsdatter 18h ago
The shader compilation works for ALL games run under Linux as it is built into the driver.
Even the Nvidia driver under Linux has this, so the news article is basically talking of AMD copying a feature from Linux to Windows.
1
u/Khorsaturas 16h ago
Wait... I am confused. Other people are saying that it works only in Steam?
3
u/SebastianLarsdatter 14h ago
The Steam shader compilation thing that is on by default, is Steam only. The box you see popping up when launching the game, this is old tech and came first and is Steam only.
But the feature in games where the shaders are compiled on the fly came later and works in any game under Linux.
2
u/Khorsaturas 13h ago
And it works out of the box or some extra steps are required from on my side? Why do we need the Steam shader compilation if we have this?
1
u/SebastianLarsdatter 6h ago
Works out of the box provided you are running recent Mesa / drivers. Although at this point it has probably trickled down to even Debian itself.
3
u/RaistlinsRegret 21h ago
Been around for ages. Elden ring PC had terrible stuttering when it launched. I never noticed it coz played on steam in linux. The pre compiled shaders on linux basically eliminated the issue.
4
u/the_abortionat0r 11h ago
Seams like there's a lot people here aren't saying or don't know.
First off, this "new" feature isn't really new. Steam adding shader precompiling/caching years ago and other launchers like Lutris support this as well; However we actually don't really need it anymore at least for AMD users.
Precompiling shaders on linux(Ignoring video transcoding) was needed to prevent stutter as every shader had to be recompiled for vulkan, this was needed for every game as vulkan is the main target for proton and it's a low level API. Windows only needs to do this for DX12 and vulkan.
However in 2023 MESA/RADV had a patch that dramatically sped up shader processing by literally 50,000% ( yes real number) meaning on AMD hardware precompiling isn't needed at all to prevent stutters. Infact when CS2 had it's shader stutter bug I guessed that's what it was as my Nvidia friends and friends on windows all had it while I didn't.
I don't even see some screens like the shader screen in A biotic factor as they processed faster than it could load the splash screen for it while my friends had to wait like 2~5 minutes processing shaders.
This isn't so much an awesome new tech were waiting for as much as it is a " look what they need to mimic our power" type thing...... as long as you're on AMD.
Nvidia has released some patches both on windows and Linux addressing shaders but nothing that does it as fast on the fly as AMDs Linux driver.
3
u/Khorsaturas 4h ago
This should be widely discussed as AMD GPU advantage and Linux advantage! But it isn't...
So to be sure that I understood correctly: it works out of the box for any game on Linux, no matter which launcher we are using, because it's built into Linux driver.
17
u/l0vely-gh0st 23h ago
people, we know steam has that feature BUT STEAM IS NOT THE ONLY STORE THAT PEOPLE USE some other stores don't have that feature and some even use pirated games the windows driver applies that to whatever games you play, so the question is will we get that kind of background compilation that works with every games from wherever you download it or will it just be a windows thing
3
u/stilriv 16h ago
That's somewhat fair, but that's the "other stores" problem, not the driver's or Steam's.
The problem with putting it into the driver is layers of responsibility. The driver already caches all compiled shaders that were, well, compiled. And to compile shaders upfront, it would need software discovery - to detect the game upon installation, rather than execution - this isn't the graphics driver job, this is your launcher / package manager / external tool layer.
edit: oh, and distributable database of those shaders of cause
3
-2
u/Low-Equipment-2621 22h ago
You can use proton with games from other stores as well, it is not limited to steam.
0
u/sleepytechnology 22h ago
Proton itself won't do shader compilation afaik, needs to be on Steam.
2
u/NoXPhasma 21h ago
Not necessarily. The software being used to compile the shaders is Fossilize and that works outside of Steam as well. One would still need to collect and share the shaders, but other than that, you can use it elsewhere.
2
u/Khorsaturas 20h ago
Will Steam perform shader compilation task for a non-Steam game added to Steam library?
2
u/NoXPhasma 20h ago
AFAIK no. Valve does not collect and compile shader caches of non-steam games.
2
u/Khorsaturas 19h ago
I am thinking on games that are already available on Steam but that I actually bought on GOG, and then added to my Steam library as a non-Steam game. I was already able to add Cyberpunk that way and then manually change the game ID to match the Steam ID to have access to Steam community controller layouts. If I have access to them, why not to the shaders compilation mechanism? I need to verify it
1
u/NoXPhasma 18h ago
You can not simply change the random generated AppID of a non-Steam game to an actual game AppID and make it work. This is not how Steam works.
1
u/Khorsaturas 16h ago
But... it works, at least with community layouts for controller. Changing the game ID to the one used by Steam somehow is mapping the game to Steam layouts library. Not sure how it works with shaders
1
-4
u/Esparadrapo 21h ago
This is a Microsoft Store exclusive on Windows. A store that might have a ~1% market share. What the fuck are you on about?
6
3
3
u/BrotherO4 16h ago
"background shader compliation" - steam has this feature for over 5 years and its much better than what window has. you just head into steam, setting, download, scroll down, and turn on background vulkan shaders
2
u/ScratchHistorical507 20h ago
As barely any games are Linux-native, that's not something any driver (in this case it would need to be done in user-land, i.e. Mesa) can realistically support, as it would have to scan all directories of any game launcher, installed in some way or another (distro-native package manager, Flatpak, Snap, AppImage,...). That makes it a bis unrealistic. What is present is Mesa's capability to create a per-user shader cache so shaders that have been created can be reused. DXVK and VKD3D also have caches, but no idea if they are also persistent.
But in general, AMD and Intel are usually quite fast to bring new features to Linux (when it makes sense to bring them to Linux). And since their drivers are open source and part of the kernel, they can both introduce much more features than their Windows drivers could ever do or adopt code of other drivers to also benefit from that work. If they require any deeper changes in Windows, the work always needs to be done my Microsoft. They may get access to the relevant source code, but it's highly questionable if they can bring new stuff as fast to Windows as they can to Linux.
but I know that Linux doesn't have separate GPU drivers, and that we simply update the kernel and Mesa.
That's a bit of a misconception, partially because it's questionable if Mesa really qualifies as drivers, and of course with Linux the drivers aren't dedicated packages (except for Nvidia) but part of the Kernel itself.. For GPUs, the most important part is the kernel-level driver. With AMD and Intel that's directly inside the Linux kernel, for Nvidia they aren't, but Nvidia seems very interested in finally changing that. For AMD, that's the amdgpu driver, for Intel the driver is called i915 (if I'm not mistaken, has been too long since I used Intel). That's what's traditionally referred to as the driver, it handles the communication between hardware and software. On top of that you have userspace (aka running on a level higher than the kernel, where also the rest of your OS lives) drivers which on Linux are basically only Mesa these days. While Mesa is referred to as a driver collection, calling it a collection of graphics (and graphics-adjacent) libraries would be less confusing. There you have libraries that actually allow normal software to access the driver through APIs like OpenGL, OpenCL, Vulkan, VA-API, etc. On the AMD side you have e.g. RADV (libvulkan_radeon) as the Vulkan "driver", the radeonsi_dri OpenGL/Gallium3D "driver", the radeonsi_drv_video VA-API "driver" or the libRusticlOpenCL OpenCL/Rusticl driver. And there can also be special drivers that aren't specific to a GPU vendor, but are rather virtual drivers, e.g. for VirtIO, which is part of many modern implementations of features for VMs. But they aren't all fully independent "drivers" per GPU vendor. Gallium3D, Rusticl and VA-API have a lot of shared infrastructure across vendors, though VA-API is only really used (to my knowledge) by AMD and Intel. Vulkan drivers are still very independent per vendor, but there are plans to do the same as with Gallium3D for OpenGL and create a unified infrastructure for all Vulkan drivers.
But all that work on both the kernel-level drivers and the userspace drivers is done in large parts by the vendors of the GPUs. But as that work is mostly open source (except for firmware and currently except for Nvidia drivers in large parts), not only they can contribute. Valve for example has paid companies like Igalia or Collabora to massively contribute to AMD drivers, as that's what their devices use. And that's probably also the reason why AMD has more and more abandoned anything proprietary in their software stack (beyond the firmware) and have also started publishing more documentation around their hardware.
1
2
u/Fritz-Futermann 23h ago
Yeah, I want to be able to enable the anti-lag feature so bad!
7
u/Voxvalve 22h ago
use CachyOS-proton with this launch argument.
LOW_LATENCY_LAYER=1 %command%1
u/Fritz-Futermann 22h ago
Proton doesn't work with War Thunder because of BattlEye anti-cheat. I can can only run it in War Thunder's native Linux client and every launch argument like the on you mentioned makes the game not start or crash. It's so frustrating because I can use FSR, but anti-lag is greyed out.
2
u/Khorsaturas 22h ago
What about using Optiscaler? It can 'translate' Reflex into Anti-Lag. But yeah... Optiscaler is not recommended for games with anti-cheat.
2
u/Fritz-Futermann 21h ago
Doesn't work. People can downvote me, but that doesn't change the facts. I know it works through Proton as a layer, but not in this case with War Thunder and native Linux.
2
u/frost19 21h ago
Have you tried this ?
ENABLE_LAYER_MESA_ANTI_LAG=1 %command%I think that variable is for driver level support (which is perform worse?, CMIIW). I think there's a new patch in RADV to automatically support it too now, dunno if this will enable it in native games.
1
u/Fritz-Futermann 21h ago edited 16h ago
Yeah, I did. Game crashes on startup. Maybe it's a thing with Vulkan and anti-lag not being implemented. It worked on Windows flawlessly tho.
4
1
u/Kagukara 21h ago
This might be of interest: https://www.phoronix.com/news/Mesa-Vulkan-AMD-Anti-Lag
0
1
u/RaistlinsRegret 21h ago
Been around for ages. Elden ring PC had terrible stuttering when it launched. I never noticed it coz played on steam in linux. The pre compiled shaders on linux basically eliminated the issue.

175
u/K900_ 23h ago
Steam already has this for Proton games on all GPUs.