[SOLVED] The custom launch command below works to force it to use the correct GPU!
DXVK_FILTER_DEVICE_NAME="NVIDIA GeForce RTX 4090 Laptop GPU" %command%
[ORIGINAL] So, I have this new laptop I got which has an NVIDIA RTX 4090M GPU, and also an integrated Intel GPU. Obviously, I only want to use the Intel GPU for less intensive apps, and to use the NVIDIA GPU for games or other intensive applications, such as AI.
Through trial, error, and lucky searches on the internet, I figured out some things that do and don’t work.
- Plugging in the laptop makes the NVIDIA GPU run much faster
- The default Fedora NVIDIA drivers work fine, I don’t need to install any alternatives
- To make a normal app use the GPU, all I have to do is right click the icon and click ‘Launch with discrete GPU’ (on GNOME), or to make it open with discrete GPU by default (and launching with the integrated GPU would be an option in the context menu), I have to copy the desktop file to ~/.local/share/applications, and edit the .desktop file so it contains the line PrefersNonDefaultGPU=true
- For Steam apps, the previous method doesn’t work (for some reason - maybe it uses a custom launch process?), but after trying many different ways, I was able to get most Steam apps to use the correct GPU (GPU 0) by adding the custom launch option PROTON_USE_WINED3D=0 %command%
- For some reason, this doesn’t work for Hogwarts Legacy. It, of all games, really wants to use the Intel graphics - even with the custom launch command, PrefersNonDefaultGPU=true, and in game setting the preferred GPU to my NVIDIA one - yes, it is listed and recognised in game - I can tell both from the Resources app and the abysmal performance that my NVIDIA GPU is not being used and my Intel GPU is
- Other apps like Portal RTX, The Witcher 3, ComfyUI (running through Krita AI Diffusion), Blender, and Civilisation 6 are running great with the NVIDIA GPU
- I do not have prime-run installed and do not need it
My laptop model is MEDION Beast X40.
I’m honestly at my wits end.
Any suggestions?
- For Steam apps, the previous method doesn’t work (for some reason - maybe it uses a custom launch process?), but after trying many different ways, I was able to get most Steam apps to use the correct GPU (GPU 0) by adding the custom launch option PROTON_USE_WINED3D=0 %command%
Steam runs the commands to launch the games directly, so editing .desktop files won’t affect anything launched through steam directly.
PROTON_USE_WINED3D=0 is related to the graphics back ends, so I wouldn’t use it for selecting the GPU, as, while it might work for making a game use the dedicated GPU, it probably won’t work reliably as you’ve discovered. For setting a game to run on the NVIDIA GPU I think PRIME and NVIDIA Optimus are the solution, but I can’t help you much since all my systems have only a single GPU enabled. One of the following 3 launch options in steam should work:
__NV_PRIME_RENDER_OFFLOAD=1 __GLX_VENDOR_LIBRARY_NAME=nvidia __VK_LAYER_NV_optimus=NVIDIA_only %command%
DRI_PRIME=1 %command%
prime-run %command%
I did actually try all those other commands, and they didn’t work, that was when I discovered that I didn’t have prime-run installed and didn’t need it. If this command works, I’m not going to mess with it, lol.
But thanks for all your intended help!
Fair enough, but I think the
DXVK_FILTER_DEVICE_NAME
command you’ve got now will only work for DXVK, if you launch a game that uses vulkan directly (rather than via translating DirectX calls through DXVK) you might possibly find the game running on the wrong GPU, just bare that in mindI guess I’ll have to figure that out if I want to get a new game to run, then, but all my current games are working.
Exceedingly rare NVIDIA W
J. K. Rowling is a transphobe and a bigot.
Agreed, but can we focus on the problem?
Thanks so much! That page enabled me to try the launch command DXVK_FILTER_DEVICE_NAME=“NVIDIA GeForce RTX 4090 Laptop GPU” %command% which fixed it!
👍
Always check ProtonDB when in doubt. Add your comments as well to let other users know it worked as they may be in a similar situation.