After installing bumblebee on debian 9 by
sudo apt-get install bumblebee primus as described in debian-bumblebee webpage to use intel and nvidia (Geforce 940MX) gpu in my ASUS computer and running
optirun glxgears to test it, I got this message
[ 2478.780360] [ERROR]Cannot access secondary GPU - error: [XORG] (EE) [drm] Failed to open DRM device for pci:0000:01:00.0: -19
[ 2478.780506] [ERROR]Aborting because fallback start is disabled.
If I entered
optirun -vv glxgears to see errors, I got
[ 2488.811395] [DEBUG]Reading file: /etc/bumblebee/bumblebee.conf
[ 2488.812317] [DEBUG]optirun version 3.2.1 starting...**
[ 2488.812349] [DEBUG]Active configuration:
[ 2488.812360] [DEBUG] bumblebeed config file: /etc/bumblebee/bumblebee.conf
[ 2488.812370] [DEBUG] X display: :8
[ 2488.812380] [DEBUG] LD_LIBRARY_PATH:
[ 2488.812390] [DEBUG] Socket path: /var/run/bumblebee.socket
[ 2488.812405] [DEBUG] Accel/display bridge: auto
[ 2488.812428] [DEBUG] VGL Compression: proxy
[ 2488.812449] [DEBUG] VGLrun extra options:
[ 2488.812474] [DEBUG] Primus LD Path: /usr/lib/x86_64-linux-gnu/primus:/usr/lib/i386-linux-gnu/primus:/usr/lib/primus:/usr/lib32/primus
[ 2488.812613] [DEBUG]Using auto-detected bridge primus
[ 2488.952035] [INFO]Response: No - error: [XORG] (EE) [drm] Failed to open DRM device for pci:0000:01:00.0: -19
[ 2488.952080] [ERROR]Cannot access secondary GPU - error: [XORG] (EE) [drm] Failed to open DRM device for pci:0000:01:00.0: -19
[ 2488.952102] [DEBUG]Socket closed.
[ 2488.952142] [ERROR]Aborting because fallback start is disabled.
[ 2488.952160] [DEBUG]Killing all remaining processes.
I have already appended the following section to /etc/bumblebee/xorg.conf.nvidia
Section "Screen" Identifier "Default Screen" Device "DiscreteNvidia" EndSection
and changed this line "KernelDriver=nvidia" to "KernelDriver=nvidia-current" in /etc/bumblebee/bumblebee.conf. However, I still get same message. What should I do?
Edit: I solve the problem. I have used nouveau free drivers for nvidia with bumblebee and it was not working somehow. If I have tried to install bumblebee-nvidia as another option, I have gotten black screen after reboot and I have remove whole nvidia contents. (The reason looks like nouveau clashes with nvidia as I understand after everything). However, I have removed nouveau driver and added
options nouveau modeset=0
alias nouveau off
alias lbm-nouveau off
into blacklist in file
/etc/modprobe.d/blacklist-nouveau.conf and in this time installed bumblebee-nvidia and one more package by these command
sudo apt-get install -t stretch-backports bumblebee-nvidia primus and
sudo apt-get install -t stretch-backports libgl1-nvidia-glx:i386 from backports of stretch.
After adding my username into bumblebee by
sudo adduser $USER bumblebee (where $USER corresponds to your username) and rebooting,
optirun glxgears is working now.