I was going to activate my NVIDIA 940MX to play some Tomb Raider when I saw that nvidia-settings has a new option: on-demand.
Activating the option allows you to run only selected applications on the discrete GPU. How to activate that on Steam?
Let’s take an example of Tomb Raider:
Step 1: Open steam and go to Library
Step 2: Go on game settings:
Step 3: Set launch option as follows:
__NV_PRIME_RENDER_OFFLOAD=1 __GLX_VENDOR_LIBRARY_NAME=nvidia %command%
And voila! Next time you open the game, it’ll run on your discrete GPU. You can check it with nvidia-smi