Of course there is no real NVIDIA Optimus on Linux, but I found an article that gives some workaround: https://bbs.deepin.org/forum.php?mod=viewthread&tid=132312. Below are the steps described in the article.
Install drivers
sudo apt-get install bumblebee-nvidia nvidia-driver nvidia-settings
Verify the installation
sudo apt-get install mesa-utils
note: mesa-utils package provides useful tools to show glx information
optrun glxinfo | grep NVIDIA
note: this step checks whether the installation succeeded.
optirun glxgears -info
note: if you see a notice of your graphics card, you are good.
Run games with your nvidia graphics
Primusrun game
or
optirun game
to run steam games:
https://support.steampowered.com/kb_article.php?ref=6316-GJKC-7437