I've been trying to use the Nvidia GPU in laptops with Nvidia Optimus with Nvidia's proprietary driver on Linux since 2012 with no success. I've tried everything I can possibly think of now; no matter what I do it fails to work. Below are all the results I have ever gotten from clean installing a debian-based distro on either of my two Optimus laptops (ASUS A53SV with GMA HD 2000/GeForce GT 540M and Lenovo ThinkPad W550s with GMA HD 5500/Quadro K620M) and following one of any of the many different sets of directions for using the proprietary driver to use the GPU or for solving any problems preventing this that I've found on any forums, wikis or other websites related to the distribution. Not once have I actually successfully run an application using the Nvidia GPU AND the Nvidia proprietary driver.
* "optirun <anything>" outputs "[ERROR]Cannot access secondary GPU - error: Could not load GPU driver"
* "optirun <anything>" outputs "[ERROR]Cannot access secondary GPU - error: [XORG] (EE) No devices detected."
* "optirun <anything>" outputs "[ERROR]Cannot access secondary GPU - error: [XORG] (EE) NVIDIA(0): Failed to initialize the NVIDIA GPU at PCI:<whatever>."
* similar errors with "primusrun <anything>" - note: for this or each of the above, the error is logged in /var/log/Xorg.8.log, etc as the same thing in a slightly different syntax.
* on login the entire X.org service immediately crashes to a completely black screen - the only way to launch it again in all cases I've found is to log into a tty or ssh the computer and purge all the nvidia proprietary packages manually, then restart.
* the same as above, except instead of a black screen a glitched-out borderless "fallback xorg" message and window appear, sometimes with an X-shaped cursor visible in places if the mouse is moved around the screen. Usually, though, the cursor cannot interact with the window, and often the screen is partially filled with artifacts and/or scrambled pixels.
All of the things I have unsuccessfully tried in every conceivable combination to solve this:
* all sorts of messing with xorg.conf such as forcing ACPI on, also messing with /proc/acpi/bbswitch trying to influence the GPU
* all sorts of messing with other x.org configuration and utilities such as xconfig or nvidia-xconfig
* using every different combination of different versions and distro packages of the proprietary driver and different installation orders with and without bumblebee and with and without various optional packages fathomable, even getting directly from nvidia
* blacklisting all sorts of combinations of noveau or different versions of the proprietary driver
* many different versions of the linux kernel and kernel headers and different debian-based distros and versions (various versions of ubuntu, mint, other ubuntu flavors, architectures, plain debian, even steamos)
* all possible configurations of bumblebee.conf and various graphics-related environment variables such as DRI_PRIME, trying to mess with nvidia-controls, also being in the usergroup for bumblebee service
note: each of these mentioned single solutions or combinations that I could find or think of I tried at least once on a different clean install.
NONE of the solutions presented or linked to as of yet in these several massive threads http://ubuntuforums.org/showthread.php?t=2036010 https://lists.launchpad.net/bumblebee/msg00090.html https://forum.manjaro.org/index.php?topic=14442.0 have helped at all (note: I have tried many solutions in threads not related to debian distros, because they get the same error, so I didn't see why not) - the most anything I've tried has done is change the error or undesirable result to something else, sometimes back again - always getting one or more of the above listed errors or crashes. Frequently my error logs and outputs for the diagnostics mentioned in those threads have been identical to one or more of the posters, but what solves the issue for them does nothing for me (or in the case of the first ubuntu forums thread, I've had identical results before to that guy whose issue remained - THAT IS, right up until he said "NEVERMIND, DONT KNOW WHAT I DID, BUT IT WORKS ALL OF A SUDDEN" - *"thread solved"* ಠ_ಠ
I've been trying on-and-off to solve this for a very long time, hoping that eventually Nvidia proprietary or bumblebee will be updated to not be so horrendous, or that Nvidia will start actually supporting linux ("Nvidia, fuck you!" - Linus Torvalds).
I said I tried as many combinations of all of this as I could, but I haven't done many of them since 2013 or so, and it's very possible I missed one. So, if you have any idea at all of a magical, exactly particular set of directions that might be able to solve this, even if it involves things I've already tried, please tell and I will try it.
for thoroughness, both of my Optimus laptops mentioned here surely have no hardware issues or dying GPU, because they both work perfectly under windows - I've actually never had a single problem with their graphics on windows besides minor bugs in the older windows and drivers and they benchmark to the scores they ought to every time.
Right at the moment I've got my Thinkpad W550s here with a clean install of Ubuntu MATE 15.04 64-bit on it. If you give me an idea for solving this or ask for tests or log information that doesn't require a different distro or the other computer, this is what I'll be using.