I have an Intel i5 processor with a HD IGP and a Nvidia 950M, but all applications use the Intel HD. How can I switch graphics when I run a game?
First you need to install the official nvidia drivers:
sudo ubuntu-drivers autoinstall
Then, after rebooting, you can choose the card to use in the programm "NVIDIA X Server Settings" in the option "PRIME-Profiles"
Note that you can't use both at the same time. You either have to render everything using Nvidia, or everything using Intel.