Saturday, September 16, 2017

Use Intel GPU + NVidia with 1 monitor on a desktop system




I'm planning on running a desktop system with 2 GPU's on one monitor: am I correct that GPU switching is not available in this scenario? So I'll have to boot either using the Intel GPU (but I'll be able to use the NVidia for CUDA stuff/rendering or VGA pass-through to VM) or using the NVidia GPU (for Steam)?



Or is Optimus/Bumblebee also available on the desktop, driving the monitor using one cable with the cards "automagically" aware of one another?



What are your set-ups/experiences?



I just want to close this question by adding what happened in the end.



I installed the nvidia driver using the additional drivers configuration option, to make sure any voodoo that might be doing gets done. Then I installed bumblebee and nvidia-prime. I started out with nvidia-361 on 16.04, but am using nvidia-367 on 16.10 at the moment.




The config files need to be adapted manually in /etc/bumblebee. I am using the following for the nvidia driver:



In bumblebee.conf:



[driver-nvidia]
# Module name to load, defaults to Driver if empty or unset
KernelDriver=nvidia-367
PMMethod=auto
# colon-separated path to the nvidia libraries
LibraryPath=/usr/lib/nvidia-367:/usr/lib32/nvidia-367

# comma-separated path of the directory containing nvidia_drv.so and the
# default Xorg modules path
XorgModulePath=/usr/lib/nvidia-367/xorg,/usr/lib/xorg/modules
XorgConfFile=/etc/bumblebee/xorg.conf.nvidia


The xorg.conf.nvidia file:



xorg.conf.nvidia 
Section "ServerLayout"

Identifier "Layout0"
Option "AutoAddDevices" "false"
Option "AutoAddGPU" "false"
EndSection

Section "Device"
Identifier "DiscreteNvidia"
Driver "nvidia"
VendorName "NVIDIA Corporation"


# If the X server does not automatically detect your VGA device,
# you can manually set it here.
# To get the BusID prop, run `lspci | egrep 'VGA|3D'` and input the data
# as you see in the commented example.
# This Setting may be needed in some platforms with more than one
# nvidia card, which may confuse the proprietary driver (e.g.,
# trying to take ownership of the wrong device). Also needed on Ubuntu 13.04.
BusID "PCI:01:00:0"

# Setting ProbeAllGpus to false prevents the new proprietary driver

# instance spawned to try to control the integrated graphics card,
# which is already being managed outside bumblebee.
# This option doesn't hurt and it is required on platforms running
# more than one nvidia graphics card with the proprietary driver.
# (E.g. Macbook Pro pre-2010 with nVidia 9400M + 9600M GT).
# If this option is not set, the new Xorg may blacken the screen and
# render it unusable (unless you have some way to run killall Xorg).
Option "ProbeAllGpus" "false"

Option "NoLogo" "true"

Option "UseEDID" "false"
Option "UseDisplayDevice" "none"
EndSection


You need to make sure that the driver version matches what you have, and the BusID is important as well.



This basically allows me to switch the GPU using the nvidia settings app (requires logging out and back in) or launching apps on a specific GPU using "optirun -b primus", which I add to Steam games in the launch settings and has worked flawlessly for me ever since.


No comments:

Post a Comment

11.10 - Can't boot from USB after installing Ubuntu

I bought a Samsung series 5 notebook and a very strange thing happened: I installed Ubuntu 11.10 from a usb pen drive but when I restarted (...