Optimus Video and openSUSE Leap 42.3
Optimus is a kind of computer with an Intel video card backed for 3D computing by an NVIDIA video card. A real pain in the ass to configure. This one is on an ASUS N550 laptop.
Bumblebee install (openSUSE Leap 15.1)
Plain intel
If, at start, you install as default you get a not so bad 60 frames/s (monitor values - glxspheres in Mesa-demo-x) display. with defaults from 15.1 install (no intel driver installed).
I didn't notice this on previous installs, but now with Leap 15.1 the basic install have an nvidia driver (g04??), with nvidia-xxx utilities installed, but not working - trying "nvidia-xconfig" as root prevent graphics to start (only command line available). But without xorg.conf file, kde starts with some default driver.
Bumblebee
To make optimus works it seems to be enough to install bumblebee. To manage VIRTUALHEAD install "xf86-video-intel", needed for creating virtual device. Bumblebee is needed to use the secondary nvidia card, nvidia-glx* are removed and "xf86-video-nouveau" installed.
make it permanent with as root:
systemctl enable bumblebeed systemctl start bumblebeed echo "blacklist nouveau" | tee -a /etc/modprobe.d/99-local.conf mkinitrd
on 15.1 seems to works:
# optirun glxspheres Polygons in scene: 62464 (61 spheres * 1024 polys/spheres) Visual ID of window: 0x21 Context is Direct OpenGL Renderer: GeForce GTX 850M/PCIe/SSE2 430.111605 frames/sec - 374.936888 Mpixels/sec
"optirun" have to be launched before any application that one want to be accelerated.
Obsolete as of august 2019
Optimus
The openSUSE page on the subject is only validated for Leap 42.2, may be it's why I had problems:
https://en.opensuse.org/SDB:NVIDIA_Bumblebee
What is kinda difficult is than as this is not immediate, you have to make several test iterations and this may keep in the system unwanted trash that prevent correct working.
First thing is that I could very well accept to have the Nvidia graphic adapter to run constantly, but I couldn't get it. Only the Intel one provide display...
I didn't create a snapshot, anyway no of my present snapshot accept to boot...
On Leap 42.3, Bumblebee is standard in the repos, no need to add an other one - same on 15.1.
Starting from scratch
After some time of fiddling, you may be lost on what you have running. Here some steps you can do to go back bare bone.
In Yast, you may have a repository "nvidia". Select the repository view, right click in the package windows, "all in this list", "remove all". This is the only way to really remove the nvidia drivers (if you deselect only one, an other is automatically selected). Validate.
Go to /etc/X11/xorg.conf.d/ as root, then "grep nvidia *" and comment out any info. The bare files have only comments, so comment all what could have been added manually.
also remove /etc/X11/xorg.conf if any (or rename it to keep the content.
Then reboot, you should (hopefully) get a minimal graphical login.
If ever you don't get any usable screen, restart the computer and go to the grub menu. As soon as the grub menu come, press "e" (the key "E"), this lead you to the grub editor.
With the cursor arrows, go to the "linux..." line. The "end" key send you to the end of the line. remove all the options on right of the resume option, then add the number "3" (type 3, without quotes. Then F10 should boot you in console mode, where you can login and use yast or fix the problems.
Debugging
There are lot of things you can do to debug. Some things like xrander have to be done from user graphical session, others like editing config files have to be done from root, eventually on terminal login.
Discussion on openSUSE forum
As user
See here http://dodin.org/wiki/pmwiki.php?n=Doc.AddXResolution
You can also use glxspheres to compute frame speed and other xrandr options.
glxinfo | grep OpenGL
> DRI_PRIME=1 glxgears Running synchronized to the vertical refresh. The framerate should be approximately the same as the monitor refresh rate. 63058 frames in 5.0 seconds = 12611.530 FPS 65706 frames in 5.0 seconds = 13141.032 FPS 65580 frames in 5.0 seconds = 13116.000 FPS XIO: fatal IO error 11 (Resource temporarily unavailable) on X server ":0" after 390157 requests (390157 known processed) with 0 events remaining. jdd@linux-owxt:~> glxgears Running synchronized to the vertical refresh. The framerate should be approximately the same as the monitor refresh rate. 303 frames in 5.0 seconds = 60.443 FPS XIO: fatal IO error 11 (Resource temporarily unavailable) on X server ":0" after 1424 requests (1424 known processed) with 0 events remaining. > DRI_PRIME=1 vblank_mode=0 glxspheres Polygons in scene: 62464 (61 spheres * 1024 polys/spheres) ATTENTION: default value of option vblank_mode overridden by environment. ATTENTION: default value of option vblank_mode overridden by environment. Visual ID of window: 0xcc Context is Direct OpenGL Renderer: Mesa DRI Intel(R) Haswell Mobile 278.135247 frames/sec - 310.398936 Mpixels/sec 236.548003 frames/sec - 263.987571 Mpixels/sec 228.816889 frames/sec - 236.956655 Mpixels/sec 244.373569 frames/sec - 213.934397 Mpixels/sec vblank_mode=0 glxspheres Polygons in scene: 62464 (61 spheres * 1024 polys/spheres) ATTENTION: default value of option vblank_mode overridden by environment. ATTENTION: default value of option vblank_mode overridden by environment. Visual ID of window: 0xcc Context is Direct OpenGL Renderer: Mesa DRI Intel(R) Haswell Mobile 289.221488 frames/sec - 322.771180 Mpixels/sec 248.459156 frames/sec - 277.280418 Mpixels/sec 241.233564 frames/sec - 269.216657 Mpixels/sec 248.060248 frames/sec - 276.835237 Mpixels/sec
As root
Use zypper to configure your system. It's often easier than YaST, because it allows copy/paste.
Edit the config files in /etc/X11 and under.
use VI or your preferred editor to edit.
Use ldconfig if you change something in the libraries (link to module...).
Use mkinitrd to rebuild the initrd boot system.
look at X logs:
# less /var/log/Xorg.0.log
Look for "DDC" (https://en.wikipedia.org/wiki/Display_Data_Channel), EDID (https://en.wikipedia.org/wiki/Extended_Display_Identification_Data), vga...
install and use glmark2
Kernel
Bumblebee is very much kernel dependent. Installing the very last kernel may make something work. Right now (september 27, 2017), KOTD saved my life with linux-owxt.suse 4.14.0-rc1-3.g6627c5a-default that made nouveau work with optirun.
Installing Bumblebee
Go to yast, search for bumblebee, right clic, all in this list, install...
You can as well type or copy in a root terminal:
zypper in bumblebee bbswitch
Then subscribe your user to video and bumblebee groups either with YaST or with:
usermod -aG bumblebee <username> usermod -aG video <username>
(this will only be active at the next login)
Then validate the service, either with YaST, system, service manager or:
systemctl enable bumblebeed systemctl start bumblebeed
(warning: don't miss the "d" at the end of bumblebee, for "daemon").
Blacklist nouveau that shouldn't be started before bumblebee:
echo "blacklist nouveau" | tee -a /etc/modprobe.d/99-local.conf
or simply write "Blacklist nouveau" in the /etc/modprobe.d/99-local.conf file.
Then prepare the boot with
mkinitrd
Check in /etc/bumblebee/bumblebee.conf if Driver=nouveau as it should.
using forum
better use zypper se --installed-only nvidia, then remove all what is in the nvidia repo.
# ll -R /etc/sysconfig/n* | grep nvidia # zypper in xf86-video-intel
bumblebee in now in main repo
nvidia-bumblebee do not exist anymore, trying OBS
don't works