Note that this article is more accurate & useful. Read that instead.
Optimus uses the integrated graphics controller to render to a surface when the discrete graphics card is not in operation. When discrete graphics is in operation, it renders to the surface hosted by integrated graphics.
There’s a good and detailed explanation of this here.
To find the integrated graphics on the PCI bus:
1 2 |
lspci | grep VGA # 00:02.0 VGA compatible controller: Intel Corporation 4th Gen Core Processor Integrated Graphics Controller (rev 06) |
To find the discrete graphics on the PCI bus:
1 2 |
lspci | grep 3D # 01:00.0 3D controller: NVIDIA Corporation GM107M [GeForce GTX 860M] (rev ff) |
This is needed for the next step.
Install Bumblebee
1 2 3 4 5 |
sudo add-apt-repository ppa:bumblebee/stable sudo apt-get install --no-install-recommends bumblebee sudo apt-get install bumblebee-nvidia sudo apt-get update sudo apt-get install virtualgl primus primus-libs-ia32 |
Note that when the bumblebee installer runs, it only finds the discrete graphics card, not the VGA integrated graphics:
1 2 3 4 5 6 7 8 9 10 11 12 |
Setting up bumblebee (3.2.1-5) ... Adding members from group(s) 'adm sudo admin' to 'bumblebee': rob syslog Adding user rob to group bumblebee Adding user syslog to group bumblebee Selecting 01:00:0 as discrete nvidia card. If this is incorrect, edit the BusID line in /etc/bumblebee/xorg.conf.nouveau . bumblebeed start/running, process 14945 Processing triggers for initramfs-tools (0.103ubuntu4.2) ... update-initramfs: Generating /boot/initrd.img-3.13.0-37-generic Warning: No support for locale: en_US.utf8 Processing triggers for ureadahead (0.100.0-16) ... |
Update & upgrade afterwards.
1 2 |
sudo apt-get update sudo apt-get upgrade |
Install a recent Proprietary Nvidia Driver
1 |
sudo apt-get install nvidia-331 |
Tell Bumblebee where the integrated graphics is
As mentioned above, Bumblebee needs to know where the integrated VGA card is as well as the discrete 3D card.
Distressingly, it needs to know this information in the correct order. VGA must be specified first, then 3D:
1 2 3 4 |
# Edit /etc/bumblebee/xorg.conf.nvidia # change it to contain: # BusID "PCI:00:02:0" # VGA # BusID "PCI:01:00:0" # 3D |
After a reboot, you should be able to use optirun to run using discrete graphics. You’ll know it’s running discrete graphics because it’ll run at crazy fps, and the fan will sound like a vacuum cleaner!
To try out your new blitzbox, you can try this:
1 2 |
$ sudo apt-get install glmark2 $ glmark2 |
This should produce something like:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 |
======================================================= glmark2 2012.08 ======================================================= OpenGL Information GL_VENDOR: Intel Open Source Technology Center GL_RENDERER: Mesa DRI Intel(R) Haswell Mobile GL_VERSION: 3.0 Mesa 10.1.3 ======================================================= [build] use-vbo=false: FPS: 722 FrameTime: 1.385 ms [build] use-vbo=true: FPS: 730 FrameTime: 1.370 ms [texture] texture-filter=nearest: FPS: 820 FrameTime: 1.220 ms [texture] texture-filter=linear: FPS: 817 FrameTime: 1.224 ms [texture] texture-filter=mipmap: FPS: 820 FrameTime: 1.220 ms [shading] shading=gouraud: FPS: 682 FrameTime: 1.466 ms [shading] shading=blinn-phong-inf: FPS: 683 FrameTime: 1.464 ms [shading] shading=phong: FPS: 675 FrameTime: 1.481 ms [bump] bump-render=high-poly: FPS: 382 FrameTime: 2.618 ms [bump] bump-render=normals: FPS: 815 FrameTime: 1.227 ms [bump] bump-render=height: FPS: 818 FrameTime: 1.222 ms [effect2d] kernel=0,1,0;1,-4,1;0,1,0;: FPS: 518 FrameTime: 1.931 ms [effect2d] kernel=1,1,1,1,1;1,1,1,1,1;1,1,1,1,1;: FPS: 239 FrameTime: 4.184 ms [pulsar] light=false:quads=5:texture=false: FPS: 625 FrameTime: 1.600 ms [desktop] blur-radius=5:effect=blur:passes=1:separable=true:windows=4: FPS: 240 FrameTime: 4.167 ms [desktop] effect=shadow:windows=4: FPS: 370 FrameTime: 2.703 ms [buffer] columns=200:interleave=false:update-dispersion=0.9:update-fraction=0.5:update-method=map: FPS: 359 FrameTime: 2.786 ms [buffer] columns=200:interleave=false:update-dispersion=0.9:update-fraction=0.5:update-method=subdata: FPS: 390 FrameTime: 2.564 ms [buffer] columns=200:interleave=true:update-dispersion=0.9:update-fraction=0.5:update-method=map: FPS: 382 FrameTime: 2.618 ms [ideas] speed=duration: FPS: 574 FrameTime: 1.742 ms [jellyfish] : FPS: 399 FrameTime: 2.506 ms [terrain] : FPS: 63 FrameTime: 15.873 ms [conditionals] fragment-steps=0:vertex-steps=0: FPS: 716 FrameTime: 1.397 ms [conditionals] fragment-steps=5:vertex-steps=0: FPS: 732 FrameTime: 1.366 ms [conditionals] fragment-steps=0:vertex-steps=5: FPS: 719 FrameTime: 1.391 ms [function] fragment-complexity=low:fragment-steps=5: FPS: 722 FrameTime: 1.385 ms [function] fragment-complexity=medium:fragment-steps=5: FPS: 732 FrameTime: 1.366 ms [loop] fragment-loop=false:fragment-steps=5:vertex-steps=5: FPS: 720 FrameTime: 1.389 ms [loop] fragment-steps=5:fragment-uniform=false:vertex-steps=5: FPS: 721 FrameTime: 1.387 ms [loop] fragment-steps=5:fragment-uniform=true:vertex-steps=5: FPS: 727 FrameTime: 1.376 ms ======================================================= glmark2 Score: 597 ======================================================= |
You could then turn on the graphics card to run this test again on faster hardware by doing:
1 |
optirun glmark2 |
On my box, glmark2 is actually showing a lower performance for the Nvidia card:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 |
======================================================= glmark2 2012.08 ======================================================= OpenGL Information GL_VENDOR: NVIDIA Corporation GL_RENDERER: GeForce GTX 860M/PCIe/SSE2 GL_VERSION: 4.4.0 NVIDIA 331.113 ======================================================= [build] use-vbo=false: FPS: 437 FrameTime: 2.288 ms [build] use-vbo=true: FPS: 468 FrameTime: 2.137 ms [texture] texture-filter=nearest: FPS: 461 FrameTime: 2.169 ms [texture] texture-filter=linear: FPS: 499 FrameTime: 2.004 ms [texture] texture-filter=mipmap: FPS: 522 FrameTime: 1.916 ms [shading] shading=gouraud: FPS: 518 FrameTime: 1.931 ms [shading] shading=blinn-phong-inf: FPS: 524 FrameTime: 1.908 ms [shading] shading=phong: FPS: 516 FrameTime: 1.938 ms [bump] bump-render=high-poly: FPS: 508 FrameTime: 1.969 ms [bump] bump-render=normals: FPS: 516 FrameTime: 1.938 ms [bump] bump-render=height: FPS: 515 FrameTime: 1.942 ms [effect2d] kernel=0,1,0;1,-4,1;0,1,0;: FPS: 521 FrameTime: 1.919 ms [effect2d] kernel=1,1,1,1,1;1,1,1,1,1;1,1,1,1,1;: FPS: 488 FrameTime: 2.049 ms [pulsar] light=false:quads=5:texture=false: FPS: 511 FrameTime: 1.957 ms [desktop] blur-radius=5:effect=blur:passes=1:separable=true:windows=4: FPS: 369 FrameTime: 2.710 ms [desktop] effect=shadow:windows=4: FPS: 422 FrameTime: 2.370 ms [buffer] columns=200:interleave=false:update-dispersion=0.9:update-fraction=0.5:update-method=map: FPS: 329 FrameTime: 3.040 ms [buffer] columns=200:interleave=false:update-dispersion=0.9:update-fraction=0.5:update-method=subdata: FPS: 345 FrameTime: 2.899 ms [buffer] columns=200:interleave=true:update-dispersion=0.9:update-fraction=0.5:update-method=map: FPS: 340 FrameTime: 2.941 ms [ideas] speed=duration: FPS: 480 FrameTime: 2.083 ms [jellyfish] : FPS: 506 FrameTime: 1.976 ms [terrain] : FPS: 282 FrameTime: 3.546 ms [conditionals] fragment-steps=0:vertex-steps=0: FPS: 520 FrameTime: 1.923 ms [conditionals] fragment-steps=5:vertex-steps=0: FPS: 520 FrameTime: 1.923 ms [conditionals] fragment-steps=0:vertex-steps=5: FPS: 512 FrameTime: 1.953 ms [function] fragment-complexity=low:fragment-steps=5: FPS: 512 FrameTime: 1.953 ms [function] fragment-complexity=medium:fragment-steps=5: FPS: 515 FrameTime: 1.942 ms [loop] fragment-loop=false:fragment-steps=5:vertex-steps=5: FPS: 512 FrameTime: 1.953 ms [loop] fragment-steps=5:fragment-uniform=false:vertex-steps=5: FPS: 518 FrameTime: 1.931 ms [loop] fragment-steps=5:fragment-uniform=true:vertex-steps=5: FPS: 524 FrameTime: 1.908 ms ======================================================= glmark2 Score: 473 ======================================================= |
I probably need a more up to date driver, but at least the correct hardware is in use!
The above was wrong because the GPU bridge wasn’t in operation
Install the VirtualGL bridge.
Enable vsync
Some tearing while using the intel graphics can be fixed using information from this page: https://wiki.archlinux.org/index.php/Intel_graphics#Tear-free_video.