I’m thinking about buying a Framework 16 laptop with the GPU module, but I have some questions about how the hybrid graphics works in Linux. I’ve read some posts about how you have to set environment variables to use the dGPU for applications, but I’m still quite new to Linux and I don’t really understand what that entails. Does every application need to be individually set to use the dGPU? What about applications that run through Steam? Do I only set the environment variable for Steam, and then all the games also have the same setting, or do I have to set it for ever game individually?
Since I’m not very comfortable with this level of tinkering in Linux yet, I’m wondering if there’s away to just use the dGPU for everything. I understand the battery life will be worse if I do this, but that honestly doesn’t bother me, since the laptop will be plugged in 90% of the time anyway. So is there a way that I can easily set up my system to exclusively use the dGPU for every application? I’d really like to know if this is possible, since it will make things a lot simpler for me.
My game plan is to use Fedora, not sure if this changes anything.
Thank you in advance!
DRI_PRIME=1 is a standard environment variable. the steam syntax of that followed by %command% is just telling steam that it needs to put that in front of the actual executable name.
you can do the same thing on the command line yourself, or set up a shell script. many desktop environment launchers also have a way of specifying the same thing. assuming, of course, that the app/game in question doesn’t do the thing you expect automatically.
It’s even easier than using DRI_PRIME=1: switcherooctl launch %command%
This should even work for all other programs as well, e.g. switcherooctl launch firefox
There is an article about this tool here (It’s about openSUSE, but applies to all linux distros)
Edit:
Sometimes DRI_PRIME didnt work for me, but switcherooctl worked pretty well so far.
As well, you could likely edit the .desktop file for a particular application to force the use of the dGPU.
Example:
[Desktop Entry]
Name=Brotato
Comment=Play this game on Steam
Exec=steam steam://rungameid/1942280
Icon=steam_icon_1942280
Terminal=false
Type=Application
Categories=Game;
PrefersNonDefaultGPU=true <<<<< This line
I haven’t fully tested this. But this was the default entry in Blender’s .desktop file.
I used the Brotato .desktop entry as an example as this is a much smaller entry.
EDIT: I tested this with “Brotato” and it does not seem to work. However, since that was a Steam game, it may be why.
I can finagle around with this on some non-steam apps. But I do not currently have any non-steam games to test with that do not already use the dGPU.