title: Debian bumblebee problems
body: <p>I am on a clean minimal Debian Stretch install with just a couple of graphical packages installed. I instelled these: </p>
  
  <pre><code>sudo apt install xserver-xorg-core xinit bumblebee-nvidia primus primus-libs:i386 libgl1-nvidia-glx:i386
  </code></pre>
  
  <p>But I could swap propietary <code>bumblebee-nvidia</code> with open source <code>bumblebee</code>. </p>
  
  <p>I also put my user to the bumblebee group:</p>
  
  <pre><code>sudo adduser $USER bumblebee
  </code></pre>
  
  <hr>
  
  <p>After reboot my Intel card works fine: </p>
  
  <pre><code>ziga@ziga-laptop:~$ glxinfo | grep OpenGL
  OpenGL vendor string: Intel Open Source Technology Center
  OpenGL renderer string: Mesa DRI Intel(R) Ivybridge Mobile 
  OpenGL core profile version string: 3.3 (Core Profile) Mesa 13.0.6
  OpenGL core profile shading language version string: 3.30
  OpenGL core profile context flags: (none)
  OpenGL core profile profile mask: core profile
  OpenGL core profile extensions:
  OpenGL version string: 3.0 Mesa 13.0.6
  OpenGL shading language version string: 1.30
  OpenGL context flags: (none)
  OpenGL extensions:
  OpenGL ES profile version string: OpenGL ES 3.0 Mesa 13.0.6
  OpenGL ES profile shading language version string: OpenGL ES GLSL ES 3.00
  OpenGL ES profile extensions:
  </code></pre>
  
  <p>But my Nvidia card wich is <strong>Geforce 610M</strong> won't work when called with <code>optirun</code>:</p>
  
  <pre><code>ziga@ziga-laptop:~$ optirun glxinfo | grep OpenGL
  primus: fatal: failed to load any of the libraries: /usr/lib/x86_64-linux-gnu/nvidia/libGL.so.1:/usr/lib/i386-linux-gnu/nvidia/libGL.so.1:/usr/lib/nvidia/libGL.so.1
  /usr/lib/x86_64-linux-gnu/nvidia/libGL.so.1: cannot open shared object file: No such file or directory
  /usr/lib/i386-linux-gnu/nvidia/libGL.so.1: wrong ELF class: ELFCLASS32
  /usr/lib/nvidia/libGL.so.1: cannot open shared object file: No such file or directory
  </code></pre>
  
  <p>If I use <code>apt</code> to search for my card I get this: </p>
  
  <pre><code>ziga@ziga-laptop:~$ sudo apt search 610M
  Sorting... Done
  Full Text Search... Done
  nvidia-legacy-304xx-driver/stable 304.137-5~deb9u1 amd64
    NVIDIA metapackage (304xx legacy version)
  
  nvidia-legacy-304xx-kernel-dkms/stable 304.137-5~deb9u1 amd64
    NVIDIA binary kernel module DKMS source (304xx legacy version)
  
  nvidia-legacy-304xx-kernel-source/stable 304.137-5~deb9u1 i386
    NVIDIA binary kernel module source (304xx legacy version)
  
  xserver-xorg-video-nvidia-legacy-304xx/stable 304.137-5~deb9u1 amd64
    NVIDIA binary Xorg driver (304xx legacy version)
  </code></pre>
  
  <p>From this I would install <code>nvidia-legacy-304xx-driver</code> but I am afraid this won't work well with other packages that I have installed above. Is it possible that I also need <code>xserver-xorg-video-nvidia-legacy-304xx</code>?</p>
  
  <p><strong>Can anyone explain to me which packages to install and why?</strong></p>
  
  <hr>
  
  <p>Well, I couldn't wait any longer and I tried installing the <code>xserver-xorg-video-nvidia-legacy-304xx</code>. It really looks like this package is in conflict with <code>bumblebee-nvidia</code> package. I got this after installation:</p>
  
  <pre><code>nvidia-legacy-304xx:
  Running module version sanity check.
   - Original module
     - No original module exists within this kernel
   - Installation
     - Installing to /lib/modules/4.9.0-8-amd64/updates/dkms/
  
  depmod...
  
  DKMS: install completed.
  Setting up nvidia-legacy-304xx-driver (304.137-5~deb9u1) ...
  Processing triggers for libc-bin (2.24-11+deb9u3) ...
  Processing triggers for glx-alternative-nvidia (0.8.3~deb9u1) ...
  Processing triggers for menu (2.1.47+b1) ...
  Processing triggers for update-glx (0.8.3~deb9u1) ...
  Processing triggers for glx-alternative-nvidia (0.8.3~deb9u1) ...
  update-alternatives: warning: forcing reinstallation of alternative /usr/lib/nvidia/bumblebee because link group glx is broken
  Processing triggers for libc-bin (2.24-11+deb9u3) ...
  Processing triggers for initramfs-tools (0.130) ...
  update-initramfs: Generating /boot/initrd.img-4.9.0-8-amd64
  Processing triggers for bumblebee (3.2.1-14) ...
  </code></pre>
  
  <hr>
  
  <p>I uninstalled the <code>xserver-xorg-video-nvidia-legacy-304xx</code> and tried to install the <code>nvidia-legacy-304xx-driver</code> package which also installed the <code>xserver-xorg-video-nvidia-legacy-304xx</code> package. It returned no warnings and no errors, but after reboot <code>optirun glxinfo | grep OpenGL</code> command still fails...</p>
  
  <p>It looks like there is no solution to this even on Debian which was supposed to be stable?</p>
  
  <hr>
  
  <p>Like @Antonio Orizondo Leyva sugested I installed the packages he suggests and executed the command <code>sudo update-alternatives --config glx</code> and I got to choose different options for my GPU's: </p>
  
  <pre><code>There are 3 choices for the alternative glx (providing /usr/lib/glx).
  
    Selection    Path                       Priority   Status
  ------------------------------------------------------------
    0            /usr/lib/nvidia/bumblebee   125       auto mode
    1            /usr/lib/mesa-diverted      5         manual mode
    2            /usr/lib/nvidia             100       manual mode
  * 3            /usr/lib/nvidia/bumblebee   125       manual mode
  
  Press &lt;enter&gt; to keep the current choice[*], or type selection number: 
  </code></pre>
  
  <p>I tried selecting every single one of them and then rebooted, but the end result was the same... Except for the second option (<code>nvidia</code>) which after reboot said it can't find <code>openGL.1.so</code> or something... So it is impossible to even use the Nvidia card by itself!? </p>
  
  <p>Any other Ideas?</p>