[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?