Problems with nvidea drivers on linux

I have a problem
Because my gpu is optimus based
i cannot install nvidea drivers. I am not getting performance out of my machine
If i try to install the drivers my OS breaks and i am forced to reinstall and purge the drivers
how can i disable optimus or fix this problem

Depends on your system and distro.
See this how to configure prime by hand:
[url]https://devtalk.nvidia.com/default/topic/1022670/linux/official-driver-384-59-with-geforce-1050m-doesn-t-work-on-opensuse-tumbleweed-kde/post/5203910/#5203910[/url]